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!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...