Splunk Search

Stats command not showing field column when data is not there

madhuragujarath
New Member

Hi. I am running below search. Sometimes error does not happen but in that case, stats command shows no data.
Can I show column still with some default value when the error is not happening? I want to show no data as 'NOERRORHere' ?

index=*tech* index=digital_technical_api_gw_hac_raw " New Message Response notification related "   | join type=outer host [|inputlookup  gw_list]  | stats values(apiName) AS API ,values(host) AS host count(eval(statusCode>400)) AS HttpResponseMoreThan400, count(eval(statusCode<400)) AS HttpResponseLessThan400  tp_set , source   | join type=outer max=0 [ search  index=*tech* index=digital_technical_api_gw_hac_raw ("com.ncipher.nfast.connect.StatusNotOK" OR "An Exception was caught while trying to decrypt the data")  | join type=outer host [|inputlookup  gw_list] | stats count as HSMErrorCountsOnGivenStripe by tp_set , source ]
0 Karma

willemjongeneel
Communicator

Hello,

Maybe you can try to add something like this?

| eval output=case(HSMErrorCountsOnGivenStripe=0, "No Errors Here", HSMErrorCountsOnGivenStripe>0, HSMErrorCountsOnGivenStripe)
| table output

Kind Regards,
Willem

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 ...