elastalert icon indicating copy to clipboard operation
elastalert copied to clipboard

Aggregate twice

Open einzbernj opened this issue 9 years ago • 7 comments

Hello, I use query_key to count documents separately, when I just use one query_key, it works well, but now I want to aggregate twice, first store document to different bucket by "hostname" and then count them separately by "urlhost" I have tried both query_key and aggregation_key, but not work. Any suggestions?

einzbernj avatar Jul 21 '17 03:07 einzbernj

@einzbernj

Have you tried the below?

query_key: [hostname, urlhost]

sathishdsgithub avatar Jul 21 '17 09:07 sathishdsgithub

@sathishdsgithub yes, when I use like this, both of the query_keys doesn't work

einzbernj avatar Jul 21 '17 10:07 einzbernj

@einzbernj

could you please share the rule? let me see if I can help.

sathishdsgithub avatar Jul 21 '17 10:07 sathishdsgithub

@sathishdsgithub

name: status Percentage Match
type: percentage_match



index:

 logstash-*
description: "80% of all http requests should be successful"

buffer_time:
    seconds: 30
    
query_key: [hostname, urlhost]

match_bucket_filter:
 -  range:    
    status:
        from: 200
        to: 299


min_percentage: 80

alert:
    - "debug"

einzbernj avatar Jul 21 '17 10:07 einzbernj

@einzbernj

Have you tried like the below? Also, have you referred the link which is similar to yours ?https://github.com/Yelp/elastalert/issues/1222

query_key:
     - hostname
     - urlhost

sathishdsgithub avatar Jul 21 '17 10:07 sathishdsgithub

@sathishdsgithub

query_key:
     - hostname
     - urlhost

this code not work either. when I just use hostname or urlhost, alert can be triggered, but when use both of them, it does not work.

einzbernj avatar Jul 21 '17 11:07 einzbernj

when I tried query_key: [hostname, urlhost] in type: frequency, rule works well but it can't work when type: percentage_match

einzbernj avatar Jul 24 '17 06:07 einzbernj