Splunk Search

How can I extract string between highlighted fields with regex?

vik123ash
Explorer

Error: Update failed. First exception on row 0 with id abcd; first error: INVALID_EMAIL_ADDRESS, Email: invalid email address: jrwils@secuamp;gt;: [Email]

0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi vik123ash,
you can use

invalid\semail\saddress:\s(?<invalid_email>[^\[]*)\[Email\]

test it at https://regex101.com/r/hUzreZ/2

Bye.
Giuseppe

View solution in original post

0 Karma

vik123ash
Explorer

Thanks Giuseppe

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi vik123ash,
you can use

invalid\semail\saddress:\s(?<invalid_email>[^\[]*)\[Email\]

test it at https://regex101.com/r/hUzreZ/2

Bye.
Giuseppe

0 Karma

harsmarvania57
Ultra Champion

Hi @vik123ash,

You can use below query to extract email address in new field called Email

... <your search> ... | rex field=_raw "(?:[^\:]*\:){4}(?<Email>.*)\["

I hope this helps.

Thanks,
Harshil

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...