Hi All,
I have below DQL query for which I need to setup alerting only if the count per hour is less than 1 from 6am to 11pm CST. Problem is- if the count is zero that hour is not getting captured because of null values, so difficult to put condition check on this. Can anyone suggest how to replace null values with 0 so that alert can be created for such scenario. We are using workflows to create alerts and have total of 10-15 alerts like this scenario which we are trying to group together under single cron of every hour[0 * * * *] by putting hour check in the query as different alerts have different timeframes.
DQL query:
fetch logs, from: -60m, to: now()
| filter matchesPhrase(host.name,“prod*”) //Environment
| filter matchesPhrase(content,“AUTO_ADJUSTMENT”) AND matchesPhrase(content,“submitXMLToKafka”)
| fieldsAdd hour= toLong((formatTimestamp(timestamp, format:“H”, timeZone:“America/Chicago”)))
| summarize count=count(),by: hour
| filter (hour>6 AND hour<23 AND count<1)
Sample output below[hour 6 and 7 are not even captured as count would be zero and treated as null and that’s what we need alerting exactly on]
Thank you!




