# Bar chart of 500 status by host

**URL:** <https://discuss.elastic.co/t/bar-chart-of-500-status-by-host/239139>\
**Category:** Kibana\
**Created:** [June 29, 2020, 3:18pm UTC](https://discuss.elastic.co/t/bar-chart-of-500-status-by-host/239139 "2020-06-29T15:18:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![popefelix](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/popefelix/32/71205_2.png) [@popefelix](https://discuss.elastic.co/u/popefelix)\
**Post date:** [June 29, 2020, 3:18pm UTC](https://discuss.elastic.co/t/bar-chart-of-500-status-by-host/239139/1 "2020-06-29T15:18:42Z")

</div>

I'm trying to create a bar graph that counts hosts that have returned HTTP 500 in response to a request. The relevant record structure:  
`{ "host": <hostname>, "status": <HTTP response status> }`

In SQL this would be "SELECT COUNT(\*) FROM logs WHERE status=500 GROUP BY host". Not sure how to do this in Kibana. 🙂

---

<div class="post-metadata">

**Author:** ![popefelix](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/popefelix/32/71205_2.png) [@popefelix](https://discuss.elastic.co/u/popefelix)\
**Post date:** [June 30, 2020, 9:27pm UTC](https://discuss.elastic.co/t/bar-chart-of-500-status-by-host/239139/2 "2020-06-30T21:27:38Z")

</div>

I got it figured out. What I did was to create a vertical bar visualization where the Y axis was "count" and the X axis was a "Terms" aggregation with "host" as the term. Then, in the search bar, I put "status: 500". This gave me the count I needed.

---

<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:** [July 28, 2020, 9:27pm UTC](https://discuss.elastic.co/t/bar-chart-of-500-status-by-host/239139/3 "2020-07-28T21:27:39Z")

</div>

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