Search code examples
azure-log-analyticskqlazure-monitor

KQL query - Relatively select data for today in where clause


I need a way to select dataset "since midnight" in Azure Monitor - e.g relative to current day.

Using ago(1d) is obviously not doing the trick :)

StorageBlobLogs
    | where TimeGenerated > ago(1d) and StatusText contains "success"

Cheers


Solution

  • You could try using startofday().

    For example: ... | where TimeGenerated > startofday(now())