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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...