# Metric - show last consecutive values

**URL:** <https://discuss.elastic.co/t/metric-show-last-consecutive-values/303902>\
**Category:** Kibana\
**Created:** [May 4, 2022, 5:47am UTC](https://discuss.elastic.co/t/metric-show-last-consecutive-values/303902 "2022-05-04T05:47:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Itiel\_Olenick](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itiel_olenick/32/102775_2.png) [@Itiel\_Olenick](https://discuss.elastic.co/u/Itiel_Olenick)\
**Post date:** [May 4, 2022, 5:47am UTC](https://discuss.elastic.co/t/metric-show-last-consecutive-values/303902/1 "2022-05-04T05:47:05Z")

</div>

Hi there,

We have data coming in from a health check we preform on our services, and i am trying to figure out a way to create a metric that will show the last consecutive fails.

The data field for the health-check is a binary 1 or 0 for the health of the service.

The metric should turn from green to yellow to red according to the number of consecutive fails, and if the last value was 1 (success) then it should turn back to green, since the consecutive number of fails is 0.

Example:

3 consecutive fails -\> turn yellow.  
1 success -\> turn back to green.

Thanks in advance,  
Itiel

---

<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:** [June 1, 2022, 5:48am UTC](https://discuss.elastic.co/t/metric-show-last-consecutive-values/303902/2 "2022-06-01T05:48:00Z")

</div>

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