# Extraction query for monitor

**URL:** <https://discuss.elastic.co/t/extraction-query-for-monitor/228918>\
**Category:** Kibana\
**Created:** [April 20, 2020, 6:33pm UTC](https://discuss.elastic.co/t/extraction-query-for-monitor/228918 "2020-04-20T18:33:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rashmita\_Shetty](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Rashmita\_Shetty](https://discuss.elastic.co/u/Rashmita_Shetty)\
**Post date:** [April 20, 2020, 6:33pm UTC](https://discuss.elastic.co/t/extraction-query-for-monitor/228918/1 "2020-04-20T18:33:38Z")

</div>

Hello, I have recently built a few alerts in Kibana (7.1.1). The alerts that I have using the extraction method is to query a specific value in the field : CustomerEndpoint address.  
I am trying to understand, if I had to add 2 values in the Endpoint address, how will I do so?  
Should I be using array/ OR operator?  
\<  
{  
"match\_phrase": {  
"CustomerEndpoint.Address": {  
"query": "xxxxx12345",  
"slop": 0,  
"zero\_terms\_query": "NONE",  
"boost": 1  
}  
}  
}  
]

> 

1. Under the action items in trigger \> there is a box for message preview , how can I add the some fields from \_source in that message?

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [April 22, 2020, 11:04am UTC](https://discuss.elastic.co/t/extraction-query-for-monitor/228918/2 "2020-04-22T11:04:05Z")

</div>

Hi @Rashmita_Shetty,

regarding your first question, you could either use a [`query_string` query](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/query-dsl-query-string-query.html) and spell out the `OR` or formulate two `match_phrase` queries and wrap them in a [`bool` query](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/query-dsl-bool-query.html)'s `should` clause.

As for the message trigger, it should support [templating](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/how-watcher-works.html#templates) to allow for the inclusion of values from the triggering documents.

---

<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:** [May 20, 2020, 11:04am UTC](https://discuss.elastic.co/t/extraction-query-for-monitor/228918/3 "2020-05-20T11:04:08Z")

</div>

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