# Aggregate by time only

**URL:** https://discuss.elastic.co/t/aggregate-by-time-only/351063
**Category:** Kibana
**Created:** [January 15, 2024, 10:38am UTC](https://discuss.elastic.co/t/aggregate-by-time-only/351063 "2024-01-15T10:38:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Maiky](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@Maiky](https://discuss.elastic.co/u/Maiky)
#### Post date: [January 15, 2024, 10:38am UTC](https://discuss.elastic.co/t/aggregate-by-time-only/351063/1 "2024-01-15T10:38:17Z")

</div>

I would like to do a count of the amount of log entries over a certain time window, let's say one hour buckets. So log entries from monday 3-4pm should be counted with those from tuesday 3-4pm etc.

I have a timestamp field containing both the date and time. Would I need to split that field into a separate date and time field first and then perform the aggregation, or is there a clever way to do it without splitting the source data?

---

<div class="post-metadata">

### Author: ![Priscilla\_Parodi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/priscilla_parodi/32/43047_2.png) [@Priscilla\_Parodi](https://discuss.elastic.co/u/Priscilla_Parodi)
#### Post date: [January 30, 2024, 8:27pm UTC](https://discuss.elastic.co/t/aggregate-by-time-only/351063/2 "2024-01-30T20:27:49Z")

</div>

Hello @Maiky,

I'm not sure if I would have an ideal solution, but you can try to perform a cumulative sum per hour, something like: `cumulative_sum(count(), shift='1h')` . In this case, you would have the cumulative sum per hour for each day.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [February 27, 2024, 8:28pm UTC](https://discuss.elastic.co/t/aggregate-by-time-only/351063/3 "2024-02-27T20:28:32Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
