Splunk Search

use eval to return field that is not null?

sg5258
Explorer

i working on a query to display fields with data others than the string "NULL"..
and i am trying to use eval.

eval new_field=if(field1 !="NULL" "field1--".value1."field2--".value2, field2) 

then continue for the next eval.. then pipe to next eval.

However, i cannot get the result out.. is it my syntax error?

Tags (2)
0 Karma

ziegfried
Influencer

I guess the separating comma is missing:

eval new_field=if(field1!="NULL","field1--".value1."field2--".value2, field2) 
0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...