# Elasticsearch query DSL as a filter on Kibana

**URL:** <https://discuss.elastic.co/t/elasticsearch-query-dsl-as-a-filter-on-kibana/278415>\
**Category:** Elasticsearch\
**Created:** [July 12, 2021, 11:16am UTC](https://discuss.elastic.co/t/elasticsearch-query-dsl-as-a-filter-on-kibana/278415 "2021-07-12T11:16:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bab](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bab/32/86201_2.png) [@bab](https://discuss.elastic.co/u/bab)\
**Post date:** [July 12, 2021, 11:16am UTC](https://discuss.elastic.co/t/elasticsearch-query-dsl-as-a-filter-on-kibana/278415/1 "2021-07-12T11:16:29Z")

</div>

Hi guys,  
i need help with - my challenge is that i have to generate a new field when the query match the cretiria.  
see the code below:  
Here I need to add/create a field (references) and fill it with the same value I found above in the message (AC949111)

```auto
{
  "query": {
    "bool": {
      "should": [
        {
          "match_phrase": {
            "message": "AC949111"
          }
        },
        {
          "match_phrase": {
            "message": "AC949110"
          }
        },
......
....
..
// Here I need to add/create a field (references) and fill it with the same value I found above in the message (AC949111/AC949110/....)
        }
      ],
      "minimum_should_match": 1
    }
  }
}

```

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:** [August 9, 2021, 11:16am UTC](https://discuss.elastic.co/t/elasticsearch-query-dsl-as-a-filter-on-kibana/278415/2 "2021-08-09T11:16:46Z")

</div>

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