-
Notifications
You must be signed in to change notification settings - Fork 459
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
Support additional parser configuration: ndjson and multiline in container logs data-stream #2345
Support additional parser configuration: ndjson and multiline in container logs data-stream #2345
Conversation
Signed-off-by: Tetiana Kravchenko <[email protected]>
…iguratios Signed-off-by: Tetiana Kravchenko <[email protected]>
Signed-off-by: Tetiana Kravchenko <[email protected]>
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
…al parsers configuration instead of multilineParser ad jsonParser Signed-off-by: Tetiana Kravchenko <[email protected]>
@mukeshelastic @akshay-saraswat please have a look on the screenshots in the PR description, and let me know if you have any objections on the UI for this feature |
Signed-off-by: Tetiana Kravchenko <[email protected]>
we also discussed with @mukeshelastic option to enable json parser by default, for now was decided to keep it as a advanced configuration, as this configuration applies to all cluster and there is no conditions available to limit it to specified image/namespace. It might be changed later |
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I left a few comments.
packages/kubernetes/changelog.yml
Outdated
@@ -1,4 +1,9 @@ | |||
# newer versions go on top | |||
- version: "1.7.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an enhancement so I would go with 1.8.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done a156f50
default: | | ||
# - ndjson: | ||
# target: json | ||
# - multiline: ~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It this is the baseline config for multiline or just a placeholder? Maybe a more accurate default could be used here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would consider it more as a placeholder, to be honest I am not sure what could be a reasonable default here, any ideas here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe sth like
multiline.type: pattern
multiline.pattern: '^\['
multiline.negate: true
multiline.match: after
The very basic example from https://www.elastic.co/guide/en/beats/filebeat/current/multiline-examples.html#multiline. Of course this is not supposed to cover 100% the possible cases so it would be nice if we can refer to docs so as to be be more clear. The idea of having a more complete config here is to give a sense of how the config looks like and then users can dive more into the docs according their specific use cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -51,6 +54,30 @@ | |||
description: > | |||
Kubernetes hostname as reported by the node’s kernel | |||
|
|||
- name: node.labels.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will also need to document node.annotations.*
even if they are not generated by default and hence the tests would never warn us about having them undocumented. Same for namespace_annotations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done a156f50
…notations.* fields Signed-off-by: Tetiana Kravchenko <[email protected]>
Signed-off-by: Tetiana Kravchenko <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, good job here!
I left a small suggestion about the multiline
, feel free to add it or reject it. Otherwise if CI is happy feel free to merge it!
Great job here @tetianakravchenko ! |
Signed-off-by: Tetiana Kravchenko <[email protected]>
…ainer logs data-stream (elastic#2345) * add sample_event; support ndjson parser Signed-off-by: Tetiana Kravchenko <[email protected]> * add possibility to adjust container, ndjson and multiline parser configuratios Signed-off-by: Tetiana Kravchenko <[email protected]> * add pr link Signed-off-by: Tetiana Kravchenko <[email protected]> * remove test; add container parser configuration; use generic Additional parsers configuration instead of multilineParser ad jsonParser Signed-off-by: Tetiana Kravchenko <[email protected]> * add a link to parsers documentation Signed-off-by: Tetiana Kravchenko <[email protected]> * bump package version to 1.8.0; add node.annotations. and namespace_annotations.* fields Signed-off-by: Tetiana Kravchenko <[email protected]> * add container parser link to the documentation Signed-off-by: Tetiana Kravchenko <[email protected]> * add multiline configuration example Signed-off-by: Tetiana Kravchenko <[email protected]>
What does this PR do?
ndjson
andmultiline
sample_event
and add missing fieldscontainer
parser withformat
andstream
configuration parametersChecklist
changelog.yml
file.How to test this PR locally
Related issues
Screenshots
Example of plain txt log:
Example of nginx plain text log
Example of json logs
Example of elastic-agent json text log