Graphing the share of a value over total

Hi folks,

I'm quite new to kibana, and there's something really simple I'd like to do, and can't find the way.

I want to measure the availability of an API over time, so it's simply the percent of successful queries (http 2xx) over the total, along time. Basically something like this

How to do it with kibana ?

If you don't already have the api access log data, I'd highly recommend using Heartbeat which basically pings a hostname/api and then displays the data in the Uptime app in Kibana.
If you already have the data, you can try this:

  1. Create an Area chart visualization on the index that you have.
  2. Set Count as a metric on the Y axis
  3. Set a Date histogram on your time field in the X Axis.
  4. Select Split series on the X Axis, with a Filters aggregation.
  5. In the field, select the field that has the response (in the sample data it's a string field, so i'm going to treat it like that here too).
  6. First filter should be response.keyword: 2* (here response.keyword is the field with the reponse)
  7. Second filter should be NOT response.keyword: 2*
  8. In the metrics & axes tab of the visualization options. set the Y-axis to Mode: Percentage.

You can change it from chart type: area to line if you want it look exactly like your example.