Regex in Kibana Search bar?

Hi all,

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

      "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:

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

Has anyone an idea?

Best regards
Conrad

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:

and here's how the request looks like:

Let me know if it's helfpul!

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

I got it working with a custom filter:

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

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