Splunk Search

How to extract values between two same characters using regex?

rashid47010
Communicator

How to extract the field values between two same characters.

Event 
Axxtalled=xrxnx xx Client\;**12.0.5294**\;15.179.00\;3x/x/2xx\;, 

I want to extract 12.0.5294

Tags (2)
0 Karma

vnravikumar
Champion

Hi

Try this,

| makeresults 
| eval Axxtalled="xrxnx xx Client\;12.0.5294\;15.179.00\;3x/x/2xx\;," 
| eval result = mvindex(split(Axxtalled,"\;"),1)
0 Karma

harshpatel
Contributor

Hi @rashid47010 ,

Please check this: https://regex101.com/r/l5xt9s/1

Splunk query:

| makeresults count=1 
| eval _raw="Axxtalled=xrxnx xx Client\;12.0.5294\;15.179.00\;3x/x/2xx\;," 
| rex field=_raw "\\\\;(?<myfield>[\d.]+)\\\\;"
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Maximizing the Value of Splunk ES 8.x

Splunk Enterprise Security (ES) continues to be a leader in the Gartner Magic Quadrant, reflecting its pivotal ...

Operationalizing TDIR: Building a More Resilient, Scalable SOC

Optimizing SOC workflows with a unified, risk-based approach to Threat Detection, Investigation, and Response ...

Introducing .conf Stories Series!

“.conf Stories” Series – First Feature: Rich Mahlerwein   Every year .conf brings together some of the most ...