-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not add all contextual information to the same logger in `filestre…
…am` prospector (#26977) ## What does this PR do? This PR creates a separate logger for every FSEvent the prospector encounters to make sure contextual metadata of different files does not get mixed together. Furthermore, now the human-readable format of the file system event is added to the metadata. ## Why is it important? Previously after getting more than one file system event through the file watcher metadata started to pile up in the logger. Notice the duplicated keys "operation", "source_name", "os_id", "new_path" after accepting the second event form the channel: ```json { "id": " 2248D961AFA2E8F", "prospector": "file_prospector", "operation": "create", "source_name": "native::8786365-65029", "os_id": "8786365-65029", "new_path": "/home/n/go/src/github.com/elastic/beats/filebeat/test.log", "operation": "write", "source_name": "native::8786363-65029", "os_id": "8786363-65029", "new_path": "/home/n/go/src/github.com/elastic/beats/filebeat/test.log", "old_path": "/home/n/go/src/github.com/elastic/beats/filebeat/test.log" } ```
- Loading branch information
Showing
3 changed files
with
110 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters