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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Quantify Your Splunk Investment Impact: Introducing Savings Metrics to Value Insights

Building on the foundation established in our initial Value Insights releases, we are introducing the Savings ...

Event Series: Telemetry Pipeline Management

Balancing Scale and Spend: Gaining Control Over High-Volume Metrics in Splunk Observability Cloud As ...

Kick the Tires Before You Commit: A Hands-On Tour of the Splunk Observability Cloud ...

Evaluating an enterprise observability platform usually goes like this: fill out a form, get a free trial with ...