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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...