Dashboards & Visualizations

GEOSTATS Rename value in piechart

wbolten
Path Finder

Hi,

Is it possible to change the 'name' of the value in a pie chart displayed on a geostats map? The below example shows the piechart. The blue 1 indicate that there are 4 devices with that status. One device with status 14 and 1 with status 3. I have been trying the change the numbers into a readable status. 1=UP,3=WARNING,14=Critical but for some reason I don't seem to make it possible.

alt text

This is the SPL creating the worldmap

index="xxx" Splunk_Node=true
| stats latest(Latitude) as Latitude, latest(Longitude) as Longitude, latest(Node_Status) as Node_Status by NodeID
| geostats count(NodeID) by Node_Status latfield=Latitude longfield=Longitude

Been trying the below. Added this line and change the SPL from Node_Status to NodeStatus but then the map stays empty.

| eval NodeStatus = if(NodeStatus=1,"UP",if(NodeStatus=2,"DOWN",if(NodeStatus=3,"WARNING",if(NodeStatus=14,"CRITICAL",isnull)))) `comment("Change the status number to something readable")`

Someone any thoughts on this?

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

This should do it.

index="xxx" Splunk_Node=true
| eval Node_Status = case (Node_Status=1, "UP", Node_Status=2, "DOWN", Node_Status=3, "WARNING", Node_Status=4, "CRITICAL", 1==1, "OTHER")
| stats latest(Latitude) as Latitude, latest(Longitude) as Longitude, latest(Node_Status) as Node_Status by NodeID
| geostats count(NodeID) by Node_Status latfield=Latitude longfield=Longitude
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

This should do it.

index="xxx" Splunk_Node=true
| eval Node_Status = case (Node_Status=1, "UP", Node_Status=2, "DOWN", Node_Status=3, "WARNING", Node_Status=4, "CRITICAL", 1==1, "OTHER")
| stats latest(Latitude) as Latitude, latest(Longitude) as Longitude, latest(Node_Status) as Node_Status by NodeID
| geostats count(NodeID) by Node_Status latfield=Latitude longfield=Longitude
---
If this reply helps you, Karma would be appreciated.
0 Karma

wbolten
Path Finder

Yep, that has done it. Many thanks. Did not occur to me to use case for this.

I corrected a typo in the CRITICAL part. The status number is 14 and not 4 but it works perfectly.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...