percentage_match rule Kibana link generating wrong query #1450
-
Not sure yet if I'm doing sth wrong, so decided to create a discussion rather than an issue. I'm running elastalert2 version 2.18.0 My alert rule looks like this
My alert text looks like this And when I click the kibana link, the query looks like this
instead of
As a result, the query on Opensearch fails. It used to work correctly in v2.9.0 . This started occurring after upgrading to v2.18.0 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 13 replies
-
I'm surprised the OpenSearch link worked at all in 2.9.0, given that it wasn't put into the product until 2.15.0. Is there any other info you can provide, such as the rule yaml before the upgrade, or the data view for |
Beta Was this translation helpful? Give feedback.
Thanks for locating the specific release that broke.
@jmacdone, In PR #1330 the change to utils.py where it now trims the
.keyword
suffix from the lookup field is causing fields that have a keyword subfield to have the returned value to be a map containing a keyword key, as shown above, instead of returning the actual value.Specifically, this change in #1330: https://github.com/jertel/elastalert2/pull/1330/files#diff-c94be3c6634086358da8944c7febe9c9e98fc1b4425fcc4e116e0740f5cf4eb6R88
The modified PR unit tests for that change don't directly test for this condition, where the field in the match has a nested dict with a keyword key. If a new unit test is added such as below, the test fails:
…