How do I create a stacked graph of HTTP codes in Kibana?

elasticsearch, kibana

Solution

This is a Kibana 3 answer, check this answer if you are using Kibana 4 or 5

Kibana 3

If I do not misunderstand your question what you need is:

- Define your queries. If you want a bar per response type you need to define one query per response. You have to define a query `field: <value>` for filtering the exact value. For instance, you can have queries like:

- Create an Histogram.

- Configure the Histogram with:

- Queries: You can select all the queries, or select only a few that the ones that you wrote in the first place.

- Panel: You can put a configuration like this. You can set a custom interval to group your logs, you stack the values as individual (makes more sense I think, when you put the mouse over the graph will show the correct value and not the stacked one...). You can experiment a bit with the options.

The final result will be something like:

Problem

I'm sending HTTP logs into Kibana, and the response code (200, 401, 500, etc) are correctly parsed out of them as a field. I'd like a time-series chart with the count of each code shown as bars stacked on top of each other in each interval, in different colors. This should help see if there are suddenly more 500 errors, for example. I'm having a hard time figuring out how to create such a chart in Kibana. Is this possible?

Original source