Leonardo
Leonardo

Reputation: 11389

Azure Application Insights - Summarize by part of timestamp

How can I summarize records by year, month,day and hour only?

Upvotes: 38

Views: 27888

Answers (1)

Jeremy Hutchinson
Jeremy Hutchinson

Reputation: 2045

In Application Insights Analytics:

By hour:

requests 
 | summarize count() by bin(timestamp, 1h) 

By day:

requests 
 | summarize count() by bin(timestamp, 1d) 

By month

requests 
  | summarize count()  by bin(datepart("Month", timestamp), 1) 

By year

requests 
  | summarize count()  by bin(datepart("Year", timestamp), 1) 

Upvotes: 95

Related Questions