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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...