COALESCE is the ANSI standard SQL function equivalent to Oracle NVL. Unlike NVL, COALESCE supports more than two fields in the list.
In Splunk, coalesce() returns the value of the first non-null field in the list.
Here's an example where you'd get the Preferred_Name if it's present, otherwise use the First_name if it's present, and if both of those are null, then just use the word "Friend". If you didn't include a default at the end, and both fields were blank, you'd just get a blank.
eval name_to_use=coalesce(preferred_name,first_name,"Friend")| table name_to_use
... View more