Splunk Search

Regex for pattern match

RashmiGowda
Explorer

Hello

I need a regex expression to match the below patern in my abc.log

Pattern details:

, 2014-03-20 13:43:55.608, 2014-03-20 13:43:55.612,

-- Contains sring values.

Please suggest the regex for this..??

Thanks in advance..!!

Tags (1)
0 Karma
1 Solution

MuS
Legend

Hi RashmiGowda,

based on this one line example try something like this:

... | rex ">,\s(?<stringfield>.+),\s<" | ...

cheers, MuS

View solution in original post

0 Karma

ddrillic
Ultra Champion

You can work on it like this -

your base search 
| eval basavalue="2014-03-20 13:43:55.608"
| rex field=basavalue "(?<a_1>\d\d\d\d)-(?<a_2>\d\d)"
0 Karma

tsmets
Engager

I downvoted this post because question is unclear

0 Karma

MuS
Legend

Hi RashmiGowda,

based on this one line example try something like this:

... | rex ">,\s(?<stringfield>.+),\s<" | ...

cheers, MuS

0 Karma

kristian_kolb
Ultra Champion

RashmiGowda,

You might have to provide a little more information; in which context are you trying to use the regex (search, field extraction, what config files etc), and also; how is it not working.

/k

RashmiGowda
Explorer

Its not working.. 😞

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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

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