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
Get Updates on the Splunk Community!

Archived Metrics Now Available for APAC and EMEA realms

We’re excited to announce the launch of Archived Metrics in Splunk Infrastructure Monitoring for our customers ...

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Dashboard Challenge and Watch the .conf24 Global Broadcast!

The Splunk Community Dashboard Challenge is still happening, and it's not too late to enter for the week of ...