[libbeat] Fix add_labels flattening of arrays values#29211
Merged
andrewkroh merged 2 commits intoelastic:masterfrom Dec 1, 2021
Merged
[libbeat] Fix add_labels flattening of arrays values#29211andrewkroh merged 2 commits intoelastic:masterfrom
andrewkroh merged 2 commits intoelastic:masterfrom
Conversation
Contributor
|
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
Contributor
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
The processor was not working as described in the docs. For example:
```yaml
processors:
- add_labels:
labels:
number: 1
with.dots: test
nested:
with.dots: nested
array:
- do
- re
- with.field: mi
```
```json
{
"labels": {
"array": [
"do",
"re",
{
"with": {
"field": "mi"
}
}
],
"nested.with.dots": "nested",
"number": 1,
"with.dots": "test"
}
```
```json
{
"labels": {
"number": 1,
"with.dots": "test",
"nested.with.dots": "nested",
"array.0": "do",
"array.1": "re",
"array.2.with.field": "mi"
}
}
```
e1dfc55 to
4a62f82
Compare
efd6
approved these changes
Dec 1, 2021
Contributor
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
💚 Flaky test reportTests succeeded. 🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
mergify bot
pushed a commit
that referenced
this pull request
Dec 1, 2021
* Fix add_labels flattening of arrays values
The processor was not working as described in the docs. For example:
```yaml
processors:
- add_labels:
labels:
number: 1
with.dots: test
nested:
with.dots: nested
array:
- do
- re
- with.field: mi
```
```json
{
"labels": {
"array": [
"do",
"re",
{
"with": {
"field": "mi"
}
}
],
"nested.with.dots": "nested",
"number": 1,
"with.dots": "test"
}
```
```json
{
"labels": {
"number": 1,
"with.dots": "test",
"nested.with.dots": "nested",
"array.0": "do",
"array.1": "re",
"array.2.with.field": "mi"
}
}
```
* Expose ucfg FlattenedKeys() in common.Config
(cherry picked from commit 1dd9714)
mergify bot
pushed a commit
that referenced
this pull request
Dec 1, 2021
* Fix add_labels flattening of arrays values
The processor was not working as described in the docs. For example:
```yaml
processors:
- add_labels:
labels:
number: 1
with.dots: test
nested:
with.dots: nested
array:
- do
- re
- with.field: mi
```
```json
{
"labels": {
"array": [
"do",
"re",
{
"with": {
"field": "mi"
}
}
],
"nested.with.dots": "nested",
"number": 1,
"with.dots": "test"
}
```
```json
{
"labels": {
"number": 1,
"with.dots": "test",
"nested.with.dots": "nested",
"array.0": "do",
"array.1": "re",
"array.2.with.field": "mi"
}
}
```
* Expose ucfg FlattenedKeys() in common.Config
(cherry picked from commit 1dd9714)
elasticmachine
pushed a commit
to nxei/beats
that referenced
this pull request
Dec 1, 2021
* upstream/master: [libbeat] Fix add_labels flattening of arrays values (elastic#29211) Change elastic-agent pprof default to false (elastic#29155) elastic#28472 fix flaky tests in libbeat fmtstr to use time.UTC instead of time.Local (elastic#28473) Adopt `parsers` in Filebeat's journald input (elastic#29070) [Elastic Agent] Add process error handling guidelines (elastic#29152) winlogbeat/sys/winevent: use reflect IsZero method (elastic#29190) Remove Journalbeat (elastic#29131) Add note that there is no warranty or support for generator code (elastic#28797) packetbeat: preparation for npcap addition (elastic#29017) Use the generic helper for opening file to read in filestream (elastic#29180) Workflow for macos (elastic#29174) Fix `decode_json_fields` processor to always add error key (elastic#29107)
andrewkroh
added a commit
that referenced
this pull request
Dec 1, 2021
* Fix add_labels flattening of arrays values
The processor was not working as described in the docs. For example:
```yaml
processors:
- add_labels:
labels:
number: 1
with.dots: test
nested:
with.dots: nested
array:
- do
- re
- with.field: mi
```
```json
{
"labels": {
"array": [
"do",
"re",
{
"with": {
"field": "mi"
}
}
],
"nested.with.dots": "nested",
"number": 1,
"with.dots": "test"
}
```
```json
{
"labels": {
"number": 1,
"with.dots": "test",
"nested.with.dots": "nested",
"array.0": "do",
"array.1": "re",
"array.2.with.field": "mi"
}
}
```
* Expose ucfg FlattenedKeys() in common.Config
(cherry picked from commit 1dd9714)
Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
andrewkroh
added a commit
that referenced
this pull request
Dec 1, 2021
* Fix add_labels flattening of arrays values
The processor was not working as described in the docs. For example:
```yaml
processors:
- add_labels:
labels:
number: 1
with.dots: test
nested:
with.dots: nested
array:
- do
- re
- with.field: mi
```
```json
{
"labels": {
"array": [
"do",
"re",
{
"with": {
"field": "mi"
}
}
],
"nested.with.dots": "nested",
"number": 1,
"with.dots": "test"
}
```
```json
{
"labels": {
"number": 1,
"with.dots": "test",
"nested.with.dots": "nested",
"array.0": "do",
"array.1": "re",
"array.2.with.field": "mi"
}
}
```
* Expose ucfg FlattenedKeys() in common.Config
(cherry picked from commit 1dd9714)
Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The processor was not working as described in the docs. For example:
Why is it important?
The generated values to not align with the docs or how
labelsis described in ECS.Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.