[WIP] Improved and consistent logging for Filebeat & Filestream input status reporting #39775
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed commit message
This commit improves Filebeat's input lifecycle logging as well as Filestream logs. All logs related to input starting/stopping now contain the
input_id
key, with the value coming from the defined input ID in the configuration file or sent by the Elastic-Agent.The
input_id
is also propagated to all Filestream sub-components, and their logging is now enhanced with a consistent set of fields about the file being ingested, those fields are:os_id
: The file ID as identified by the OS, the pair [inode, device ID]state_id
: The file state ID, it is part of the ID used in the registry log and checkpoint related to the file. When using fingerprint file identity it contains the fingerprint, when using native file identity it contains the [inode, device ID] pair.source_file
The key used in the registry (in-memory, log and checkpoint). This contains the input type and input IDpath
: The full file path from the file.The input status reprorting when running under Elastic-Agent is also implemented for the Filestream input.
Full logs example from before and after are in the logs section
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact
Author's Checklist
How to test this PR locally
Filebeat
Elastic-Agent
Related issues
Use cases
Screenshots
Logs
The fields not relevant to this PR are redacted.
Single log example for file identity native and fingerprint:
Fingerprint:
Native:
Full logs from two Filestrams input running:
Logs before the change
Logs after the change