Dashboards & Visualizations

display '0' in single value with timechart

Mike6960
Path Finder

My search displays 'no results'

index=* sourcetype="CKBG"
| where CB != GB
| timechart count span=1d

When I use statscount instead it displays '0' . This also what I need. Ik palyed around with fillnull but dont seem to get it working

Tags (1)
0 Karma

mayurr98
Super Champion

Try like this

index=* sourcetype="CKBG"
| where CB != GB
| timechart span=1d count  | appendpipe [| stats count | where count=0 | addinfo | eval _time=info_min_time | table _time count]

OR

 index=* sourcetype="CKBG"
| where CB != GB
| timechart span=1d count | appendpipe [| stats count | where count=0 | addinfo | eval time=info_min_time." ".info_max_time | table time count | makemv time| mvexpand time | rename time as _time | timechart span=1d max(count) as count]

let me know if this helps!

Mike6960
Path Finder

Thanks, the first one works. Don't really understand how it works but thats beside the point. Only thing is that it does not show a trendline now. Second one does not display results.

0 Karma

mayurr98
Super Champion

what is your exact query?

0 Karma

Mike6960
Path Finder

the one i put in my question

0 Karma

Mike6960
Path Finder

I used this one (yours)
index=* sourcetype="CKBG"
| where CB != GB
| timechart span=1d count | appendpipe [| stats count | where count=0 | addinfo | eval _time=info_min_time | table _time count]

0 Karma

mayurr98
Super Champion

how will it show trendline automatically? you would need to use trendline command at the end of the query right?

0 Karma

Mike6960
Path Finder

No, trendline is selected in 'menu' 'formatting visualisation'

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

Can you please look at this answer:
https://answers.splunk.com/answers/176466/how-to-use-eval-if-there-is-no-result-from-the-bas-1.html
It might give you an answer.

0 Karma

Mike6960
Path Finder

This answers 'talks' about when there is no result. I have a result, but that is '0' . Besides that, I use a timechart which isn't mentioned in the answer

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...

Index This | How many sevens are there between 1 and 100?

August 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...