All Apps and Add-ons

Dynamic search with inputlookup

stephan_berger
Explorer

Hello Splunk-Community

Given the following lookup file:



error_modsec_msg, threshold

"SQL Injection Attack", 1000

"Cross-site Scripting (XSS) Attack", 10



Based on this static search:


index=it_apache error_modsec_msg="SQL Injection Attack"| stats count by error_modsec_msg | where count > 1000

Is there a way to make the static search dynamic with the values from the lookup files? So to count every occurence of the errormodsecmsg and compare the count to the threshold from the file? I thought about the inputlokup, but I don't know how to implement the whole solution. Or do I have to make a script?

Thanks in advance for your assistance.

Regards,

Stephan

Tags (2)
0 Karma
1 Solution

somesoni2
Revered Legend

Try this

index=it_apache | stats count by error_modsec_msg | lookup <yourlookupfilename> OUTPUT threshold | where count > threshold

View solution in original post

somesoni2
Revered Legend

Try this

index=it_apache | stats count by error_modsec_msg | lookup <yourlookupfilename> OUTPUT threshold | where count > threshold

stephan_berger
Explorer

Perfect, thank you!

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...