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!

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

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...