Splunk Search

How to populate field B with field A or field B depending if null?

jalo23
Explorer

I can't figure out the correct syntax for the second eval statement or what else I should use instead of eval. I know the second eval statement syntax is incorrect, I am just placing it here so you can understand what I am trying to accomplish.

| eval FieldA=if(like(computername, "ABC%"), "Yes", "No")
| eval FieldB = if FieldA="No", then FieldB = FieldC, else FieldB = FieldA

Thank you!

Labels (4)
Tags (3)
0 Karma

jalo23
Explorer

Thank you, I appreciate your super-fast response! works perfectly!

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| eval FieldB=if(like(computername, "ABC%"), "Yes", FieldC)
Get Updates on the Splunk Community!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...