Splunk Search

Have field a equal field b if event_type = xxx

bt149
Path Finder

I have a search that is based on two events types - admin_login and admin_change.  Admin_Login has two fields that the admin_change does not.  Those fields are "admin_login_name" and "admin_login_email." 

The fields, other than those two previously mentioned, are the same.  What I'm looking to do:

If event_type=admin_login then admin_login_name = source_user_name AND admin_login_email = source_user_email.

Thanks in advance for the help.

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| eval admin_login_name=if(event_type="admin_login",source_user_name,admin_login_name)
| eval admin_login_email=if(event_type="admin_login",source_user_email,admin_login_email)

View solution in original post

bt149
Path Finder

Thank you very much.  I definitely over thought this one.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| eval admin_login_name=if(event_type="admin_login",source_user_name,admin_login_name)
| eval admin_login_email=if(event_type="admin_login",source_user_email,admin_login_email)
Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...