# Watcher does not support search type scan anymore?

**URL:** https://discuss.elastic.co/t/watcher-does-not-support-search-type-scan-anymore/41259
**Category:** Elasticsearch
**Tags:** elastic-stack-alerting
**Created:** [February 9, 2016, 9:42am UTC](https://discuss.elastic.co/t/watcher-does-not-support-search-type-scan-anymore/41259 "2016-02-09T09:42:27Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![terramexx](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@terramexx](https://discuss.elastic.co/u/terramexx)
#### Post date: [February 9, 2016, 9:42am UTC](https://discuss.elastic.co/t/watcher-does-not-support-search-type-scan-anymore/41259/1 "2016-02-09T09:42:27Z")

</div>

ELK 2.2.0

According the doc the watcher should support request.search\_type: scan  
[https://www.elastic.co/guide/en/watcher/current/input.html#input-search](https://www.elastic.co/guide/en/watcher/current/input.html#input-search)

According this response it does not:

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "parse_exception",
        "reason": "could not read search request. value [SCAN] is not supported for field [search_type]"
      }
    ],
    "type": "parse_exception",
    "reason": "could not parse [search] input for watch [ito_dcs]. failed to parse [request]",
    "caused_by": {
      "type": "parse_exception",
      "reason": "could not read search request. value [SCAN] is not supported for field [search_type]"
    }
  },
  "status": 400
}

```

watcher condition

```auto
{
    "trigger" : { "schedule" : { "interval" : "60s" } },
    "input" : {
      "search" : {
        "request" : {
          "search_type": "scan",
          "indices" : ["logs"],
          "types" : ["event"],
          "body" : {
            "query" : { "match_all" : {}}
          }
        }
      }
    },
  "condition" : {
    "compare" : { "ctx.payload.hits.total" : { "gt" : 0 }}
  },
  "actions" : {
    "log_error" : {
      "logging" : {
        "text" : "Watcher run"
      }
    }
  }
}

```

We are planning to use watcher for forwarding serious errors from our logs to an external monitoring system. Basically I can try to set the trigger interval short and search size large enough, but the scan approach will fit our needs best.

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [February 9, 2016, 11:05am UTC](https://discuss.elastic.co/t/watcher-does-not-support-search-type-scan-anymore/41259/2 "2016-02-09T11:05:09Z")

</div>

Hey,

I dont understand the use-case for scan search here. Can you explain maybe?

Do you use the scrolling somewhere else and pick the scroll id up?

Check the [deprecated section of 2.1](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_21_search_changes.html#_literal_search_type_scan_literal_deprecated) for a workaround. Makes sense to change your query, as the that search type is going to be removed in the future.

Hope this helps, if not, just ask further 🙂

--Alex

---

<div class="post-metadata">

### Author: ![terramexx](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@terramexx](https://discuss.elastic.co/u/terramexx)
#### Post date: [February 9, 2016, 11:26am UTC](https://discuss.elastic.co/t/watcher-does-not-support-search-type-scan-anymore/41259/3 "2016-02-09T11:26:52Z")

</div>

Hi,

our aim is to forward all fatal errors (ITOs) to external monitoring system through log file. We would like to trigger watch each Xmin and collect and forward all ITOs.

Naturally the count of all could vary. I would like to set some nice value like page=500 and would expect from watcher if there will be e.g. 501 ITO errors it will forward me the last 1 too.

Thanks for the link, didn't know it is going to be deprecated. But unfortunately if I am not wrong it seems that one will have to develop some wrapper around watcher and do the scroll himself.

But anyway with size 500 and watcher trigger each 1minute we will be hopefully probably enough safe with standard query\_then\_fetch.

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [February 9, 2016, 12:01pm UTC](https://discuss.elastic.co/t/watcher-does-not-support-search-type-scan-anymore/41259/4 "2016-02-09T12:01:56Z")

</div>

Hey,

FYI: Just specifying a type `scan` does not mean the search being executed by watcher automatically fetches all the results. You could however hand over the scroll id to another process, which then executes the real scan/scroll search, if you need to ensure you are catching all the results.

Apart from that, you can still check if total.hits is greater than 500 and inform the monitoring component to fetch data by itself, if you dont feel safe enough that way. Last but not least, increasing the size might also be valid in your case then.

--Alex

---

<div class="post-metadata">

### Author: ![terramexx](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@terramexx](https://discuss.elastic.co/u/terramexx)
#### Post date: [February 9, 2016, 12:24pm UTC](https://discuss.elastic.co/t/watcher-does-not-support-search-type-scan-anymore/41259/5 "2016-02-09T12:24:22Z")

</div>

Aaah, I believed in magic scroll in watcher :). Sad story, but I understand if it is done this way.

Unfortunately the monitoring component will not be able to call our log collector, we have to push all the data through files.

Big thanks for all the info here. Thus for now we will get frozen by some big enough size value and trigger often, if it will be not enough we will try to scroll somehow then.

---

<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: [July 6, 2017, 1:47pm UTC](https://discuss.elastic.co/t/watcher-does-not-support-search-type-scan-anymore/41259/6 "2017-07-06T13:47:03Z")

</div>


