Kibana Log Threshold Alert Rule Trigger Problem when using multiple conditions

Hi,

I have created many alert rules in Kibana, however currently I am facing a strange issue, when I create Log Threshold Rule with single condition it is working file and Triggering the alert, but if I add multiple conditions to it, alert is not getting triggered, to validate I have checked log count in Discover section with the same condition and time range/window and it is showing the documents

KQL : service.name : "aem-shared-a-publisher-service" AND http.response.status_code : 429

service.name field type is keyword

http.response.status_code field type is long

Alert Rule :

Kibana Version : 8.5.3

Hi @manzer Welcome to the community

First always tell us the version.

Open These... and look

So I set mine up with some logs...

And it worked and

stephenb-es-integrationAPP 8:05 PM

532 log entries in the last 5 mins. Alert when > 75.stephen discuss test Log threshold rule is active.532 log entries have matched the following conditions: k8s.container.name equals cart and service.name equals cartView alert details

Hi @stephenb ,

Thank you for the response !

I had mentioned the version : 8.5.3 :slight_smile:

Please find the expanded screenshot below. conditions are meeting, however Alert are not getting trigged

Also, as mentioned in my 1st post, it is working for me for other Alert rules, but not this one, I also tried only one condition at a time just to test, individually both of them are working fine and triggering the alerts, but not working together

Can you run the same query in Discover for the same time interval and share the result?

Use the query bellow looking for the last 24 hours

service.name: "aem-shared-a-publisher-service" and http.response.status_code: 429

Hi @leandrojmp ,

SS Below

@manzer

Sorry I missed the version 8.5 is very old and lots of updates and fixes especially with respect to alerts you should think about getting to 8.19.x in prep to 9.x

When you say the alert is not triggered where are you checking/ to validating that?

Have you deleted the rule and recreated it.

If it is working for 1 alert not the other it is usually the alert condition itself

You could test with elasticsearch query rule with your KQL

@stephenb

Agree with you point on considering to upgrade the cluster, however I am not sure that I can achieve it now due to other dependencies.

I already have many alert rules configured and those are working fine, based on our new requirement I was trying to create this new alert rule, and observed this unexpected behavior

I have already tested KQL and it is Discover (pasted the output in previous post)

yes understood

Version 8.19

In Stack Management > Rules, click Create rule. Select the Elasticsearch query rule type then fill in the name and optional tags. An Elasticsearch query rule can be defined using Elasticsearch Query Domain Specific Language (DSL), Elasticsearch Query Language (ES|QL), Kibana Query Language (KQL), or Lucene.

But KQL alert is not available in 8.5 :frowning: .... You could try the DSL Rule with the same conditions

My Guess there is some bug / behavior or something,
I noticed that the status code is numeric.
But the query is perhaps treated as a keyword etc... which should be fine but maybe it is not

The comparators available for conditions depend on the chosen field. The combinations available are:

  • Numeric fields: more than, more than or equals, less than, or less than or equals.
  • Aggregatable fields: is and is not.
  • Non-aggregatable fields: matches, does not match, matches phrase, does not match phrase.

Maybe you should treat as a Numbers More than or Equal 429 or something

Really, before spending too much time, I would work on upgrading. 8.5 is 3.5 years old.... a lifetime in Elasticsearch world.

In 8.19 you will have many more choices ESQL rules are quite powerful...

@stephenb
Thanks a lot for the details and your quick responses, much appreciated :saluting_face: ,

I will give a try to your suggestions !