# Discover option Filter - Range based on DeviceID

**URL:** <https://discuss.elastic.co/t/discover-option-filter-range-based-on-deviceid/234755>\
**Category:** Kibana\
**Created:** [May 28, 2020, 1:44pm UTC](https://discuss.elastic.co/t/discover-option-filter-range-based-on-deviceid/234755 "2020-05-28T13:44:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joedbadmin](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@joedbadmin](https://discuss.elastic.co/u/joedbadmin)\
**Post date:** [May 28, 2020, 1:44pm UTC](https://discuss.elastic.co/t/discover-option-filter-range-based-on-deviceid/234755/1 "2020-05-28T13:44:55Z")

</div>

Hi Experts,

I was trying to create a report using DISCOVER menu.  
The index got 8 million records and one of the fields is DeviceID

If I choose the 'exists' as filter and field DeviceID; I get all the 8 million records.  
I want to limit this based on ranges, such as  
DeviceID \>10K and DeviceID \<500K

How's it possible? I wanted to export that in to a csv then.

When I try to export without such a range, it seems like it's taking so much time (running for over 20 hours now). I'm unsure why (just a integer field 8 million records) taking over 20 hours plus for the csv export.

Please help.

---

<div class="post-metadata">

**Author:** ![joedbadmin](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@joedbadmin](https://discuss.elastic.co/u/joedbadmin)\
**Post date:** [May 28, 2020, 2:20pm UTC](https://discuss.elastic.co/t/discover-option-filter-range-based-on-deviceid/234755/2 "2020-05-28T14:20:25Z")

</div>

The current filter is

{  
"exists": {  
"field": "DeviceID"  
}  
}

I want to add add something like the below to this filter or a new filter in this DISCOVER option

{  
"exists":{  
"field": "DeviceID"  
"gte" : 10000,  
"lte" : 500000}  
}

Any ideas?  
Is range possible such as \> and \< on an inteer field?  
I'm a newbie to ES / Kibana.

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [May 30, 2020, 4:35am UTC](https://discuss.elastic.co/t/discover-option-filter-range-based-on-deviceid/234755/3 "2020-05-30T04:35:46Z")

</div>

1. You'll need to create a saved search with the filters. See [https://www.elastic.co/guide/en/kibana/current/save-open-search.html#save-open-search](https://www.elastic.co/guide/en/kibana/current/save-open-search.html#save-open-search)
  - Filters can be part of a saved search. See the docs on filters to translate your requirements to the Kibana features available:
    - Kibana Query language: [https://www.elastic.co/guide/en/kibana/current/kuery-query.html](https://www.elastic.co/guide/en/kibana/current/kuery-query.html)
    - Lucene query Syntax: [https://www.elastic.co/guide/en/kibana/current/lucene-query.html](https://www.elastic.co/guide/en/kibana/current/lucene-query.html) (Especially that this option also allows Elasticsearch Query DSL)

2. With [Kibana Reporting](https://www.elastic.co/guide/en/kibana/current/reporting-getting-started.html), you can export the results of a saved search from Discover as CSV. With a Basic license, the Share menu in Discover will have an Export \> CSV option.

---

<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:** [June 27, 2020, 4:35am UTC](https://discuss.elastic.co/t/discover-option-filter-range-based-on-deviceid/234755/4 "2020-06-27T04:35:48Z")

</div>

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