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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...