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!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...