Splunk Search

Split a single field into two fields

Allampally
Path Finder

Hi,

I have a raw_data as below
[APP=XYZ] [m=ServiceName.MethodName] [SLA=100]
Splunk already generated a filed with the name 'm".
I want to split this field into two separate fields(m1 & m2) as below
m1=ServiceName
m2=MethodName

Could anyone help me to do so ?

Tags (1)
0 Karma
1 Solution

cmerriman
Super Champion

without knowing what the data actually looks like, you could try this in the search string:

|rex field=m "(?<m1>.*)\.(?<m2>.*)"

if you would like this to be automatically extracted, you could add the extraction if you are an admin. look over this doc:
http://docs.splunk.com/Documentation/Splunk/7.1.0/Knowledge/Managesearch-timefieldextractions

View solution in original post

cmerriman
Super Champion

without knowing what the data actually looks like, you could try this in the search string:

|rex field=m "(?<m1>.*)\.(?<m2>.*)"

if you would like this to be automatically extracted, you could add the extraction if you are an admin. look over this doc:
http://docs.splunk.com/Documentation/Splunk/7.1.0/Knowledge/Managesearch-timefieldextractions

Allampally
Path Finder

Thank you cmerriman :). It worked for me

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...