# Cannot read search request | Watcher

**URL:** <https://discuss.elastic.co/t/cannot-read-search-request-watcher/194400>\
**Category:** Kibana\
**Tags:** elastic-stack-alerting\
**Created:** [August 8, 2019, 10:32am UTC](https://discuss.elastic.co/t/cannot-read-search-request-watcher/194400 "2019-08-08T10:32:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ntran](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@ntran](https://discuss.elastic.co/u/ntran)\
**Post date:** [August 8, 2019, 10:32am UTC](https://discuss.elastic.co/t/cannot-read-search-request-watcher/194400/1 "2019-08-08T10:32:35Z")

</div>

Hi,

Problem: I am trying to put an alert on for every time a log is not sent.

I have tried to stimulate my watch, but I get the following error message back:  
"[parse\_exception] could not read search request. unexpected object field [query]".

This is what my console looks like:  
{  
"trigger": {  
"schedule": {  
"interval": "1m"  
}  
},  
"input": {  
"search": {  
"request": {  
"query": {  
"query\_string": {  
"default\_field": "content",  
"query": "(forward\_to.keyword) AND (expo)"  
}  
},  
"indices": "edmetric\*"  
}  
}  
},  
"condition": {  
"compare": {  
"ctx.payload.hits.total": {  
"gte": 1  
}  
}  
},  
"actions": {  
"log": {  
"logging": {  
"text": "The number of {{ctx.payload.hits.total}} logs were not sent to Expo"  
}  
}  
}  
}

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [August 8, 2019, 12:46pm UTC](https://discuss.elastic.co/t/cannot-read-search-request-watcher/194400/2 "2019-08-08T12:46:07Z")

</div>

Hi @ntran, thanks for your question.

It seems like you have a little typo in your script - the `request` object should contain a `body` property, not a `query` property

```auto
{
  "trigger": {
    "schedule": {
      "interval": "1m"
    }
  },
  "input": {
    "search": {
      "request": {
        "body": {
          "query_string": {
            "default_field": "content",
            "query": "(forward_to.keyword) AND (expo)"
          }
        },
        "indices": "edmetric*"
      }
    }
  },
  "condition": {
    "compare": {
      "ctx.payload.hits.total": {
        "gte": 1
      }
    }
  },
  "actions": {
    "log": {
      "logging": {
        "text": "The number of {{ctx.payload.hits.total}} logs were not sent to Expo"
      }
    }
  }
}

```

is generated successfully for me.

---

<div class="post-metadata">

**Author:** ![ntran](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@ntran](https://discuss.elastic.co/u/ntran)\
**Post date:** [August 15, 2019, 1:56pm UTC](https://discuss.elastic.co/t/cannot-read-search-request-watcher/194400/3 "2019-08-15T13:56:26Z")

</div>

Thanks so much @flash1293!

---

<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:** [September 12, 2019, 1:56pm UTC](https://discuss.elastic.co/t/cannot-read-search-request-watcher/194400/4 "2019-09-12T13:56:28Z")

</div>

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