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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...