Azure Application Insights - Summarize by part of timestamp

Leonardo picture Leonardo · Jun 6, 2017 · Viewed 13k times · Source

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

Answer

Jeremy Hutchinson picture Jeremy Hutchinson · Jun 6, 2017

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)