# Hourly Average over 24 hours

**URL:** https://discuss.elastic.co/t/hourly-average-over-24-hours/201445
**Category:** Kibana
**Created:** [September 27, 2019, 5:16pm UTC](https://discuss.elastic.co/t/hourly-average-over-24-hours/201445 "2019-09-27T17:16:59Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![neilp](https://avatars.discourse-cdn.com/v4/letter/n/7c8e57/32.png) [@neilp](https://discuss.elastic.co/u/neilp)
#### Post date: [September 27, 2019, 5:16pm UTC](https://discuss.elastic.co/t/hourly-average-over-24-hours/201445/1 "2019-09-27T17:16:59Z")

</div>

Hi folks,

I am trying to build a bar graph (x-axis=hours 0-23 and y-axis= avg. number of logs) but I have not been able to get this information. I have even tried creating custom Elasticsearch queries with dev tools. But, it has been unsuccessful as well. If you wish to see my queries please let me know and I will post them here

Thanks,  
Neil.

---

<div class="post-metadata">

### Author: ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)
#### Post date: [September 27, 2019, 6:56pm UTC](https://discuss.elastic.co/t/hourly-average-over-24-hours/201445/2 "2019-09-27T18:56:42Z")

</div>

> I am trying to build a bar graph (x-axis=hours 0-23 and y-axis= avg. number of logs) but I have not been able to get this information

You can create a visualization with a histogram aggregation on the a-xis. The example below uses the web logs sample data set that ships with kibana. `hour_of_day` is a scripted field that converts a `date` field into an number for the hour of the day. The script is `doc['timestamp'].value.getHour()`

 ![33%20PM](https://us1.discourse-cdn.com/elastic/original/3X/4/7/47aeb452bafc05b3f05df2eedb5c83b58abce320.png)

---

<div class="post-metadata">

### Author: ![neilp](https://avatars.discourse-cdn.com/v4/letter/n/7c8e57/32.png) [@neilp](https://discuss.elastic.co/u/neilp)
#### Post date: [September 27, 2019, 7:47pm UTC](https://discuss.elastic.co/t/hourly-average-over-24-hours/201445/3 "2019-09-27T19:47:09Z")

</div>

Thank you so much 🙂

---

<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: [October 25, 2019, 7:47pm UTC](https://discuss.elastic.co/t/hourly-average-over-24-hours/201445/4 "2019-10-25T19:47:09Z")

</div>

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