Custom metric calculation in Kibana


SHORT VERSION: I need to create a visualization in Kibana that shows an index given as a ratio between a "sum" metric over a given period and a "filtered-count" metric over the same period. What is the best approach, if any exist?

LONG VERSION: I am recording UP/DOWN sequences about systems monitored by heartbeat "pings", in a dedicated ES index. Each document in this index is a "sequence" with the following main fields:

  • sequence.status (up/down)
  • sequence.start-time
  • sequence.end-time
  • sequence.duration
  • sequence.continuation (0/1 boolean flag)

The latter "sequence.continuation" flag is there because at the end of each day, for each monitor name, sequences are forced to terminate and new ones are started, even if with the same status. Hence I need to recognize exactly how many "real" sequences are there, for each in a given time period.

I would like to compute the ratio between the sum of the durations of all "UP" sequences and the number of the overall "UP" sequences in that time period, i.e. those for which the "sequence.continuation" flag is 0 (false).

Thanks for any help

Hi Paolo,
I think that you can achieve it with Vega visualization. Please, review the tutorials vega and elastic provides.


Thank you Marta, I'll give a look at the tutorials, even though I would like to stay away from Vega, as it's still given as experimental and does appear as something artificial and extraneous to Kibana


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