Kusto query Past 7days off each day log count with respect to timestamp

Viewed 29

I'm not expect in kusto query can some one help me out this.

I need past 7days of each day log count with respect to timestamp off table.

Like today is Wednesday log count - 50 Tuesday log count - 105 Monday log count - 65 ...

Like that past 7 days of each day results.

If we assume today date is 9/9/22. I need 8/9/22 to 2/9/22 logs count off each day.

Last 7 days each day count expecting in kusto query

1 Answers

If I understood correctly, you could try this:

TableName
| where Timestamp >= startofday(ago(7d))
| where Timestamp < startofday(now())
| summarize count() by startofday(Timestamp)

result example:

Timestamp count_
2022-09-02 00:00:00.0000000 2269683165695
2022-09-03 00:00:00.0000000 1950416520792
2022-09-04 00:00:00.0000000 1921780739235
2022-09-05 00:00:00.0000000 2161205348826
2022-09-06 00:00:00.0000000 2294524001765
2022-09-07 00:00:00.0000000 2351404246099
2022-09-08 00:00:00.0000000 2386512393024
Related