elasticsearch – Elastic Query to alert only when a certain logs comes more than a custom threshold

I have an echo alarm set like this

{"query": {
    "bool" : {
      "must" : [
          {"regexp":{"messageDetail.uri": "/v[1,2]/ccpa/.*"}},
     "must_not": [
          {"regexp": {"message": ".*requestqueuedoesnotexist.*"}}

This creates an alert whenever there is a 500 response code in the last 60minutes . I wan to change it to alert only when 500 response code comes more than 100 times in the last 60 minutes instead of just one. How can this be achieved.?

Read more here: Source link