Splunk Search

Numeric Formatting

mirianseffrin
New Member

Hi, In search time I make a field "eval values ​​= substr (_raw, 82.15)" divided by 100 "eval value = round ((value / 100), 2" the splunk considers it a number and leave with two decimal places in 00.00 format and then I add to display "sum (amount) AS TOTAL_VALOR".
When the result is too large so it appears 211712.76, so I used the command comas "| fieldformat TOTAL_VALOR =" $ "tostring (TOTAL_VALOR," commas ")" so it would appear so $ 211,712.76.
But what I want is for it to appear in the Brazilian standard R $ 211.712,76.
I do not know where I'm going wrong, I am user queries, do not quite understand the setup, I have to change or install something so that he understands the standard Portuguese / Brazil?

Tags (2)
0 Karma

lguinn2
Legend

Sadly tostring does not understand locale.

But you could do this

| fieldformat TOTAL_VALOR = tostring (TOTAL_VALOR," commas ")
| eval TOTAL_VALOR = replace(TOTAL_VALOR,"\,",";")
| eval TOTAL_VALOR = replace(TOTAL_VALOR,"\.",",")
| eval TOTAL_VALOR = replace(TOTAL_VALOR,"\;",".")

It's a pain, I know, but you could put it in a macro and reuse it...

Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

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 ...