# 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:** 1\
**Showing post:** 2

<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)

---

_[View the full topic](https://discuss.elastic.co/t/hourly-average-over-24-hours/201445)._
