Hi all,
I'd like to get value on a field to my previous event to compare this same field with the current value
Explanation: I have:
I would like to do
And streamstats last() current=f window=1 global=f, give me this :
Would anyone have any idea?
Thanks,
Ludovic
streamstats
operates on events in the order they come in, which in a historical search is reverse chronological. So last() will carry the value of the last (and therefore earliest) event that streamstats has encountered in the event stream.
I don't know of a good way to have the latest event carry the value for a "previous" event, because to streamstats, that "previous" event doesn't exist at the time when it runs. You could always use reverse
for flipping the order of the events, but that's obviously pretty ugly...
streamstats
operates on events in the order they come in, which in a historical search is reverse chronological. So last() will carry the value of the last (and therefore earliest) event that streamstats has encountered in the event stream.
I don't know of a good way to have the latest event carry the value for a "previous" event, because to streamstats, that "previous" event doesn't exist at the time when it runs. You could always use reverse
for flipping the order of the events, but that's obviously pretty ugly...
You can add "|sort 0 _time
" before streamstats and "| sort 0 -_time
" after streamstats to get what you need.
That would have the same effect as reverse
though...
Hello Ayn,
Thank you very much for your response.
I understand better now streamstats command and I understand why It will be diffcult to get value.
I am going to see if there are another way to do what I want.
Thanks again,
Bye,
Ludovic
how did you fix this issue ?
Hello,
Did you have a solution to this issue?