Splunk Search

How to trim a string to a new field

anasshsa
Engager

Hello,
I cannot figure out the syntax of the rex function. I have a field called data multiple email addresses: eample@blahblah.com. ODY=7BIT

I need to create a new field where just @blabla.com without the rest of data from the begining or the ending of the filed.

0 Karma

woodcock
Esteemed Legend

Like this:

... | rex field=data "^[^@]*@(?<capture>[^\.]+)"
0 Karma

vnravikumar
Champion
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...