Splunk Search

Pls help me with JOIN to have columns

DataOrg
Builder

i have two columns A and B.
i have values in A column for all rows and B column has some values in rows.
i want to join where B column should replace the values in A columns and if B is empty value it should retain column A value
pls see below columns reference. i want output like c column
A B C
aa bbc bbc
123 321 321
1234 1234
325 325

0 Karma

nickhills
Ultra Champion

Try coalesce

,your search>|eval C=coalesce(B,A)

If my comment helps, please give it a thumbs up!
0 Karma

nikita_p
Contributor

Hi premranjithj,
Can you try below eval if it helps you
index=xyz| eval c=case(if(B="*", "B", B="", "A"))

0 Karma

mayurr98
Super Champion

Try this!

| eval c=if(B!="*",B,A)

Let me know if it helps!

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 ...