Splunk Enterprise

Hi I want to ask " Can I change the number (212),(42) and 181 to the word that I want?

khairilfirza
Explorer

Hi I want to ask if there is anyway for me to change the number to the words.
For example I want to the number 212 is display as maxis.

Tags (1)
1 Solution

datasearchninja
Communicator

Yes you can do this with a case statement, so assuming your graph is currently produced like this, where the numbers are in afield call 'line':

| stats count by line

You could then do this, defaulting back to the number if you haven't set a value:

| eval text=case(line=="181","text_for_181",line=="211","text_for_211",line=="212","maxis",line==42","text_for_42",1==1,line)
| stats count by text

View solution in original post

0 Karma

khairilfirza
Explorer

alt text

datasearchninja
Communicator

Yes you can do this with a case statement, so assuming your graph is currently produced like this, where the numbers are in afield call 'line':

| stats count by line

You could then do this, defaulting back to the number if you haven't set a value:

| eval text=case(line=="181","text_for_181",line=="211","text_for_211",line=="212","maxis",line==42","text_for_42",1==1,line)
| stats count by text
0 Karma

khairilfirza
Explorer

Thanks Colin for a good answer.

Unfortunately I'm so beginner in splunk. Can you show me where I should put your code?

0 Karma

datasearchninja
Communicator

Hi, can you send through the search from the search bar that made the graph in your original post? (If it is in a dashboard, when you mouseover it, you can select the magnifying lens icon to open the underlying search)

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...