Splunk Search

How to display two result count in value visualization?

Roberto-P
Explorer

Hi community, 

I have the follow search that return two number for today and yesterday device count per index xyz but i'm not able to visualize both them as show below the "today" is missing

RobertoP_0-1682616520338.png

This is the search:

 

 

 

| tstats dc(host) where index=*01* earliest=-1d@d latest=-0d@d | multikv | eval TimeWindow="yesterday"
| append 
    [tstats dc(host) where index=*01* earliest=-0d@d latest=now | multikv | eval TimeWindow="today"]

 

 

 

 

Could you please help me to understand how to have a result like this indication today vs yesterday?

RobertoP_1-1682616712423.png

Thank you

Roby

 

 

 

0 Karma
1 Solution

rut
Path Finder

Hi @Roberto-P, I think changing the range from 2 days ago to now, combined with "by _time span=1d" would be enough to get your results in a single search. The addition of the grouped _time field would ensure the visualization can compare it's value to the previous value:

 

| tstats dc(host) as hosts, where index=*01* by _time span=1d

 

Under format visualization (the brush), you should set the following settings to remove the sparkline and display the percentage:

rut_0-1682621662256.png

 

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

The SingleValue visualization displays one value.  If the results are from the timechart command then the SV also can show a sparkline of previous values and the difference between the current value and the previous one.  There is no provision for displaying 2 values.

---
If this reply helps you, Karma would be appreciated.
0 Karma

rut
Path Finder

Hi @Roberto-P, I think changing the range from 2 days ago to now, combined with "by _time span=1d" would be enough to get your results in a single search. The addition of the grouped _time field would ensure the visualization can compare it's value to the previous value:

 

| tstats dc(host) as hosts, where index=*01* by _time span=1d

 

Under format visualization (the brush), you should set the following settings to remove the sparkline and display the percentage:

rut_0-1682621662256.png

 

Roberto-P
Explorer

Thanks a lot Rut for the new search that solved my problem. it works great !

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