# Filtering in nested data

**URL:** <https://discuss.elastic.co/t/filtering-in-nested-data/218764>\
**Category:** Elasticsearch\
**Created:** [February 11, 2020, 12:08pm UTC](https://discuss.elastic.co/t/filtering-in-nested-data/218764 "2020-02-11T12:08:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmathwe](https://avatars.discourse-cdn.com/v4/letter/t/3e96dc/32.png) [@tmathwe](https://discuss.elastic.co/u/tmathwe)\
**Post date:** [February 11, 2020, 12:08pm UTC](https://discuss.elastic.co/t/filtering-in-nested-data/218764/1 "2020-02-11T12:08:44Z")

</div>

Hi Experts,

We have a data in following format  
measure:{ name:"",value:"",timestamp:""} now type of value can be vary based on the name example as follows

measure:{name:co2,value:1,timestamp}  
measure:{name:co2,value:2,timestamp}  
measure:{name:co2,value:.1,timestamp}  
measure:{name:o2,value:10,timestamp}  
measure:{name:o2,value:11,timestamp}  
measure:{name:o2,value:1,timestamp}  
measure:{name:k+,value:upper,timestamp}  
measure:{name:k+,value:lower,timestamp}

now i want to select co2 and 02 with co2 value between 5 and 10 and 02 with value  
between 5 and 11

please help on how to formulate the filter query for the same

Thanks,  
Tijo

---

<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:** [March 10, 2020, 12:09pm UTC](https://discuss.elastic.co/t/filtering-in-nested-data/218764/2 "2020-03-10T12:09:02Z")

</div>

Closed on March 10, 2020, 12:09pm UTC

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