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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...