event_flatstore improvement: new header parameter#3650
event_flatstore improvement: new header parameter#3650nikbyte wants to merge 1 commit intoOpenSIPS:masterfrom
Conversation
|
@nikbyte I don't like the idea of hardcoding one single header for any type of events - this will only make sense if you trigger just one single event through event_flatstore, but if you have two, that would be completely broken. |
|
@razvancrainea Thank you for your comment, I'll review it and try to find a better way. |
|
Hey @nikbyte ! Did you have time to look into a new approach for this? Thanks! |
|
Hi @razvancrainea . I haven't had time to look at it yet, but I definitely have plans to redo it better way in the nearest future. |
Summary
This PR adds per-file headers to the event_flatstore module.
With the new
headerparameter, 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
headerWhen the module opens a new file (initial, rotated, or reopened), it will prepend this string as a line if
headeris set.Compatibility
headeris not configured, behavior remains unchanged.