Splunk Search

I have a problem in creating regex for below expression?

pal_sumit1
Path Finder

expression:
2018-02-2008:13:44|ABC1034|Sumit Martin|0|147707|Amit|SURESH||19490616|M|2030 SQ 16 PERRA|ABC E-212|INDIA|FL|33125|7863174200|Tiger|Transportation|Created|

I have created regex for extracting threefields but not able figure out how to write for other fields.You can assign any name for fields.
Below is my regex:
(?timestamp(\d{4})-(\d{2})-(\d{4}):(\d{2}):(\d{2}))|(?id([A-Z]{3}\d{4}))|(?contact(\d{10}))

After the ? ,there is < timestamp and after field name >. Splunk editor is not allowing me to add that .eg:- < timestamp ">"
Don't keep double quotes.

Thanks.

0 Karma

jodyfsu
Path Finder

Hello, could you provide a sample event?

0 Karma

somesoni2
Revered Legend

Try this (they pipe separated values so regex doing the same, dummy field names are used here, update per your data and it's sequencing in the data)

###props.conf on Search Head
[yourSourceType]
EXTRACT-fields = ^(?<Timestamp>[^\|]+)\|(?<field1>[^\|]+)\|(?<field2>[^\|]+)\|(?<field3>[^\|]+)\|(?<field4>[^\|]+)\|(?<field5>[^\|]+)\|(?<field5>[^\|]+)\|(?<field1>[^\|]+)\|(?<field1>[^\|]+)\|(?<Timestamp>[^\|]+)\|(?<field1>[^\|]+)\|(?<field1>[^\|]+)\|(?<field1>[^\|]+)\|(?<field1>[^\|]+)\|(?<field1>[^\|]+)\|(?<field1>[^\|]+)\|(?<field1>[^\|]+)\|(?<field1>[^\|]+)\|

OR (props.conf and transforms.conf on Search Head)

###props.conf on Search Head
[yourSourceType]
REPORT-fields = psv_fields_for_yourSourceType

###transforms.conf on Search head
[psv_fields_for_yourSourceType]
DELIMS = "|"
FIELDS = "timestamp", "field1", "field2",...comma separated list of all fields..
0 Karma

somesoni2
Revered Legend

If you want to extract the field inline in the search, the regular expression from first option (EXTRACT-fields) in your rex command.

0 Karma
Get Updates on the Splunk Community!

Index This | When is October more than just the tenth month?

October 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

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 & Next in Splunk SOAR

 Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us for an ...