# WHERE estament in a kibana visualization

**URL:** https://discuss.elastic.co/t/where-estament-in-a-kibana-visualization/107914
**Category:** Kibana
**Created:** [November 16, 2017, 11:19am UTC](https://discuss.elastic.co/t/where-estament-in-a-kibana-visualization/107914 "2017-11-16T11:19:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Josep\_Bacardit](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@Josep\_Bacardit](https://discuss.elastic.co/u/Josep_Bacardit)
#### Post date: [November 16, 2017, 11:19am UTC](https://discuss.elastic.co/t/where-estament-in-a-kibana-visualization/107914/1 "2017-11-16T11:19:53Z")

</div>

I would like to know if we can filter by other fields than the value in a Kibana line chart visualization.

For example, I have the following documents in an index

> {tag: 'tag1', value: '1', 'timestamp': '2017-11-13 8:00:00'}  
> {tag: 'tag1', value: '3', 'timestamp': '2017-11-13 8:01:00'}  
> {tag: 'tag2', value: '6', 'timestamp': '2017-11-13 8:02:00'}  
> {tag: 'tag2', value: '10', 'timestamp': '2017-11-13 8:03:00'}

For the moment, I can select the values parameter. But all the tags are mixed in the same aggregation. I want to know how to select the value parameter filtering by the parameter tag. let's say, one field must be:

> SELECT value WHERE tag = 'tag1'

And the other one:

> SELECT value WHERE tag = 'tag2'

---

<div class="post-metadata">

### Author: ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)
#### Post date: [November 16, 2017, 3:26pm UTC](https://discuss.elastic.co/t/where-estament-in-a-kibana-visualization/107914/2 "2017-11-16T15:26:43Z")

</div>

Josep\_Bacardit

Elasticsearch is not SQL based so there are no `WHERE` clauses but it does have powerful search capabilities.

There are several ways to accomplish the task of field filtering in kibana.

If your visualization is displayed in a dashboard, then you can use either the query bar or the filter bar. Enter lucene queires in the query bar like `tag: tag1`. Or, click the `Add a filter` button in the filter bar to add a field filter via a user interface.

The same options exist in the visualization App. The only difference is that you can save the filter with the visualization.

Another option is to [create the filter in the Discover app](https://www.elastic.co/guide/en/kibana/current/field-filter.html). Then you could save that filter as a `saved search`. Then when you create your visualization, you could base the visualization on the saved search instead of just an index pattern.

---

<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: [December 14, 2017, 3:26pm UTC](https://discuss.elastic.co/t/where-estament-in-a-kibana-visualization/107914/3 "2017-12-14T15:26:46Z")

</div>

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