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!

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Introducing the Splunk Community Dashboard Challenge!

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

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...