Error in loading rules to Elastalert

I am try to get alerts using elastalert feature.

I have used the following command

 elastalert --verbose   --config /temp/elastalert/config.yaml.example

Here is the following output

INFO:elastalert:Starting up
INFO:elastalert:Disabled rules are:
INFO:elastalert:Sleeping for 0.999507 seconds
INFO:elastalert:Disabled rules are:
INFO:elastalert:Sleeping for 0.999673 seconds
INFO:elastalert:Background configuration change check run at 2019-09-17 17:33 IST
INFO:elastalert:Background alerts thread 0 pending alerts sent at 2019-09-17 17:33 IST
INFO:elastalert:Disabled rules are:
INFO:elastalert:Sleeping for 0.999808 seconds
INFO:elastalert:Background configuration change check run at 2019-09-17 17:33 IST
INFO:elastalert:Background alerts thread 0 pending alerts sent at 2019-09-17 17:33 IST
INFO:elastalert:Background configuration change check run at 2019-09-17 17:33 IST
INFO:elastalert:Disabled rules are:
INFO:elastalert:Sleeping for 0.99982 seconds
INFO:elastalert:Background alerts thread 0 pending alerts sent at 2019-09-17 17:33 IST
INFO:elastalert:Background configuration change check run at 2019-09-17 17:33 IST
INFO:elastalert:Disabled rules are:
INFO:elastalert:Sleeping for 0.99981 seconds
INFO:elastalert:Background alerts thread 0 pending alerts sent at 2019-09-17 17:33 IST
INFO:elastalert:Background configuration change check run at 2019-09-17 17:33 IST
INFO:elastalert:Disabled rules are:
INFO:elastalert:Sleeping for 0.99977 seconds

It is unable to load rules...so i have give rule in command as follows

elastalert --verbose --config /temp/elastalert/config.yaml.example --rule /temp/elastalert/example_rules/example_frequency.yaml

Here is the output.

Traceback (most recent call last):
File "/usr/local/bin/elastalert", line 11, in
load_entry_point('elastalert==0.2.1', 'console_scripts', 'elastalert')()
File "/usr/local/lib/python3.6/site-packages/elastalert-0.2.1-py3.6.egg/elastalert/elastalert.py", line 2038, in main
client = ElastAlerter(args)
File "/usr/local/lib/python3.6/site-packages/elastalert-0.2.1-py3.6.egg/elastalert/elastalert.py", line 139, in init
self.rules = self.rules_loader.load(self.conf, self.args)
File "/usr/local/lib/python3.6/site-packages/elastalert-0.2.1-py3.6.egg/elastalert/loaders.py", line 114, in load
rule = self.load_configuration(rule_file, conf, args)
File "/usr/local/lib/python3.6/site-packages/elastalert-0.2.1-py3.6.egg/elastalert/loaders.py", line 178, in load_configuration
rule = self.load_yaml(filename)
File "/usr/local/lib/python3.6/site-packages/elastalert-0.2.1-py3.6.egg/elastalert/loaders.py", line 196, in load_yaml
loaded = self.get_yaml(filename)
File "/usr/local/lib/python3.6/site-packages/elastalert-0.2.1-py3.6.egg/elastalert/loaders.py", line 515, in get_yaml
return yaml_loader(filename)
File "/usr/local/lib/python3.6/site-packages/PyStaticConfiguration-0.10.4-py3.6.egg/staticconf/loader.py", line 168, in yaml_loader
return yaml.load(fh, Loader=SafeLoader) or {}
File "/usr/local/lib/python3.6/site-packages/PyYAML-5.1.2-py3.6-linux-x86_64.egg/yaml/init.py", line 114, in load
File "/usr/local/lib/python3.6/site-packages/PyYAML-5.1.2-py3.6-linux-x86_64.egg/yaml/constructor.py", line 41, in get_single_data
File "/usr/local/lib/python3.6/site-packages/PyYAML-5.1.2-py3.6-linux-x86_64.egg/yaml/composer.py", line 39, in get_single_node
File "/usr/local/lib/python3.6/site-packages/PyYAML-5.1.2-py3.6-linux-x86_64.egg/yaml/parser.py", line 98, in check_event
File "/usr/local/lib/python3.6/site-packages/PyYAML-5.1.2-py3.6-linux-x86_64.egg/yaml/parser.py", line 174, in parse_document_start
yaml.parser.ParserError: expected '', but found ''
in "/temp/elastalert/example_rules/example_frequency.yaml", line 20, column 1

pip list

Package Version


APScheduler 3.6.1
aws-requests-auth 0.4.2
blist 1.3.6
boto3 1.9.228
botocore 1.12.228
certifi 2019.9.11
cffi 1.12.3
chardet 3.0.4
configparser 4.0.2
croniter 0.3.30
defusedxml 0.6.0
docopt 0.6.2
docutils 0.15.2
elastalert 0.2.1
elasticsearch 7.0.0
envparse 0.2.0
exotel 0.1.5
future 0.17.1
idna 2.8
jira 1.0.14
jmespath 0.9.4
jsonschema 2.6.0
mock 3.0.5
oauthlib 3.1.0
pbr 5.4.3
pip 19.2.3
pycparser 2.19
PyJWT 1.7.1
PySocks 1.7.0
PyStaticConfiguration 0.10.4
python-dateutil 2.6.1
python-magic 0.4.15
pytz 2019.2
PyYAML 5.1.2
requests 2.22.0
requests-oauthlib 1.2.0
requests-toolbelt 0.9.1
s3transfer 0.2.1
setuptools 41.2.0
six 1.12.0
stomp.py 4.1.22
texttable 1.6.2
thehive4py 1.6.0
twilio 6.0.0
tzlocal 2.0.0
urllib3 1.25.3
virtualenv 16.7.5
wheel 0.33.6

Kindly, please help me in resolving this issue.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.