Using Regex in Kibana Query DSL

Good day everyone,

I am relatively new to the use of Kibana. And I have the following problem:

I want to filter out all numbers and special characters like "_" or "-" in a field in Discover mode, so that I only have Letters.
For this I wanted to define a regex via "+Add filter" -> "Edit as Query DSL" . Only the whole thing does not work as thought.

If I now the enter the Regex:

Then there are still values reflected such as "abc-abc-abc-abc". Can someone possibly help me to filter my search correctly?

Thank you! That would be great

PS. I already ask that in the kibana forum, but someone said I should also try it here :slight_smile:

Linking the other topic - Using Regex in Kibana Query DSL (filter-option in discover mode)

1 Like

Regexes not matching is typically because the searcher assumes the content is what was presented in the original JSON value rather than how this was stored in the index.
The search matches the tokens stored in the index. You can use the analyze api to see how your original value may have been tokenised into multiple tokens.
You may find this blog helpful in redesigning your index mapping and understanding the matching process

1 Like

Hi Mark, thanks for the answer. I read the article and tried it. So in the Dev Tools console it works perfectly -> see screenshot:

But as soon I want to implement it into my kibana search it doesn't work.
I am still not getting the values from type "abc-abc-abc-123"....

But thanks for the good note!

I’m not near a computer to check but I suspect Kibana’s filter editor doesn’t require the ‘query’ wrapper