elastalert icon indicating copy to clipboard operation
elastalert copied to clipboard

Multiple Rules Won't Run

Open yoda-sec opened this issue 9 years ago • 4 comments

Has anyone else experienced an issue where multiple Rules that are located in the defined rules folder don't simultaneously run? When I start elastalert, it seems to only choose 1 of the rules in the folder to load and run. If I start elastalert and manually reference specific rule files --rule /opt/elastalert/rules/test.yaml, each rule works great. I can start multiple instances of elastalert, each specifically referencing an individual rule file without any issues. However, it is not ideal longterm to reference individual rule files and to have 30+ running process of elastalert. Any thoughts? I've tried both v0.1.18 and v0.1.20

yoda-sec avatar Oct 03 '17 18:10 yoda-sec

@yoda-sec

please recheck the below two things

Run elastalert by specifying the config.yaml 

python -m elastalert.elastalert --verbose --config /opt/elastalert/config.yaml

AND ensure the rule folder name is correct.

# Any .yaml file will be loaded as a rule
rules_folder: Rule_folder

sathishdsgithub avatar Oct 04 '17 05:10 sathishdsgithub

@sathishdsgithub I manually specify the the config file when I start elastalert. The config file lives in /opt/elastalert. I have set the rules_folder value to both "rules" and "/opt/elastalert/rules". Both will allow elastalert to successfully start and start running 1 of the .yaml files from the folder, just not all of them.

yoda-sec avatar Oct 04 '17 13:10 yoda-sec

Can you do an ls of /opt/elastalert/rules and show output from running elastalert with --verbose?

Qmando avatar Oct 04 '17 17:10 Qmando

Same problem here.

If I run Elastalert with 2 rule files, it will just take the error monitoring one.

I found this problem because I only receive one type of post but there are two types of the log.

Found the problem is because of the Elasticsearch contains too many logs that meet the error condition. Therefore the Elastalert busy alerting the old logs.

After clear Elasticseach storage, it can process two rule files

Is there any way to let ElastAlert do not process the log which is too old? Please check my rule file.

Rule 1

es_host: xxx.xxx.xxx.xxx
es_port: 9200
name: Error Monitoring
type: any
index: logstash-*
realert:
  minutes: 0
filter:
  - query:
      query_string:
        query: "level:error OR level:warn OR (NOT level:* AND message: *error*)"
alert: post
http_post_url: "xxx.xxx.xxx.xxx"

rexuli avatar Oct 10 '17 02:10 rexuli