Getting error
"input": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"logstash-*"
],
"types": [
"logevent"
],
"body": {
"query": {
"bool": {
"must": [
{
"match": {
"level": "Error"
}
},
{
"match": {
"fields.ApplicationName": "LeadProcessors"
}
},
{
"match": {
"message": {
"query":{ "match_phrase_prefix":"System.Exception: CRMRepository.CreatePostLead failed for LeadId:"
}
}
}
}
]
}
},
"sort": [
{
"@timestamp": "desc"
}
],
"filter": {
"range": {
"@timestamp": {
"from": "now-20m",
"to": "now"
}
}
}
}
}
}
},
Here is the output
{
"_id": "Integrations.CRMDecorator.LeadsNotFoundInCRM_ac89ac1f-89d7-497d-bc20-08f55160790f-2017-10-13T14:51:27.848Z",
"watch_record": {
"watch_id": "Integrations.CRMDecorator.LeadsNotFoundInCRM",
"state": "failed",
"_status": {
"state": {
"active": true,
"timestamp": "2017-10-13T14:50:52.176Z"
},
"actions": {
"send_email": {
"ack": {
"timestamp": "2017-10-13T14:50:52.176Z",
"state": "awaits_successful_execution"
}
}
}
},
"trigger_event": {
"type": "manual",
"triggered_time": "2017-10-13T14:51:27.848Z",
"manual": {
"schedule": {
"scheduled_time": "2017-10-13T14:51:27.848Z"
}
}
},
"input": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"logstash-*"
],
"types": [
"logevent"
],
"body": {
"query": {
"bool": {
"must": [
{
"match": {
"level": "Error"
}
},
{
"match": {
"fields.ApplicationName": "LeadProcessors"
}
},
{
"match": {
"message": {
"query": {
"match_phrase_prefix": "System.Exception: CRMRepository.CreatePostLead failed for LeadId:"
}
}
}
}
]
}
},
"sort": [
{
"@timestamp": "desc"
}
],
"filter": {
"range": {
"@timestamp": {
"from": "now-20m",
"to": "now"
}
}
}
}
}
}
},
"condition": {
"script": {
"inline": "if (ctx.payload.aggregations.minutes20.buckets.size() == 0) return false;def latest = ctx.payload.aggregations.minutes20.buckets[-1]; return latest.occurences.buckets.anyMatch(it->it.doc_count > 0);",
"lang": "painless"
}
},
"result": {
"execution_time": "2017-10-13T14:51:27.848Z",
"execution_duration": 0,
"input": {
"type": "search",
"status": "failure",
"reason": "ParsingException[[match] unknown token [START_OBJECT] after [query]]",
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"logstash-*"
],
"types": [
"logevent"
],
"body": {
"query": {
"bool": {
"must": [
{
"match": {
"level": "Error"
}
},
{
"match": {
"fields.ApplicationName": "LeadProcessors"
}
},
{
"match": {
"message": {
"query": {
"match_phrase_prefix": "System.Exception: CRMRepository.CreatePostLead failed for LeadId:"
}
}
}
}
]
}
},
"sort": [
{
"@timestamp": "desc"
}
],
"filter": {
"range": {
"@timestamp": {
"from": "now-20m",
"to": "now"
}
}
}
}
}
}
},
"actions": []
},
"messages": [
"failed to execute watch input"
]
}
}