-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[filebeat] Add option to dedot keys to decode_json_fields processor #26154
Comments
Hey @OranShuster, I can think on two possible workarounds at the moment for this. Use the script processor to dedot the object or do any other transformation to prevent these issues. Store the result of |
Pinging @elastic/agent (Team:Agent) |
Pinging @elastic/integrations (Team:Integrations) |
its not clear from the {
"app":"appName",
"app.v1.label": "appLabel"
} we will have 2 leaf nodes - i think i will go with the script processor route as it will give me more predictable results Thanks for the reply |
You cannot do that, but if you define for example a
And then in principle you can access to these fields as Fields inside flattened objects support the same operations you would expect for |
I guess you meant here |
Hi! We're labeling this issue as |
Here is an interesting new feature in Elasticsearch that could help with the dots: elastic/elasticsearch#86166 |
Hi! We're labeling this issue as |
👍 |
Hi! We're labeling this issue as |
Describe the enhancement:
We currently use filebeat to send k8s audit logs to ES
A k8s audit log is essentially a very big JSON with information regarding the action made and the response returned
Since it contains the response it also contains labels and annotation which for k8s usually contains dots
So for a case where a pod has 2 labels:
app
andapp.service
we would get a text-object mapping conflictWhile theoretically it's possible to have a mutate filter to fix this issue the labels and annotation name and/or location can change quite frequently so that solution becomes problematic
Describe a specific use case for the enhancement or feature:
For a log such as this
{ "kind": "Event", "apiVersion": "audit.k8s.io/v1", "level": "Request", "auditID": "0a840f68-077e-48d0-a4b8-225da9d696d2", "stage": "ResponseStarted", "requestURI": "/api/v1/nodes/ip-10-8-25-213.us-west-2.compute.internal/proxy/metrics/cadvisor", "verb": "get", "user": { "username": "system:serviceaccount:monitoring:prometheus", "uid": "e74966e4-14ed-41f4-a778-f7ed50a296a0", "groups": [ "system:serviceaccounts", "system:serviceaccounts:monitoring", "system:authenticated" ] }, "sourceIPs": [ "XXXXXX" ], "userAgent": "Prometheus/2.26.0", "objectRef": { "resource": "nodes", "name": "XXXXXXXXXXX", "apiVersion": "v1", "subresource": "proxy" }, "responseStatus": { "metadata": {}, "code": 200 }, "requestReceivedTimestamp": "2021-06-06T13:20:36.598495Z", "stageTimestamp": "2021-06-06T13:20:36.758344Z", "labels": { "app": "app", "app.service": "service" } }
My suggestion is that the decode_json_fields processor will have a
dedot keys
configuration that, when going over any key, will replace dots with underscores before sending it to the outputSo we would see in ES the fields
labels.app
andlabels.app_service
The text was updated successfully, but these errors were encountered: