Searching for url paths containing "/" in Kibana/EllasticSearch

Viewed 16

I'm trying to write a regex in Kibana (v 7.9.1) and I want to get all paths that are like /rest/requirements/<ID_HERE>/ and nothing else at the end. I would expect that the following would work:

"/rest/requirements/[0-9]*/"

After several tests, I noticed that the following query don't work either: "/rest/requirements/"

While if I do .*requirements.*, for example, it works.

So there is something with "/" that I cannot understand. I tried the following as well without success:

.rest.requirements.*
//rest//requirements.*
\/rest\/requirements.*
\\rest\\requirements.*

Btw, I am using the filter as Query DSL as shown below.

enter image description here

1 Answers

Problem solved:

For some reason, that specific regex I mention on the question was not working with that JSON I was passing. But was working for other types. No idea why yet. The following, however, worked just fine:

{
  "regexp": {
    "path.keyword": ".*/requirements/[0-9]*/"
  }
}

enter image description here

Related