Splunk Search

Adding field to event without altering existing field

phamxuantung
Communicator

I have an index that have a field called ISSUER_NAME, but now we have a new set of events (different log structure) that don't have that ISSUER_NAME but identify by another field. I want to add ISSUER_NAME to that specific event. I tried

 

eval ISSUER_NAME = if(TXN="33","XXX",ISSUER_NAME)

 

In which, TXN="33" is the identifier to those events, XXX is the content of the ISSUER_NAME I want to give to said events, which they don't have. But if I do that, the ISSUER_NAME of old events structure return NULL. I want to ask, is there a way to add field to events without altering existing field?
Thank you.

Labels (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
eval ISSUER_NAME = if(isnull(ISSUER_NAME),if(TXN="33","XXX","N/A"),ISSUER_NAME)

or

eval ISSUER_NAME = coalesce(ISSUER_NAME, if(TXN="33","XXX","N/A"))
0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...