Splunk Search

How do i write a query on SPL to have a flag when next value of an event is greater then the precedence value?

royimad
Builder

How do i write a query on SPL to have a flag when next value on events is greater then the precedence value?

Hereby an example and the expected Result , values are from 1 to 100 and results should be zero or one when next value is greater then precedence value

>     event 1: value 1  [ Result:0]
>     event 2: value 2  [ Result:1]
>     event 3: value 2  [ Result:0]
>     event 4: value 2  [ Result:0]
>     event 5: value 3  [ Result:1]
>     event 6: value 3  [ Result:0]
>     event 7: value 1  [ Result:0]
>     event 8: value 1  [ Result:0]
>     event 9: value 2  [ Result:1]
>     event 10:value 2  [ Result:0]
0 Karma
1 Solution

Matthias_BY
Communicator

Hi,

  • | delta

then you can make a eval with if statement. eval result= if(delta=0, 0, 1)

if the delta value is 0 assign 0 every other value assign 1

br
matthias

View solution in original post

Matthias_BY
Communicator

Hi,

  • | delta

then you can make a eval with if statement. eval result= if(delta=0, 0, 1)

if the delta value is 0 assign 0 every other value assign 1

br
matthias

Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...