Is there any way to write loops inside filters or outputs plugins?
For a certain message
I want to implement something like below:
reset to c=0
For every message the time needs to get updated until the count reaches 10 and the count needs to reset to 0.
where can i write this logic ? Filters ? outputs ?
I need every message i send to the input filter to get this udpdated before it transforms as output.
Thanks ! that did fix the error but i think my code is written wrong for the requirements. It's actually going to an infinite loop when i want to execute and update only once for every execution and i am getting a grok parse failure
code => "event.set('timestamp', event.get('timestamp_object').to_i * 1000);
puts 'resetting count to 0'
The reason I set "-b 3" is so that I do not have to post a thousand lines of data to demonstrate the issue of different threads interacting. If you set "-w 1" then the result does cycle between 100 and 109, but the solution does not scale.
This might not be the best approach and i am trying to avoid an issues with InfluxDB mentioned here. The only work arounds are to use uuid's as another field or to modify values for fields so that the timestamp values are not similar for at least 5-10 sec.
I thought running through a loop an adding it to timestamps is the best way.
Do you think if writing a shell script to update timestamp values for every record would help ?