Splunk Search

Pleasse help me with IF then ELSE condition in search query

ankitgupta1700
New Member

If my search result has any count I want to append my search with OUTPUTCSV command else null.

Something like if Job.resultCount > 0 add Outputcsv command to query else null.

Tags (3)
0 Karma

cmerriman
Super Champion

will something like this work:

| appendpipe [ stats count | where count==0 |outputcsv]
0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...