Knowledge Management

Why does alias not always work as expected?

marcus_doron
New Member

In my Results, for each event, I can only get field A OR field B.
I created two aliases: A=C, B=C
So each event should have C with a value.

But in the result, I can see that sometimes C gets value A, sometimes value B, and sometimes Blank.

Tags (2)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi marcus_doron,
If you have only one of the three field with value or if you have an order of importance in your fields, you could use the coalesce function:

| eval C=coalesce(C,A,B)

in this way your C field take value, in order, from C, A, B.

Bye.
Giuseppe

0 Karma
Get Updates on the Splunk Community!

App Building 101 - Build Your First App!

WATCH RECORDING NOW   Tech Talk: App Dev Edition Splunk has tons of out-of-the-box functionality, and you’ve ...

Introducing support for Amazon Data Firehose in Splunk Edge Processor

We’re excited to announce a powerful update to Splunk Data Management with added support for Amazon Data ...

The Observability Round-Up: September 2024

What’s up Splunk Community! Welcome to the latest edition of the Observability Round-Up, a monthly series in ...