# How to use time offset Counts into Watcher Script

**URL:** <https://discuss.elastic.co/t/how-to-use-time-offset-counts-into-watcher-script/227733>\
**Category:** Elasticsearch\
**Created:** [April 13, 2020, 6:02am UTC](https://discuss.elastic.co/t/how-to-use-time-offset-counts-into-watcher-script/227733 "2020-04-13T06:02:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pikapi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pikapi/32/49783_2.png) [@Pikapi](https://discuss.elastic.co/u/Pikapi)\
**Post date:** [April 13, 2020, 6:02am UTC](https://discuss.elastic.co/t/how-to-use-time-offset-counts-into-watcher-script/227733/1 "2020-04-13T06:02:31Z")

</div>

I have a calculated metric in the form of a timelion script:

> {count today / [(count offset7days/3) + (count offset14days/3) + (count offset21days/3)]} \* 100

this shows me the % of count this week over average of last 3 weeks.

how do i put this logic into a Watcher script? I want alerts to be coming in every time the percentage drops below 75%

---

<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:** [May 11, 2020, 6:02am UTC](https://discuss.elastic.co/t/how-to-use-time-offset-counts-into-watcher-script/227733/2 "2020-05-11T06:02:38Z")

</div>

Closed on May 11, 2020, 6:02am UTC

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