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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...