Getting Data In

Help with Regex for a field extraction?

sekhar463
Path Finder

hai all,

need help on regex to extract Major as new field with message whatever after Major

 

Major SIPCM *SipCmRecvFromTcpSocket: Error in reading data on socketId 247, errno=104

Major NRS ARP lookup for 216.20.237.19 on interface pkt0 with addrContextId 1 failed: SIOGARP error , error 6

Major LVM *NpMediaYmacRespHdlr: error code 0x3 recvd for bcm cmd 4

Labels (1)
0 Karma

sekhar463
Path Finder

Want to extract all message after Major and keep in a new fields as Major

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @sekhar463,

ok, all after Major in a field called "Major", please try this:

| rex "^Major\s+(?<Major>.*)"

that you can test at https://regex101.com/r/HBKc52/2

Ciao.

Giuseppe

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @sekhar463,

let me understand:

you want to extract the word after Major (SIPCM, NRS and LVM) in a field called "Major" and the string after these values to the end as "message" field, is it correct?

if this is your need, please try this regex:

| rex "^Major\s+(?<major>\w+)\s+(?<message>.*)"

that you can test at https://regex101.com/r/HBKc52/1

Ciao.

Giuseppe

 

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!

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...