Splunk Search

Displaying a blank timechart in a dashboard panel when no results found.

jason_hotchkiss
Communicator

I am working with a time chart panel in a dashboard.  This dashboard will have a filter for "hosts".  However, this particular sourcetype has a small subset of the servers included in the filter.  I would like this panel to display a blank chart if the filtered server is not part of the values for the dashboards other values.  This is what I have written so far:

<base search>
| search host IN ($host$)
| timechart max(users) by host usenull=f useother=f limit=6
| addtotals
| table _time, host
| fillnull host

What happens here is that only the blank time chart (even when the correct server is selected).

Labels (3)
0 Karma
1 Solution

jason_hotchkiss
Communicator

I found my answer in this thread: https://community.splunk.com/t5/Splunk-Search/Timecharts-and-how-to-avoid-quot-no-results-found-insp...

<base search>
| search host IN ($host$)
| timechart max(users) by host usenull=f useother=f limit=6
| addtotals
| table _time, host
| fillnull host
| appendpipe
[stats count
| eval NoResult=""
| where count=0
| fields - count]

View solution in original post

0 Karma

jason_hotchkiss
Communicator

I found my answer in this thread: https://community.splunk.com/t5/Splunk-Search/Timecharts-and-how-to-avoid-quot-no-results-found-insp...

<base search>
| search host IN ($host$)
| timechart max(users) by host usenull=f useother=f limit=6
| addtotals
| table _time, host
| fillnull host
| appendpipe
[stats count
| eval NoResult=""
| where count=0
| fields - count]

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...