-
Notifications
You must be signed in to change notification settings - Fork 146
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 flattened data_stream.* fields #3465
Conversation
This pull request does not have a backport label. Could you fix it @belimawr? 🙏
NOTE: |
d0c797a
to
9da835e
Compare
🌐 Coverage report
|
3f81294
to
a91af36
Compare
07020fb
to
2b2bcad
Compare
9812846
to
da565c3
Compare
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
info := define.Require(t, define.Requirements{ | ||
Local: false, | ||
Stack: &define.Stack{ | ||
Version: version.Agent + "-SNAPSHOT", |
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.
CI was failing because the stack was too old, so I "hardcoded" the version at least to make sure the tests are passing
/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.
A few nits for code clarity but looks good to me!
/test |
51bd99a
to
92b25f5
Compare
99f9579
to
c743823
Compare
/test |
This pull request is now in conflicts. Could you fix it? 🙏
|
c743823
to
71046b2
Compare
|
An input configuration supports flattened fields, however the 'data_stream' field was not being correctly decoded when flattened. This commit fixes this issue. Some small additions and refactoring are also implemented in the integration test framework as well as some more detailed documentation.
Co-authored-by: Paolo Chilà <[email protected]>
Fix all failing tests
71046b2
to
a1c202c
Compare
I rebased onto |
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.
You should update the reference YAML to include an example of this style of configuration, I would recommend modifying the sample log input:
elastic-agent/elastic-agent.yml
Lines 47 to 58 in dba2166
# # Collecting log files | |
# - type: filestream | |
# # Input ID allowing Elastic Agent to track the state of this input. Must be unique. | |
# id: your-input-id | |
# streams: | |
# # Stream ID for this data stream allowing Filebeat to track the state of the ingested files. Must be unique. | |
# # Each filestream data stream creates a separate instance of the Filebeat filestream input. | |
# - id: your-filestream-stream-id | |
# data_stream: | |
# dataset: generic | |
# paths: | |
# - /var/log/*.log |
If the documentation isn't updated nobody is going to use this configuration style :)
We already have examples since about 3 years ago 😱 elastic-agent/elastic-agent.reference.yml Lines 24 to 39 in e9be070
Anyways, I'll edit the |
Revert my last chances in the `elastic-agent.reference.yml` because `mage check` does not like it.
@cmacknz Aside from the flattened examples I pointed out before we also have it shown in our documentation: https://github.com/elastic/ingest-docs/blob/bab384ba275f4ae34696cedbdc1221383b64e1c9/docs/en/ingest-management/elastic-agent/configuration/elastic-agent-configuration.asciidoc?plain=1#L37-L50 I believe we have a good mix of syntax example. I confess I'm puzzled about |
SonarQube Quality Gate |
What does this PR do?
An input configuration supports flattened fields, however the 'data_stream' field was not being correctly decoded when flattened. This commit fixes this issue.
Why is it important?
It increases consistency within the Elastic-Agent configuration and our other projects, like Beats, because they all support flattened configuration keys.
Checklist
- [ ] I have made corresponding change to the default configuration files./changelog/fragments
using the changelog tool## Author's ChecklistHow to test this PR locally
data_stream.*
are flattened. It is even better if there is a mixRelated issues
data_stream
fields #3191## Use cases## Screenshots## LogsQuestions to ask yourself