# Error in loading rules to Elastalert

**URL:** <https://discuss.elastic.co/t/error-in-loading-rules-to-elastalert/199817>\
**Category:** Elasticsearch\
**Created:** [September 17, 2019, 12:11pm UTC](https://discuss.elastic.co/t/error-in-loading-rules-to-elastalert/199817 "2019-09-17T12:11:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maheswari](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@Maheswari](https://discuss.elastic.co/u/Maheswari)\
**Post date:** [September 17, 2019, 12:11pm UTC](https://discuss.elastic.co/t/error-in-loading-rules-to-elastalert/199817/1 "2019-09-17T12:11:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 15, 2019, 12:17pm UTC](https://discuss.elastic.co/t/error-in-loading-rules-to-elastalert/199817/2 "2019-10-15T12:17:42Z")

</div>

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