# Kibana query: average value

**URL:** <https://discuss.elastic.co/t/kibana-query-average-value/140561>\
**Category:** Kibana\
**Created:** [July 18, 2018, 1:09pm UTC](https://discuss.elastic.co/t/kibana-query-average-value/140561 "2018-07-18T13:09:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![neizmirasego](https://avatars.discourse-cdn.com/v4/letter/n/ac91a4/32.png) [@neizmirasego](https://discuss.elastic.co/u/neizmirasego)\
**Post date:** [July 18, 2018, 1:09pm UTC](https://discuss.elastic.co/t/kibana-query-average-value/140561/1 "2018-07-18T13:09:36Z")

</div>

Hi!

I am looking for a way to create a query in kibana like this: if some field's average value (let's say for the last week) is higher than some threshold. Unfortunately it can not be done with the standard filters or scripted fields because I need to run query based on this field.  
Any ideas will be helpful!

Thanks,  
Alexey

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [July 18, 2018, 8:37pm UTC](https://discuss.elastic.co/t/kibana-query-average-value/140561/2 "2018-07-18T20:37:35Z")

</div>

Hi,

You can use timelion for this. But it really depends on what are you trying to do with your query. Are you looking to create an alert? in which case you will need watcher.

This is a easy to follow timelion tutorial: [https://www.elastic.co/blog/timelion-tutorial-from-zero-to-hero](https://www.elastic.co/blog/timelion-tutorial-from-zero-to-hero)

Thanks,  
Bhavya

---

<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:** [August 15, 2018, 8:37pm UTC](https://discuss.elastic.co/t/kibana-query-average-value/140561/3 "2018-08-15T20:37:37Z")

</div>

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