# Querying a range in Kibana

**URL:** <https://discuss.elastic.co/t/querying-a-range-in-kibana/163952>\
**Category:** Kibana\
**Created:** [January 11, 2019, 7:42pm UTC](https://discuss.elastic.co/t/querying-a-range-in-kibana/163952 "2019-01-11T19:42:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdesanno](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rdesanno/32/13607_2.png) [@rdesanno](https://discuss.elastic.co/u/rdesanno)\
**Post date:** [January 11, 2019, 7:42pm UTC](https://discuss.elastic.co/t/querying-a-range-in-kibana/163952/1 "2019-01-11T19:42:29Z")

</div>

Not sure if this can be done outside of the api but curious to know for sure. I was searching Kibana earlier today for messages that had a string and a number that followed larger than 5000. A few examples:

foo foo foo by 4195 bar bar bar  
foo foo foo by 4689 bar bar bar  
**foo foo foo by 5301 bar bar bar**  
foo foo foo by 3902 bar bar bar  
**foo foo foo by 5763 bar bar bar**

Is there a way to filter my message field to all lines that contain "by " and a number greater than 5000 so I would only get 2 lines back in the above example without having to break this field into its own bucket?

TIA

---

<div class="post-metadata">

**Author:** ![stiltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stiltz/32/39714_2.png) [@stiltz](https://discuss.elastic.co/u/stiltz)\
**Post date:** [January 11, 2019, 9:53pm UTC](https://discuss.elastic.co/t/querying-a-range-in-kibana/163952/2 "2019-01-11T21:53:51Z")

</div>

You could use a regular expression to look for any string starting with 5 through 9 followed by 3 or more number characters.  
Your query might look something like this:  
**field.name:/by ([5-9]\d{3,})/**

Hope that helps

---

<div class="post-metadata">

**Author:** ![rdesanno](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rdesanno/32/13607_2.png) [@rdesanno](https://discuss.elastic.co/u/rdesanno)\
**Post date:** [January 12, 2019, 4:24pm UTC](https://discuss.elastic.co/t/querying-a-range-in-kibana/163952/3 "2019-01-12T16:24:24Z")

</div>

Dang, I was close. Thanks for the suggestion!

---

<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:** [February 9, 2019, 4:24pm UTC](https://discuss.elastic.co/t/querying-a-range-in-kibana/163952/4 "2019-02-09T16:24:31Z")

</div>

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