Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter download_dashboard AttributeError: 'dict' object has no attribute 'insert' #1481

Open
andrpetr opened this issue Jan 9, 2018 · 2 comments

Comments

@andrpetr
Copy link

andrpetr commented Jan 9, 2018

using elastalert 0.1.26 and kibana 3 I get an error trying to download filters from kibana 3:
es_filters['filter']['bool']['must'].insert(0, {'range': {timestamp_field: {'gt': starttime, AttributeError: 'dict' object has no attribute 'insert
I am using command elastalert-test-rule --config config.yaml rules/006-Dashboard.yaml
I get message Successfully loaded Dashboard but after that I get an error above
My rule file has these settings:
type: frequency
num_events: 1
timeframe: minutes: 5
filter: download_dashboard: "dashboardname"

@Qmando
Copy link
Member

Qmando commented Jan 9, 2018

Please see the documentation and example rules on how to use filter. You want to format it like

filter:
 - term:
      download_dashboard: "dashboardname"

or other filter like querystring instead of term.

I thought the JSON schema would catch this... I guess it doesn't enforce type.

@andrpetr
Copy link
Author

andrpetr commented Jan 10, 2018

Thanks. This solved the problem. I think we should update documentation, because we are missing - term in examples from "Loading Filters Directly From Kibana 3" section

@andrpetr andrpetr reopened this Jan 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants