[8.19] (backport #9341) [beatreceiver] Enable telemetry for indexing errors on ES exporter - and test to ensure sensitive logs are not shipped#10375
Conversation
|
Cherry-pick of eb098ec has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
|
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
|
This pull request has not been merged yet. Could you please review and merge it @khushijain21? 🙏 |
|
This PR requires beats dependency to be bumped. #10524 |
|
This pull request is now in conflicts. Could you fix it? 🙏 |
💛 Build succeeded, but was flaky
Failed CI Steps
History
|
|
This pull request has not been merged yet. Could you please review and merge it @khushijain21? 🙏 |
What does this PR do?
This PR was already reviewed/approved here #8988. The original had to be closed due to security reason.
This PR enables telemetry logs for failed input docs on ES exporter.
This PR also adds a test to ensure sensitive logs from ES exporter or elastic-owned components are not shipped by
filestream-monitoring.And for sensitive logs from ES exporter are also blocked. The reasoning follows
If a document is failed to index for any reason, ES exporter logs the document at debug level.
The format looks something like this
{"log.level":"debug", "@timestamp":"2025-07-14T06:35:24.235Z", "message":"failed to index document; input may contain sensitive data", "input":"{\"create\":{\"_index\":\"logs-test-default\"}}\n{\"host\":{\"hostname\":\"Khushis-MacBook-Pro.local\",\...}\n", "index":"logs-test-default", "error.type":"strict_dynamic_mapping_exception", "error.reason":"", "ecs.version":"1.6.0", }Since the
inputfield above contains a json document andfilestream-monitoring's ndjson parser does not recurseively parse JSON - we can be sure this field in never indexed.This test explicity ensure this behavior is always true
This test is a follow up as part of the discussion here #8738 (comment)
Why is it important?
Checklist
./changelog/fragmentsusing the changelog toolHow to test this PR locally
Related issues
This is an automatic backport of pull request #9341 done by [Mergify](https://mergify.com).