I'm using Kibana and Elasticsearch 6.3, and after generating a report PDF from a visualization, I have tried to automate it inside of a watcher. The watcher always fires / 1 day, but its execution is failing with the below error message:
- I've tried it with and without the connection_timeout
- I've tried it with "scheme:http" and "scheme:https"
- I've tried speeding up the watcher to fire / 5 minutes for testing
- I've successfully sent emails with other watchers
- I duplicated the watcher code presented in:
You Get A Report! You Get a Report! - I dropped in the search parameters and triggering conditions from a good, working watcher.
- I'm able to generate the report manually with the Visualization:Report:Generate button
- The IP Address that the reporting URL references is the same machine running the Kibana instance, and the 3rd node (master, non-data) in our elasticsearch cluster
What am I doing wrong?
Watcher Execution [Error] Result:
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
{
"watch_id": "Daily_Report_Part_Events_per_Product",
"node": "CmPiz4-kQ1moZQsiDNuAnA",
"state": "executed",
"status": {
"state": {
"active": true,
"timestamp": "2019-06-04T14:17:59.245Z"
},
"last_checked": "2019-06-04T14:20:38.048Z",
"last_met_condition": "2019-06-04T14:20:38.048Z",
"actions": {
"Email_Daily_Report": {
"ack": {
"timestamp": "2019-06-04T14:14:30.297Z",
"state": "awaits_successful_execution"
},
"last_execution": {
"timestamp": "2019-06-04T14:20:38.048Z",
"successful": false,
"reason": ""
}
}
},
"execution_state": "executed",
"version": -1
},
"trigger_event": {
"type": "schedule",
"triggered_time": "2019-06-04T14:20:38.048Z",
"schedule": {
"scheduled_time": "2019-06-04T14:20:37.788Z"
}
},
"input": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"monitoring-loading-last-file-state*",
"logstash*",
"monitoring-loading-processed*",
"monitoring-loading-raw*",
"monitoring-part-event*"
],
"types": ,
"body": {
"size": 0,
"query": {
"bool": {
"filter": {
"range": {
"@timestamp": {
"gte": "{{ctx.trigger.scheduled_time}}||-1d",
"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": -1
}
}
},
"metadata": {
"name": "[Daily Report] Part Events / Product / Hour"
},
"result": {
"execution_time": "2019-06-04T14:20:38.048Z",
"execution_duration": 127246,
"input": {
"type": "search",
"status": "success",
"payload": {
"_shards": {
"total": 1410,
"failed": 0,
"successful": 1410,
"skipped": 1380
},
"hits": {
"hits": ,
"total": 60256,
"max_score": 0
},
"took": 66,
"timed_out": false
},
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"monitoring-loading-last-file-state*",
"logstash*",
"monitoring-loading-processed*",
"monitoring-loading-raw*",
"monitoring-part-event*"
],
"types": ,
"body": {
"size": 0,
"query": {
"bool": {
"filter": {
"range": {
"@timestamp": {
"gte": "2019-06-04T14:20:37.788Z||-1d",
"lte": "2019-06-04T14:20:37.788Z",
"format": "strict_date_optional_time||epoch_millis"
}
}
}
}
}
}
}
}
},
"condition": {
"type": "script",
"status": "success",
"met": true
},
"transform": {
"type": "script",
"status": "success",
"payload": {
"result": 60256
}
},
"actions": [
{
"id": "Email_Daily_Report",
"type": "email",
"status": "failure",
"error": {
"root_cause": [
{
"type": "http_host_connect_exception",
"reason": "Connect to 10.4.2.26:5601 [/10.4.2.26] failed: Connection timed out (Connection timed out)"
}
],
"type": "http_host_connect_exception",
"reason": "Connect to 10.4.2.26:5601 [/10.4.2.26] failed: Connection timed out (Connection timed out)",
"caused_by": {
"type": "connect_exception",
"reason": "Connection timed out (Connection timed out)"
}
}
}
]
},
"messages":
}