Angela
Angela

Reputation: 103

Kusto Query Earliest and Latest date in the Past 21 days

So I am new to kusto and I am trying to get the min and max dates of the past 21 days in a kusto query and I want to project those min and max dates.

How do I modify this simple query to get the min and max dates of the past 21 days?

customEvents
| where timestamp >= ago(21d)
| project timestamp

Upvotes: 8

Views: 32874

Answers (1)

Yoni L.
Yoni L.

Reputation: 25955

You can use summarize with max() and min() like this:

customEvents
| where timestamp >= ago(21d)
| summarize min(timestamp), max(timestamp)

Upvotes: 24

Related Questions