# Watcher: The triggered\_time is 2 hours behind the current time

**URL:** https://discuss.elastic.co/t/watcher-the-triggered-time-is-2-hours-behind-the-current-time/177046
**Category:** Elasticsearch
**Tags:** elastic-stack-alerting
**Created:** [April 16, 2019, 9:40am UTC](https://discuss.elastic.co/t/watcher-the-triggered-time-is-2-hours-behind-the-current-time/177046 "2019-04-16T09:40:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![michael.spaltenstein](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@michael.spaltenstein](https://discuss.elastic.co/u/michael.spaltenstein)
#### Post date: [April 16, 2019, 9:40am UTC](https://discuss.elastic.co/t/watcher-the-triggered-time-is-2-hours-behind-the-current-time/177046/1 "2019-04-16T09:40:01Z")

</div>

**For Example:**

 ![image1](https://us1.discourse-cdn.com/elastic/original/3X/5/5/55553bd3a5995dba6b0d660cc03097eea48d1d5f.jpeg)

**Execution Output:**

> ```
> {
> "watch_id": "49b060ac-cf03-413d-b1d1-bc6b6d2ac2b7",
> "node": "Ukh-HUj2Ts28O82RcpmdiQ",
> "state": "execution_not_needed",
> "user": "user-1",
> "status": {
> "state": {
> "active": true,
> "timestamp": "2019-04-16T08:13:07.407Z"
> },
> "last_checked": "2019-04-16T09:37:07.646Z",
> "actions": {},
> "execution_state": "execution_not_needed",
> "version": -1
> },
> "trigger_event": {
> "type": "schedule",
> "triggered_time": "2019-04-16T09:37:07.646Z",
> "schedule": {
> "scheduled_time": "2019-04-16T09:37:07.452Z"
> }
> },
> "input": {
> "search": {
> "request": {
> "search_type": "query_then_fetch",
> "indices": [
> "logstash-*"
> ],
> "types": [],
> "body": {
> "size": 0,
> "query": {
> "bool": {
> "filter": {
> "range": {
> "@timestamp": {
> "gte": "{{ctx.trigger.scheduled_time}}||-5m",
> "lte": "{{ctx.trigger.scheduled_time}}",
> "format": "strict_date_optional_time||epoch_millis"
> }
> }
> }
> }
> }
> }
> }
> }
> },
> "condition": {
> "script": {
> "source": "if (ctx.payload.hits.total > params.threshold) { return true; } return false;",
> "lang": "painless",
> "params": {
> "threshold": 1000
> }
> }
> },
> "metadata": {
> "name": "test",
> "watcherui": {
> "trigger_interval_unit": "m",
> "agg_type": "count",
> "time_field": "@timestamp",
> "trigger_interval_size": 1,
> "term_size": 5,
> "time_window_unit": "m",
> "threshold_comparator": ">",
> "term_field": null,
> "index": [
> "logstash-*"
> ],
> "time_window_size": 5,
> "threshold": 1000,
> "agg_field": null
> },
> "xpack": {
> "type": "threshold"
> }
> },
> "result": {
> "execution_time": "2019-04-16T09:37:07.646Z",
> "execution_duration": 5,
> "input": {
> "type": "search",
> "status": "success",
> "payload": {
> "_shards": {
> "total": 40,
> "failed": 0,
> "successful": 40,
> "skipped": 0
> },
> "hits": {
> "hits": [],
> "total": 15,
> "max_score": 0
> },
> "took": 4,
> "timed_out": false
> },
> "search": {
> "request": {
> "search_type": "query_then_fetch",
> "indices": [
> "logstash-*"
> ],
> "types": [],
> "body": {
> "size": 0,
> "query": {
> "bool": {
> "filter": {
> "range": {
> "@timestamp": {
> "gte": "2019-04-16T09:37:07.452Z||-5m",
> "lte": "2019-04-16T09:37:07.452Z",
> "format": "strict_date_optional_time||epoch_millis"
> }
> }
> }
> }
> }
> }
> }
> }
> },
> "condition": {
> "type": "script",
> "status": "success",
> "met": false
> },
> "actions": []
> },
> "messages": []
> }
> 
> ```

---

<div class="post-metadata">

### Author: ![Thibaut\_M](https://avatars.discourse-cdn.com/v4/letter/t/d6d6ee/32.png) [@Thibaut\_M](https://discuss.elastic.co/u/Thibaut_M)
#### Post date: [April 16, 2019, 10:01am UTC](https://discuss.elastic.co/t/watcher-the-triggered-time-is-2-hours-behind-the-current-time/177046/2 "2019-04-16T10:01:51Z")

</div>

I have the same issue. It is because watcher run at UTC time and you probably are in UTC+2. That's why you have 2 hours delay.

There is no solution for the moment i think, but a case is opened to add timezone configuration to watcher : [https://github.com/elastic/elasticsearch/issues/34659](https://github.com/elastic/elasticsearch/issues/34659)

Thibaut

---

<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 14, 2019, 10:01am UTC](https://discuss.elastic.co/t/watcher-the-triggered-time-is-2-hours-behind-the-current-time/177046/3 "2019-05-14T10:01:53Z")

</div>

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