-
Hi, Can anyone suggest ways that vector can increment a counter each time it receives an event from a file source (i.e. a new line is written), and this counter be available to be used in transforms/sinks and also be persisted, so that when vector is restarted, the counter doesn't reset to 0. Bonus question, a specific counter value will be needed for associated events (logs written to a different file) that might happen minutes/hours after the initial event that caused the counter to increment, so the same counter value for the initial event needs to be shared for these subsequent log lines. Hope it makes sense, and thanks in advance for any ideas. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
We don't offer something to maintain global state out of the box. The closest thing that comes to mind is https://vector.dev/docs/reference/configuration/#memory-enrichment-table. |
Beta Was this translation helpful? Give feedback.
-
Thanks for this, looks promising. As does this #22626. |
Beta Was this translation helpful? Give feedback.
We don't offer something to maintain global state out of the box. The closest thing that comes to mind is https://vector.dev/docs/reference/configuration/#memory-enrichment-table.