Splunk Search

In a table, how do I designate a default message that shows under a certain condition?

gauravepi
Path Finder

I am checking the status code of the HTTP response. In one condition when HTTP code is 411, i don't get a message. So, in that condition, i want to have some default message in the table. But, i am unable to set a default message.

The below query is what I am using:

basic query |eval errMsg=if(status == "411", "Length missing",errMsg) |  table errMsg,status

For other cases, I want to have the errMsg the same as what I am getting back in search.

0 Karma
1 Solution

gauravepi
Path Finder

Below query worked me , i did a string comparison

basic query |eval errMsg=if('status' == "411", "Length missing",errMsg) | table errMsg,status

View solution in original post

0 Karma

gauravepi
Path Finder

Below query worked me , i did a string comparison

basic query |eval errMsg=if('status' == "411", "Length missing",errMsg) | table errMsg,status

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...