# Wildcard and filter in watcher

**URL:** <https://discuss.elastic.co/t/wildcard-and-filter-in-watcher/200481>\
**Category:** Elasticsearch\
**Created:** [September 20, 2019, 7:29pm UTC](https://discuss.elastic.co/t/wildcard-and-filter-in-watcher/200481 "2019-09-20T19:29:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![t3fsx](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@t3fsx](https://discuss.elastic.co/u/t3fsx)\
**Post date:** [September 20, 2019, 7:29pm UTC](https://discuss.elastic.co/t/wildcard-and-filter-in-watcher/200481/1 "2019-09-20T19:29:10Z")

</div>

```
"query": {
        "bool": {
          "filter": [
            {
              "term": {
                "event.type": "fruits"
              }
            },
            {
              "term": {
                "fruit": "or*"
              }
            },
            {
              "range": {
                "@timestamp": {
                  "gte": "{{ctx.trigger.triggered_time}}||-{{ctx.metadata.time_period}}"
                }
              }
            }
          ]
        }
      }

```

I would like to filter down to event.type:fruits and then have a watcher for everything starting with or\*.

I'm aware that wildcards don't work on filters, but how could I go about using "terms" and "wildcard" inside the same watcher?

Thank you!

---

<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:** [October 18, 2019, 7:29pm UTC](https://discuss.elastic.co/t/wildcard-and-filter-in-watcher/200481/2 "2019-10-18T19:29:40Z")

</div>

Closed on October 18, 2019, 7:29pm UTC

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