Splunk Search

Extract numeric values with in a field

iamsplunker
Communicator

We have a field called number and the field number has both alpha and numeric values like "number=AVAILABLE=25 USD;" and the field number also has multi values like number=" CREDIT_PAYMENT=200.22 USD; DEBIT_PAYMENT=500.10 USD;" also it has null values like number=null

I want to extract all dollar amounts like 25 and 200.22 and 500.10 and create a new field. How can I achieve this?

Please help

 

Labels (1)
0 Karma

renjith_nair
Legend

@iamsplunker,

Try and test against your data

|rex field=number max_match=0 "=(?<digits>\d+.?\d+|null)"
---
What goes around comes around. If it helps, hit it with Karma 🙂
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!

Build the Future of Agentic AI: Join the Splunk Agentic Ops Hackathon

AI is changing how teams investigate incidents, detect threats, automate workflows, and build intelligent ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...