elastalert icon indicating copy to clipboard operation
elastalert copied to clipboard

example_frequency.yaml unable to test

Open prabhuverse opened this issue 7 years ago • 8 comments

Traceback (most recent call last): File "/usr/local/bin/elastalert-test-rule", line 6, in from elastalert.test_rule import main File "/usr/local/lib/python2.7/site-packages/elastalert/test_rule.py", line 61 print('Invalid filter provided:', str(ea), file=sys.stderr) ^ SyntaxError: invalid syntax

Below is Example Frequency File . es_host: 127.0.0.1 es_port: 9200 name: Example frequency rule type: frequency index: kibana_sample_data_flights-* num_events: 5 timeframe: hours: 1 filter:

Python Version is 2.7

While downloading pip install elastalert facing error .

removing '/usr/local/lib/python2.7/site-packages/elastalert-0.2.1-py2.7.egg' (and everything under it) creating /usr/local/lib/python2.7/site-packages/elastalert-0.2.1-py2.7.egg Extracting elastalert-0.2.1-py2.7.egg to /usr/local/lib/python2.7/site-packages File "/usr/local/lib/python2.7/site-packages/elastalert-0.2.1-py2.7.egg/elastalert/test_rule.py", line 61 print('Invalid filter provided:', str(ea), file=sys.stderr) ^ SyntaxError: invalid syntax

Thanks in advance. But i tried to resolve , not getting any idea why this happening.

prabhuverse avatar Aug 11 '19 19:08 prabhuverse

I also have this problem and still not fix yet. need help.

arymarta avatar Aug 12 '19 05:08 arymarta

Use Python 3 Please. Version 0.2.1 has not supported Python 2.

DanielHuZM avatar Aug 12 '19 08:08 DanielHuZM

Use Python 3 Please. Version 0.2.1 has not supported Python 2.

Thanks, i have tried python 3 and its worked now.

arymarta avatar Aug 12 '19 08:08 arymarta

Thanks it worked for me too :)

prabhuverse avatar Aug 12 '19 12:08 prabhuverse

@arymarta can you please tell me python3 which version you are using!

prabhuverse avatar Aug 12 '19 14:08 prabhuverse

hello, I'm getting this error. and see I have python 2.7 and python 3.6. I'm pretty noob with this so what does it mean to use python 3? How do i use that?

allen-olivas avatar Aug 29 '19 16:08 allen-olivas

Try running pip3 install elastalert Alternatively, clone elastalert and run python3 setup.py install

Once you've done that, you should be able to run elastalert either by typing elastalert --verbose --config /path/to/config.yaml or python3 -m elastalert.elastalert --verbose --config /path/to/config.yaml

finally, you can still use python2 with elastalert==0.1.39, which supports up to elasticsearch 6, but not 7.

Qmando avatar Aug 29 '19 21:08 Qmando

@arymarta can you please tell me python3 which version you are using!

i use python 3.6

arymarta avatar Sep 04 '19 04:09 arymarta