Splunk Search

No results found, I want to show other message!!!

caiyundong
Engager

Search :

index=server1 | table processName porcessCount

result A : search has a results.

processName   processCount

java 14

vi   2

result B : search has no results.

No results found, inspector...

How can i display it below...

processName   processCount

 No Process

Thanks.

Tags (1)
1 Solution

jonuwz
Influencer

Like this :

index=server1 | table processName processCount | appendpipe [ stats count | eval processName="No Process" | eval processCount=0 | where count==0 | fields - count ]

View solution in original post

jonuwz
Influencer

Like this :

index=server1 | table processName processCount | appendpipe [ stats count | eval processName="No Process" | eval processCount=0 | where count==0 | fields - count ]

smolcj
Builder
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 ...