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!

Laser Bananas and Edge Hubs: Exploring Operational Technology (OT) Data Through a ...

  OT is a different environment to traditional IT and can have interesting challenges when interfacing the ...

Event Series: Mastering AI Tokenomics and Splunk Agent Observability

Beyond the Black Box: Correlating AI Performance and Tokenomics with Splunk Agent Observability   As ...

span_metrics: The OpenTelemetry-Idiomatic Way to See Inside Your Services

You open a trace in Splunk Observability Cloud and everything looks fine. One root span, order-pipeline, with ...