# Regex in Kibana Search bar?

**URL:** <https://discuss.elastic.co/t/regex-in-kibana-search-bar/255944>\
**Category:** Kibana\
**Created:** [November 19, 2020, 8:07am UTC](https://discuss.elastic.co/t/regex-in-kibana-search-bar/255944 "2020-11-19T08:07:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cskowronnek](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@cskowronnek](https://discuss.elastic.co/u/cskowronnek)\
**Post date:** [November 19, 2020, 8:07am UTC](https://discuss.elastic.co/t/regex-in-kibana-search-bar/255944/1 "2020-11-19T08:07:23Z")

</div>

Hi all,

I have a text field which I want to query for values containing only digits.  
This search works just fine:

```auto
      "query": {
        "regexp":{
           "Overall State": "[0-9]*"
      }
    }

```

When I try to perform this in Kibana I always get no results.  
I tried all variations of:

Overall State:/[0-9]\*/

But all my requets look like this when I inspect them:

```auto
      "query": {
    "bool": {
      "must": [
        {
          "query_string": {
            "query": "Overall State:/[0-9]*/",
            "analyze_wildcard": true,
            "time_zone": "Europe/Berlin"
          }
        }
      ]

```

Has anyone an idea?

Best regards  
Conrad

---

<div class="post-metadata">

**Author:** ![Marta\_Bondyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marta_bondyra/32/102122_2.png) [@Marta\_Bondyra](https://discuss.elastic.co/u/Marta_Bondyra)\
**Post date:** [November 19, 2020, 9:18am UTC](https://discuss.elastic.co/t/regex-in-kibana-search-bar/255944/2 "2020-11-19T09:18:11Z")

</div>

Hi,

I think your filter is fine, but you need to use 'filter' and not 'must'. I did something similar to try and it worked fine, here's my filter:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/5/656957cec116c6575f0dd7825a132fade6589c22.png)

and here's how the request looks like:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/b/9bb473d2405f030f94ff70062b4983a52cac7f85.png)

Let me know if it's helfpul!

---

<div class="post-metadata">

**Author:** ![cskowronnek](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@cskowronnek](https://discuss.elastic.co/u/cskowronnek)\
**Post date:** [November 19, 2020, 9:51am UTC](https://discuss.elastic.co/t/regex-in-kibana-search-bar/255944/3 "2020-11-19T09:51:37Z")

</div>

I could not get your example working.  
But the filter hint was very useful:

I got it working with a custom filter:

```auto
{
  "query": {
    "regexp": {
      "Overall State": "[0-9]*"
    }
  }
}

```

---

<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 17, 2020, 9:51am UTC](https://discuss.elastic.co/t/regex-in-kibana-search-bar/255944/4 "2020-12-17T09:51:40Z")

</div>

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