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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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