Splunk Search

How to write an if else condition in which i need to pass address(path)

ravi1234
New Member

I want a if else condition in which i need to pass address(path) .

Suppose:

If (condition==something)

{Go to this path(ravi/go/bin.log)}

Else if(condition==something)

{go to this path(ravi/python/bin.log)}

Please help me with this. How can we do that.

 

 

 

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Please be a little bit more precise on what you want to achieve and, most importantly, when you want to achieve it.

You posted in "splunk search" section so I assume you want to perform some conditional calculations. Generally, there is a conditional evaluation function if(condition,value_if_true,value_if_false).

In SPL you define a single pipeline processing all the found values. You can use the conditional evaluation in any single step but you cannot "branch" the pipeline.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...

Index This | How many sevens are there between 1 and 100?

August 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...