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!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...