Splunk Enterprise

Splunk regex in fields

leandrodematosp
New Member

I have the field below and I need the value not to have a comma, because I need to add up. How can I change the "," by a "." The fields are Valor and Frete.

Ex: Valor = "164,00"

After: Valor = 164.00

IP="189.80.213.213",Produto="Chuveiro Ducha Advanced Eletronica Turbo Lorenzetti",Valor="164,00",Categoria=Banho,Campanha="2",Vendeu="1",MetododeCompra="1",Bandeira="1",Transportadora="4",Frete="17,26",Time=2021/01/26 19:06:32.179"

IP="187.72.163.215",Produto="Home Sleep Painel Para Tv 32 E 42 Acapulco E Panama Simbal",Valor="159,90",Categoria=Sala,Campanha="2",Vendeu="1",MetododeCompra="1",Bandeira="1",Transportadora="3",Frete="16,31",Time=2021/01/26 19:06:31.779"

.

Labels (1)
Tags (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

You can use either replace or rex like this

| eval Frete=replace(Frete, ",", ".")
| rex field=Valor mode=sed "s/,/./"

 

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

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