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!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...