Thought this would be easy. I'm searching a data index of data-awsch*:ls-aws-cloudtrail* based on event.type that is not one of start, access, info. This is working as intended, but the output is huge.
Rather than filter by user.name exclude, exclude, exclude --- I'd prefer to filter (or create a smaller output) based on the length of the user.name returned. Specifically, I want to return only those events where the user.name <=6 characters; and conversely when the user.name > 6 characters.
I'm not finding a way to parse the user.name field based on the length of the content.
Question: How does one search or filter for user.name with <= 6 characters?
I use the python dsl, so you'll have to translate, here is an example that uses regex, I changeda working regex expression to this example (and sanatized), but it's not tested.
s = Search(using=es, index = 'filebeat-*') \
.query("match", event_id="RECEIVE") \
.query("regexp", **{"recipient_address" : {"value": "^.{0,6}$"}})
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.