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!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...