Splunk Search

How to subtract a string from value field

anasshsa
Engager

I Need to know to subtract a string from the begining of a value until a specific character in Spl. For example, if I have a field who contains emails or another data:
MAIL FROM: YYYY@XXXXX.com BODY=7BIT
How to get just the email address YYYY@XXXXX.com
Thanks for the help.

Tags (3)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

This is very similar to your earlier question, but the example is different and so is the answer. This rex command will put the email address in the emailAddr field.

... | rex field=foo "(?<emailAddr>[^\s]+)" | ...
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...