-
Notifications
You must be signed in to change notification settings - Fork 152
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
Add filesource provider #6587
Add filesource provider #6587
Conversation
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
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.
changes look good to me
Quality Gate passedIssues Measures |
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 with a note: I’d prefer a design with more isolation between event consumption and the file content reading. For instance, a goroutine could handle fsnotify events and mark map entries as “dirty,” while another periodically processes these at its own pace. This would mitigate risks like event overflow or frequent re-rendering caused by rapidly changing files (which even a malicious entity could try to exploit).
That said, let’s remain profile-driven - if issues arise, we can iterate and refine the solution as needed.
You can file an issue in https://github.com/elastic/ingest-docs describing how this works to get it included in the provider documentation, assuming we want this available outside of internal use. |
What does this PR do?
Adds the
filesource
provide to composable.The provider watches for changes of the files and updates the values of the variables when the content of the file changes.
Why is it important?
This allows information from the filesystem to be used as variables in the Elastic Agent configuration. This information is only allowed by explicitly configuring the provider to read this information from the disk. The policy cannot just read any file, it has to be explicitly configured to allow it.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files./changelog/fragments
using the changelog tool[ ] I have added an integration test or an E2E test(covered by unit tests well)Disruptive User Impact
None
How to test this PR locally
Create a configuration:
elastic-agent.yml
echo "/var/log/syslog" > ./file1
Observe that syslog is set to paths.
Related issues