Aggregate twice
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
Have you tried the below?
query_key: [hostname, urlhost]
@sathishdsgithub yes, when I use like this, both of the query_keys doesn't work
@einzbernj
could you please share the rule? let me see if I can help.
@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
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
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.
when I tried query_key: [hostname, urlhost] in type: frequency, rule works well
but it can't work when type: percentage_match