In this article, we learn on how to implement datetime range in Kusto Query Language (KQL) , Just follow and ready clearly.

For more updates please do Subscribe via Email:

What is Kusto Query Language (KQL)

Kusto is a query language designed for big data workloads particularly using large amount of data in from things like logs and event sources. Kusto  query is a read-only request to process data and return results. KQL is the first party query language for Kusto cluster used by Azure Data Explorer. Kusto Query is only good for pulling or getting data from the data bank. for more article about Kusto. Please refer this link.

Kusto Query Language (KQL)

Between Operator

You can implement date range in Kusto Query Language by using Between Operator. Between Operator can filters a record set for data matching the values in an inclusive range.

Between can operate on any numeric, datetime, or timespan expression.

Syntax

| where columnName between (FromRange .. ToRange)

If expr expression is datetime – another syntactic sugar syntax is provided:

| where columnName between (FromRangeDateTime .. ToRangeTimespan)

Implementation

// date range in kusto query langauge
cluster('help.kusto.windows.net').database('Samples').StormEvents
| where EndTime between (datetime(2007-01-01 23:59:00) .. datetime(2007-01-18 23:59:00)) 

Happy Learning..

Thank you for visiting my blog site. Hoping you learn more here. please feel free to comment and suggest if there is need to enhance and update. thank you.

Related Topics

Leave a Reply

Your email address will not be published. Required fields are marked *