Splunk Enterprise

Having a space as the thousands separator, and be able to order when you click on the column

alvesri
Engager

Hi guys can you please help me ?

I'm trying to use a space as thousands separator and I can't, the max that I could it's a comma with this:

 eval value= if(value!="N/A",printf("%'d",value),value)


Result = 123,456

so I guess I can change it with a replace maybe,

But then we have problem number 2 ,

When I try to sort the by value in the arrow of the column, the sort it isn't correct, and the bigger numbers are considerate as strings. 

Can you guys help me solve this please ?

Tell me if you need more things 

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| fieldformat value=replace(tostring(value,"commas"),","," ")

View solution in original post

isoutamo
SplunkTrust
SplunkTrust

Hi

you should look

  • fieldformat
  • tostring(var,”commas”)

which fulfills your requirement.

r. Ismo

0 Karma

alvesri
Engager

Hi thank you for the reply,

I tried that, and it works replacing the comma with a space, but the issue it's next when i click on the column to sort in a descending order, and the numbers are not sorted correctly, because some of them are string and others are numbers, and I tried the conversion "tonumber()" 

0 Karma

isoutamo
SplunkTrust
SplunkTrust
Fieldformat is just to keep those values as numbers instead of covert those to string as happened with eval.
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| fieldformat value=replace(tostring(value,"commas"),","," ")

alvesri
Engager

Hi guys,

I did this ant it worked in replacing the comma, thank you. 
The N/A is in case i'ts empty.

| eval value= if(value!="N/A", replace(tostring(value,"commas"),","," "),value)

But the thing is, I can't order it correctly. 

0 Karma
Get Updates on the Splunk Community!

Fueling your curiosity with new Splunk ILT and eLearning courses

At Splunk Education, we’re driven by curiosity—both ours and yours! That’s why we’re committed to delivering ...

Splunk AI Assistant for SPL 1.1.0 | Now Personalized to Your Environment for Greater ...

Splunk AI Assistant for SPL has transformed how users interact with Splunk, making it easier than ever to ...

Unleash Unified Security and Observability with Splunk Cloud Platform

     Now Available on Microsoft AzureOn Demand Now Step boldly into the AI revolution with enhanced security ...