# Automatic Searches

**URL:** <https://discuss.elastic.co/t/automatic-searches/135037>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [June 7, 2018, 5:57pm UTC](https://discuss.elastic.co/t/automatic-searches/135037 "2018-06-07T17:57:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kthare10](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@kthare10](https://discuss.elastic.co/u/kthare10)\
**Post date:** [June 7, 2018, 5:57pm UTC](https://discuss.elastic.co/t/automatic-searches/135037/1 "2018-06-07T17:57:01Z")

</div>

I have Elastic search configured to work on a logstash index. The data in this index has following mapping. I want to define a watcher which generates automatic searches on the index which can then be used to generate visualizations.

Based on the watcher documentation, I created a watch indicated below, however, I have to explicitly specify the JobId in the watch. Is there a way, that multiple searches can be auto generated for different values of JobId

Mapping:

```auto
      "properties": {
        "Measurement": {
          "properties": {
            "JobId": {"type": "keyword"},
            "ChemicalId": {"type": "keyword"},
            "Concentration": {"type": "float"},
            "Temperature": {"type": "float"},
            "Humidity": {"type": "float"},
            "Precipitation": {"type": "integer"},
            "Barometric Pressure": {"type": "integer"},
            "Wind Speed": {"type": "integer"},
            "Wind Direction": {"type": "integer"},
            "_DeviceId": {"type": "keyword"},
            "_Timestamp": {"type": "date",
                      "format": "yyyy-MM-dd HH:mm:ss.SSS"},
            "_Location": {
              "type" : "geo_point"
            }
          }

```

Watcher

```auto
PUT _xpack/watcher/watch/log_job_watch
{
  "trigger" : {
    "schedule" : { "interval" : "10s" } 
  },
  "input" : {
    "search" : {
      "request" : {
        "indices" : ["logstash*"],
        "body" : {
          "query" : {
            "match" : { "Measurement.JobId": "JobY005" }
          }
        }
      }
    }
  }
}

```

---

<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:** [July 3, 2018, 8:29am UTC](https://discuss.elastic.co/t/automatic-searches/135037/2 "2018-07-03T08:29:35Z")

</div>

Hey,

can you reiterate what your concrete question is?

First and foremost: Watcher can be used to alert on certain conditions, but it cannot be used to create visualizations in kibana. You could use a watch however to send an email, which then contains a link to the dashboard with your visualizations.

--Alex

---

<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 31, 2018, 8:29am UTC](https://discuss.elastic.co/t/automatic-searches/135037/3 "2018-07-31T08:29:39Z")

</div>

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