- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Help with if "null" command
Hi splunkers,
I want to use "null" command in below query. If the message is "null" then it should replace with the below message otherwise it should only display the already extracted message.
| eval message= if(Actor="superman","super hero", if(Actor="emma watson","model"))
Thanks.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Give this a try
| eval message= coalesce(message,case(Actor="superman","super hero",Actor="emma watson","model", true(),"NA"))
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your quick response @somesoni2
could you please also provide the spl using "isnull" ?
Really appreciate your support.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

| eval message= if(isnotnull(message),message,case(Actor="superman","super hero",Actor="emma watson","model", true(),"NA"))
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @super_saiyan ... please check this isnull():
|makeresults | eval Actor="emma watson"
| eval message = if(isnull(message),if(Actor="superman","super hero", if(Actor="emma watson","model", "not emma")),message) | table message
Sekar
PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am getting error while using the below SPL Query
Could you please help me with that ?
appreciate your help.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @super_saiyan .. your "if" format was wrong.. pls check this..
|makeresults | eval Actor="emma watson" | eval message = if(isnull(message, null(),if(Actor="superman","super hero", if(Actor="emma watson","model", "not emma")) | table message
could you pls check this and update us with some more details:
>>> If the message is "null" then it should replace with the below message.
>>> otherwise it should only display the already extracted message.
Sekar
PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
