justinw
(Justin Walz)
May 29, 2019, 11:41pm
1
Hi,
Hopefully a quick one. I want to add document metadata via processors, however the value depends on event values.
How would I get something like this to work? I tried the following formats with no luck.
processors:
- add_fields:
when:
has_fields: ['container.name']
target: internal_namespace
fields:
a: '%{container.name}'
b: '%{data.container.name}'
c: '%{[container][name]}'
d: '%{[data][container][name]}'
e: container.name
f: data.container.name
Thanks, Justin
Hi,
The format strings you're trying are not supported in processors.
So none of the ones your tried is written correctly but even if it was, it wouldn't work.
But the dissect processor is made to do that:
processors:
- dissect:
tokenizer: "%{a}"
field: "container.id"
target_prefix: "internal_namespace"
Should give:
"internal_namespace": {
"a": "f99a1886631e817d33e37238d7224ad6cad5c417978a8e6cfc2e307662d956bc"
},
"container": {
"id": "f99a1886631e817d33e37238d7224ad6cad5c417978a8e6cfc2e307662d956bc"
}
Edit: It's made... to do a lot more than that, but it can do just that too.
justinw
(Justin Walz)
May 30, 2019, 1:56am
3
This is what I was looking for, thanks!
system
(system)
Closed
June 27, 2019, 3:56am
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.