Splunk Search

Can a Splunk alert be triggered by comparing a single integer value returned by two searches?

jbrenner
Path Finder

Is it possible to write two searches, each of which returns a single integer result, and trigger an alert based on whether the value returned by search 1 is greater than the value returned by search 2?

Thanks,
Jonathan

0 Karma

aaraneta_splunk
Splunk Employee
Splunk Employee

@jbrenner - Were you able to test out gpradeepkumarreddy's solution? Did it work? If yes, please don't forget to resolve this post by clicking on "Accept". If you still need more help, please provide a comment with some feedback. Thanks!

0 Karma

pradeepkumarg
Influencer

You can do all this in one search

search A | append [search B] | compute here...

example

index=_internal earliest=-20s | stats count as value | append [search index=_internal earliest=-10s | stats count as value] | eventstats sum(value) as Total | eval flag = if((value > (Total-value)),"Y","N") | head 1 | search flag="Y"

0 Karma
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 ...