Kibana querying for string length

Viewed 29147

Is there a way to query for a value of a certain length in Kibana?

For example, given the following two KV pairs:

key: "some"
key: "something"

I would like to search for key.length > 5 and retrieve "something" only.

The other option I see is to add a tag from logstash, but then I'll have to reload a couple hundred GB.

4 Answers

You can accomplish this with a regular expression query via the Lucene query syntax. For example key:/.{6,}/ would only match records whose key field had an entry of 6 characters or more.

HT to a similar question about Solr (which also uses Lucene's query engine).

Related