# NOT filter using a wildcard

**URL:** <https://discuss.elastic.co/t/not-filter-using-a-wildcard/144184>\
**Category:** Kibana\
**Created:** [August 13, 2018, 1:48pm UTC](https://discuss.elastic.co/t/not-filter-using-a-wildcard/144184 "2018-08-13T13:48:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brandonstephens922](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@brandonstephens922](https://discuss.elastic.co/u/brandonstephens922)\
**Post date:** [August 13, 2018, 1:48pm UTC](https://discuss.elastic.co/t/not-filter-using-a-wildcard/144184/1 "2018-08-13T13:48:14Z")

</div>

Hello,

I am unable to get what should be a simple filter in place to work. I have been researching the wildcard element in elasticsearch and grasp the concept when running a query. What I am unable to get working is a basic filter to exclude certain dns queries in our logs. See the basic logic below:

NOT query \*.google.com

Keep in mind, query in this sense is a field name as part of a dns request.

Can someone please help?

---

<div class="post-metadata">

**Author:** ![cjcenizal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjcenizal/32/11216_2.png) [@cjcenizal](https://discuss.elastic.co/u/cjcenizal)\
**Post date:** [August 13, 2018, 10:58pm UTC](https://discuss.elastic.co/t/not-filter-using-a-wildcard/144184/2 "2018-08-13T22:58:59Z")

</div>

Hi there, please take a look at [this thread](https://discuss.elastic.co/t/kibanas-filter-partial-matching/98494/8) in which another user asked a similar question. The solution is to use the "Edit Query DSL" option to handcraft a [wildcard query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html).

Hope this helps,  
CJ

---

<div class="post-metadata">

**Author:** ![brandonstephens922](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@brandonstephens922](https://discuss.elastic.co/u/brandonstephens922)\
**Post date:** [August 14, 2018, 11:58am UTC](https://discuss.elastic.co/t/not-filter-using-a-wildcard/144184/3 "2018-08-14T11:58:09Z")

</div>

Thank you for the reply, however this is not working. Please see query and screenshot:

{  
"query": {  
"match": {  
"query.keyword": {  
"query": "\*[98a911aa.cnr.io](http://98a911aa.cnr.io)",  
"type": "phrase",  
"analyze\_wildcard": true  
}  
}  
}  
}

Error I am receiving: Visualize: [parsing\_exception] [match\_phrase] query does not support [analyze\_wildcard], with { line=1 & col=709 }

I followed that document to a T, created a query then went to edit DSL. Any suggestions?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/c/0cec3f9e2a2d65f11e79c58a43bcda1afb4ad27c.png)

---

<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:** [September 11, 2018, 11:58am UTC](https://discuss.elastic.co/t/not-filter-using-a-wildcard/144184/4 "2018-09-11T11:58:19Z")

</div>

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