Knowledge Management

Visualization solution

waJesu
Path Finder

I am new to splunk administration. may someone help with a query that gives both reporting and non-reporting devices in the last 1 hour and be able to show both on a pie-chart

Labels (1)
0 Karma

waJesu
Path Finder

Thanks Ralph. Would you help with the search query for the reporting devices

 

0 Karma

rnowitzki
Builder

Hi @waJesu ,

well, it really depends on your data. 

But to give you an example.

index=<yourindex>  earliest=-24h latest=now 
| stats count  by device | eval day="yes"
| appendcols  [search index=<yourindex>  earliest=-1h latest=now 
| stats count  by device| eval hour="yes"]
| eval status=if(hour="yes","Up","Missing")
| fields - hour, day, count
| stats count by status


This will give you the pure count of "missing" and "up" devices based on a 24h vs 1h compare. In the visualization tab you would select pie chart and your done.

You have to set the index to match your data and also you probably have to change "device" to whatever field your "device" name is stored in. Maybe "host"?

If you remove the last line, you see which devices are missing/up.

Hope it gives you an idea.
BR
Ralph

--
Karma and/or Solution tagging appreciated.
0 Karma

waJesu
Path Finder

Hey Brian. I am not sure why it's returning  Error in "eval" command: The expression is malformed. Expected

0 Karma

rnowitzki
Builder

Not Brian here, but anyways 🙂

Can you copy&paste your SPL and the whole error message? The only 2 evals in my example are pretty straight forward, not sure what could have gone wrong.

BR
Ralph aka Brian

--
Karma and/or Solution tagging appreciated.
0 Karma

rnowitzki
Builder

Hi @waJesu ,

You would need some base to start from. Splunk doesn't really know what's not there.
There are different approaches for this. I'll give you two:

1. Compare the devices that reported in the last 24h with the ones that reported in the last 1h
2. Maintain a Lookup table with all the devices that should report and compare this with the ones that reported in the last 1h.

To help you with the SPL, it would be helpful to see some example data. What kind of devices are in the logs, how do you determine that they are reporting? Do you look for any kind of log from each host(?) or do you expect some specific logline? 

BR
Ralph

--
Karma and/or Solution tagging appreciated.
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!

Make Your Machine Data AI-Ready in Splunk

Every team is getting ready for AI agents.   Thursday, November 12, 2026  |  11AM  PST / 2PM EST   ...

Splunk Asynchronous Forwarding Explained

Splunk asynchronous forwarding is often misunderstood as simply setting autoLBVolume. That is not quite right. ...

How to Monitor AI Agents with Splunk Agent Observability

Let’s say I’m running a travel planning AI app in production. A user asks for three concise hotel options in ...