Splunk Search

Need help in getting the value in vizualization as 0 instead of no result.

jerinvarghese
Communicator

Need help in getting the value in vizualization as 0 instead of no result.

index=nw_syslog "FPC"
|rex field=_raw "FPC: (?.*), jnxFruTyp"
| stats latest(_time) as Time_CST count by hostname,MEMBER
| sort - Time_CST
| fieldformat Time_CST=strftime(Time_CST,"%x %X")
| head 20
| stats sum(count)

Visualization used 42 single value.

0 Karma
1 Solution

TISKAR
Builder

Hello:

You can find a solution in this link:

https://answers.splunk.com/answers/582253/replacing-no-results-found-with-0.html

| appendpipe [stats count | where count=0]

View solution in original post

0 Karma

TISKAR
Builder

Hello:

You can find a solution in this link:

https://answers.splunk.com/answers/582253/replacing-no-results-found-with-0.html

| appendpipe [stats count | where count=0]
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@jerinvarghese

Try by appending | appendcols [stats count ]

like..
Your Search | stats sum(count) as count | appendcols [stats count ]

Note: I have updated stats command,

0 Karma

jerinvarghese
Communicator

that worked, thanks so much for that help.

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

Great @jerinvarghese. Can you please upvote and accept this answer to close this question?

0 Karma
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...