# Elasticsearch query for time the value has not changed

**URL:** https://discuss.elastic.co/t/elasticsearch-query-for-time-the-value-has-not-changed/520
**Category:** Elasticsearch
**Created:** [May 11, 2015, 6:46pm UTC](https://discuss.elastic.co/t/elasticsearch-query-for-time-the-value-has-not-changed/520 "2015-05-11T18:46:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Aravind\_Chennuru](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aravind_chennuru/32/44872_2.png) [@Aravind\_Chennuru](https://discuss.elastic.co/u/Aravind_Chennuru)
#### Post date: [May 11, 2015, 6:46pm UTC](https://discuss.elastic.co/t/elasticsearch-query-for-time-the-value-has-not-changed/520/1 "2015-05-11T18:46:30Z")

</div>

Hi All,

I am kind of new to elasticsearch queries and I would like to get the information about the time since the last value change, in the following example the time the value is 1 = 5 seconds. Is there a way to do it, if no, can someone think of a way to achieve this?

@timestamp: May 11th 2015, 14:35:43.708 Key: service1 values: 1  
@timestamp: May 11th 2015, 14:34:43.708 Key: service1 values: 1  
@timestamp: May 11th 2015, 14:33:43.708 Key: service1 values: 1  
@timestamp: May 11th 2015, 14:32:43.708 Key: service1 values: 1  
@timestamp: May 11th 2015, 14:31:43.708 Key: service1 values: 1  
@timestamp: May 11th 2015, 14:30:43.708 Key: service1 values: 0

I am basically trying to figure out my application uptime from this data that we already have.

Thanks & Regards,  
Aravind Chennuru

---

<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 6, 2017, 12:14am UTC](https://discuss.elastic.co/t/elasticsearch-query-for-time-the-value-has-not-changed/520/2 "2017-07-06T00:14:35Z")

</div>


