Splunk Search

Adding email domain to values

Sparky1
Explorer

I have a field, let's say the user field, that has both usernames without a domain and some with.

I want the fields values that don't have an extension to have it added

 

Example:

sparky1

sparky2@splunk.com

 

I want to be able to append splunk.com to the sparky1 value, without adding it again to sparky2@splunk.com

Labels (1)
Tags (1)
0 Karma
1 Solution

somesoni2
Revered Legend

You can do something like this

Your base search with field say "username"
| eval username=if(match(username,"splunk.com$"),username,username."@splunk.com")

View solution in original post

0 Karma

somesoni2
Revered Legend

You can do something like this

Your base search with field say "username"
| eval username=if(match(username,"splunk.com$"),username,username."@splunk.com")
0 Karma

Sparky1
Explorer

That worked! Thanks

0 Karma
Get Updates on the Splunk Community!

Build Scalable Security While Moving to Cloud - Guide From Clayton Homes

 Clayton Homes faced the increased challenge of strengthening their security posture as they went through ...

Mission Control | Explore the latest release of Splunk Mission Control (2.3)

We’re happy to announce the release of Mission Control 2.3 which includes several new and exciting features ...

Cloud Platform | Migrating your Splunk Cloud deployment to Python 3.7

Python 2.7, the last release of Python 2, reached End of Life back on January 1, 2020. As part of our larger ...