Splunk Search

Set a default value for rows when they don't get a hit

codetester
Loves-to-Learn Lots

 

So we have a query:

 

(index="it_ops")  source="bank_sys" message.content.country IN ("CANADA","USA","UK","FRANCE","SPAIN","IRELAND") message.content.code <= 399 | stats max(message.timestamp) as maxtime by message.content.country

 

Now this returns a two column result with country, maxtime. However, when there is no hit for country that country is omitted. I tried fillnull but it is only adding columns not rows.

 How do we set a default maxtime for countries that are not found.

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Splunk is not good at finding something that isn't there - you need to help it!

| append
    [| makeresults
    | fields - _time
    | eval message.content.country=split("CANADA,USA,UK,FRANCE,SPAIN,IRELAND",",")
    | mvexpand message.content.country
    | eval maxtime=now()]
| stats min(maxtime) as maxtime by message.content.country
0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...