Splunk Search

How to add to search based on the token being set

amdosh
Explorer

I want to add a few rex statements to my existing search based on the token being set. Please see example below. 

ex:
| regex _raw="$token1$"
if($token2$){
| regex _raw!="abc"
| regex _raw!="xyz"
}

Please let me know if I can achieve this in some other way. Thanks!

Labels (1)
0 Karma
Get Updates on the Splunk Community!

[Live Demo] Watch SOC transformation in action with the reimagined Splunk Enterprise ...

Overwhelmed SOC? Splunk ES Has Your Back Tool sprawl, alert fatigue, and endless context switching are making ...

What’s New & Next in Splunk SOAR

Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us on ...

Your Voice Matters! Help Us Shape the New Splunk Lantern Experience

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...