# Exclude pattern

**URL:** https://discuss.elastic.co/t/exclude-pattern/46345
**Category:** Kibana
**Created:** [April 5, 2016, 8:07am UTC](https://discuss.elastic.co/t/exclude-pattern/46345 "2016-04-05T08:07:25Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![talk2cshah](https://avatars.discourse-cdn.com/v4/letter/t/8e7dd6/32.png) [@talk2cshah](https://discuss.elastic.co/u/talk2cshah)
#### Post date: [April 5, 2016, 8:07am UTC](https://discuss.elastic.co/t/exclude-pattern/46345/1 "2016-04-05T08:07:25Z")

</div>

Dear Team,

In Kibana datatable I have following output...

query: Descending Sum of count

POST /TMSMC\_2/Pages/TimeManagement.aspx 191  
POST /TMSMC\_6/Pages/TimeManagement.aspx 158  
POST /TMSMC\_1/Pages/TimeManagement.aspx 100  
POST /TMSMC\_4/Pages/TimeManagement.aspx 93  
GET /css/style.css 65  
POST /TMSMC\_3/Pages/TimeManagement.aspx 65  
GET /TMSMC\_2/eo\_web.ashx 64  
GET /css/jquery-ui.css 64  
GET /TMSMC\_5/eo\_web.ashx 60  
GET /TMSMC\_5/WebResource.axd

I need to exclude results which have "css" in path... e.g. GET /css/style.css 65

I am not able to get the exact regex pattern

Kindly guide...

Regards, CS

---

<div class="post-metadata">

### Author: ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)
#### Post date: [April 5, 2016, 6:19pm UTC](https://discuss.elastic.co/t/exclude-pattern/46345/2 "2016-04-05T18:19:26Z")

</div>

Hi CS,

It should be something like `-path:*css*`

Regards,  
Lee

---

<div class="post-metadata">

### Author: ![anhlqn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anhlqn/32/5454_2.png) [@anhlqn](https://discuss.elastic.co/u/anhlqn)
#### Post date: [April 5, 2016, 7:04pm UTC](https://discuss.elastic.co/t/exclude-pattern/46345/3 "2016-04-05T19:04:05Z")

</div>

I had same issue. It looks like that we can't use wildcard in Include/Exclude Pattern. I've been trying on not\_analyzed and analyzed fields but not been able to find the syntax for them. An exact match works for Include/Exclude pattern.

---

<div class="post-metadata">

### Author: ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)
#### Post date: [April 5, 2016, 7:24pm UTC](https://discuss.elastic.co/t/exclude-pattern/46345/4 "2016-04-05T19:24:33Z")

</div>

It seems to be working OK for me. I'm excluding using `-host.raw: *masses*` which is part of one of these host.raw values.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/1/11c22f1a1e3a97007b42f7b4dfc9d6e58e2509db.gif)

---

<div class="post-metadata">

### Author: ![anhlqn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anhlqn/32/5454_2.png) [@anhlqn](https://discuss.elastic.co/u/anhlqn)
#### Post date: [April 5, 2016, 9:17pm UTC](https://discuss.elastic.co/t/exclude-pattern/46345/5 "2016-04-05T21:17:37Z")

</div>

My bad, I was talking about the Include/Exclude pattern under Buckets \> X-Axix \> Advanced. The regex in search bar works fine for me.

The reason for using Include/Exclude pattern is that I want to filter on only a few visualizations on a dashboard while filtering in search bar affects the whole dashboard.

---

<div class="post-metadata">

### Author: ![talk2cshah](https://avatars.discourse-cdn.com/v4/letter/t/8e7dd6/32.png) [@talk2cshah](https://discuss.elastic.co/u/talk2cshah)
#### Post date: [April 6, 2016, 4:47am UTC](https://discuss.elastic.co/t/exclude-pattern/46345/6 "2016-04-06T04:47:33Z")

</div>

thanks guys for response.

---

<div class="post-metadata">

### Author: ![djhart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/djhart/32/8990_2.png) [@djhart](https://discuss.elastic.co/u/djhart)
#### Post date: [April 7, 2016, 8:47pm UTC](https://discuss.elastic.co/t/exclude-pattern/46345/7 "2016-04-07T20:47:54Z")

</div>

I'm unable to get these to work in visualizations either as mentioned above. When trying to use Advanced-\>Exclude Pattern nothing seems to happen. For example, if my location field is either 'nyc' or 'sf' and I enter  
-location:nyc

I still see nyc results. Are there only certain types of fields that work with exclude/include?

---

<div class="post-metadata">

### Author: ![anhlqn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anhlqn/32/5454_2.png) [@anhlqn](https://discuss.elastic.co/u/anhlqn)
#### Post date: [April 8, 2016, 2:41am UTC](https://discuss.elastic.co/t/exclude-pattern/46345/8 "2016-04-08T02:41:16Z")

</div>

It should work for string fields I guess. If you use Advanced \> Exclude Pattern, put the exact term you need to exclude. In you case it should be `nyc`. Or in the search box above the visualization, put `-location:nyc` or `location:"nyc"`. Both work fine for me.

---

<div class="post-metadata">

### Author: ![djhart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/djhart/32/8990_2.png) [@djhart](https://discuss.elastic.co/u/djhart)
#### Post date: [April 8, 2016, 1:16pm UTC](https://discuss.elastic.co/t/exclude-pattern/46345/9 "2016-04-08T13:16:39Z")

</div>

Ok, thanks for the clarification. I was trying to use wildcards in the Exclude text box and it wasn't working, however; putting the exact string as you said does work. Thanks again.

---

<div class="post-metadata">

### Author: ![anhlqn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anhlqn/32/5454_2.png) [@anhlqn](https://discuss.elastic.co/u/anhlqn)
#### Post date: [April 8, 2016, 5:26pm UTC](https://discuss.elastic.co/t/exclude-pattern/46345/10 "2016-04-08T17:26:53Z")

</div>

Glad I can help. Problem with Include/Exclude is that it supports only a single term. I've tried to find a syntax to put more than one term, but couldn't find any documentation or guide.

---

<div class="post-metadata">

### Author: ![anhlqn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anhlqn/32/5454_2.png) [@anhlqn](https://discuss.elastic.co/u/anhlqn)
#### Post date: [April 11, 2016, 10:09pm UTC](https://discuss.elastic.co/t/exclude-pattern/46345/11 "2016-04-11T22:09:12Z")

</div>

Came across an article that shows Include/Exclude pattern syntax: [http://stackoverflow.com/questions/29174649/how-do-i-exclude-multiple-terms-in-kibana-4](http://stackoverflow.com/questions/29174649/how-do-i-exclude-multiple-terms-in-kibana-4). It works finally

```auto
term1|term2|term3

```

The syntax applies to both Include/Exclude.

---

<div class="post-metadata">

### Author: ![Parth\_Patel](https://avatars.discourse-cdn.com/v4/letter/p/e9a140/32.png) [@Parth\_Patel](https://discuss.elastic.co/u/Parth_Patel)
#### Post date: [February 3, 2017, 2:24pm UTC](https://discuss.elastic.co/t/exclude-pattern/46345/12 "2017-02-03T14:24:38Z")

</div>

Kibana Include/Exclude pattern under Buckets \> X-Axix \> Advanced uses RegExp class of lucene whose grammar can be found [Here](http://lucene.apache.org/core/5_3_2/core/org/apache/lucene/util/automaton/RegExp.html) .

you may use this **".\*.css"** (without quotes) in order to exclude urls that ends with .css extension. if you want to use your own some other patterns you can use above link and build it.

---

<div class="post-metadata">

### Author: ![erion](https://avatars.discourse-cdn.com/v4/letter/e/779978/32.png) [@erion](https://discuss.elastic.co/u/erion)
#### Post date: [May 18, 2017, 12:35pm UTC](https://discuss.elastic.co/t/exclude-pattern/46345/13 "2017-05-18T12:35:59Z")

</div>

i have value referrer.keyword = '-'  
how can i exclude this?

---

<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 6, 2017, 1:31pm UTC](https://discuss.elastic.co/t/exclude-pattern/46345/14 "2017-07-06T13:31:44Z")

</div>


