# Check whether a field exists in elasticsearch

**URL:** https://discuss.elastic.co/t/check-whether-a-field-exists-in-elasticsearch/95723
**Category:** Kibana
**Created:** [August 3, 2017, 1:31pm UTC](https://discuss.elastic.co/t/check-whether-a-field-exists-in-elasticsearch/95723 "2017-08-03T13:31:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sLuvpreet33](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sluvpreet33/32/50626_2.png) [@sLuvpreet33](https://discuss.elastic.co/u/sLuvpreet33)
#### Post date: [August 3, 2017, 1:31pm UTC](https://discuss.elastic.co/t/check-whether-a-field-exists-in-elasticsearch/95723/1 "2017-08-03T13:31:25Z")

</div>

I want to draw a timeseries graph in Timelion of Kibana.

For example, below checks for documents which have rating equal to 5.

```
.es(index='database', timefield='booking_time', q='rating:5')

```

I want to draw only those documents which have a specific field in it.

In discover tab, I know how to do it, `_exists_:field_name`.

but I don't know how to do it in Timelion expression.

---

<div class="post-metadata">

### Author: ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)
#### Post date: [August 3, 2017, 2:10pm UTC](https://discuss.elastic.co/t/check-whether-a-field-exists-in-elasticsearch/95723/2 "2017-08-03T14:10:14Z")

</div>

@sLuvpreet33 the `q=` parameter in Timelion can be used like the discover tab's query bar, so you can do:

```auto
.es(index='database', timefield='booking_time', q='rating:5 AND _exists_:field_name')

```

---

<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: [August 31, 2017, 2:10pm UTC](https://discuss.elastic.co/t/check-whether-a-field-exists-in-elasticsearch/95723/3 "2017-08-31T14:10:17Z")

</div>

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