# How to make a filter in line chart, to show count of logs which does not contain specific attribute values

**URL:** <https://discuss.elastic.co/t/how-to-make-a-filter-in-line-chart-to-show-count-of-logs-which-does-not-contain-specific-attribute-values/82678>\
**Category:** Kibana\
**Created:** [April 18, 2017, 9:36am UTC](https://discuss.elastic.co/t/how-to-make-a-filter-in-line-chart-to-show-count-of-logs-which-does-not-contain-specific-attribute-values/82678 "2017-04-18T09:36:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticheart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticheart/32/65189_2.png) [@elasticheart](https://discuss.elastic.co/u/elasticheart)\
**Post date:** [April 18, 2017, 9:36am UTC](https://discuss.elastic.co/t/how-to-make-a-filter-in-line-chart-to-show-count-of-logs-which-does-not-contain-specific-attribute-values/82678/1 "2017-04-18T09:36:51Z")

</div>

Hi,

I am using ELK GA 5.0.0. I have created a line chart with `Count` in Y-Axis and X-Axis\>Aggregation\>Date Histogram. Then I did Split Lines\>Sub Aggregation\>Filters and gave filter `!error:ERR0|ERR1`. My requirement is to display logs whose `error` field doesnot contain both `ERR0` and `ERR1`. It may conatin other values like `ERR1`, `ERR2` etc. My question is, which one is the right filter? `!error:ERR0&ERR1` or `!error:ERR0|ERR1`? Or is there some other way?

Thanks in advance..

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [April 18, 2017, 4:20pm UTC](https://discuss.elastic.co/t/how-to-make-a-filter-in-line-chart-to-show-count-of-logs-which-does-not-contain-specific-attribute-values/82678/2 "2017-04-18T16:20:30Z")

</div>

There are a number of different ways to accomplish this with the [query syntax](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax). I'm particularly fond of using the boolean operators instead or AND/OR. I would write your query like this:

```auto
error:(-ERR0 -ERR1)

```

This essentially says, get all docs where the `error` field is not `ERR0` and it is also not `ERR1`.

---

<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 16, 2017, 4:29pm UTC](https://discuss.elastic.co/t/how-to-make-a-filter-in-line-chart-to-show-count-of-logs-which-does-not-contain-specific-attribute-values/82678/3 "2017-05-16T16:29:31Z")

</div>

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