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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...