event_flatstore improvement: new header parameter #3650
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.
Summary
This PR adds per-file headers to the event_flatstore module.
With the new
header
parameter, you can write an arbitrary string (e.g. CSV column names) as the very first line of every newly created or rotated log file — making it easier to work with parsers and analysis tools.Details
Current behavior
When a flatstore log file is rotated, the new file starts immediately with data lines — no header is added.
Problem
Many downstream tools expect a header row (e.g. in CSV files). Manually injecting headers after rotation is error-prone and inconvenient. Letting the module write the header automatically ensures consistency.
Solution
header
When the module opens a new file (initial, rotated, or reopened), it will prepend this string as a line if
header
is set.Compatibility
header
is not configured, behavior remains unchanged.