elastalert-create-index Enter Elasticsearch host: xxx Enter Elasticsearch port: 9200 Use SSL? t/f: f Enter optional basic-auth username (or leave blank): Enter optional basic-auth password (or leave blank): Enter optional Elasticsearch URL prefix (prepends a string to the URL of every request): New index name? (Default elastalert_status) Name of existing index to copy? (Default None) Elastic Version:5 Mapping used for string:{'index': 'not_analyzed', 'type': 'string'} Index elastalert_status already exists. Skipping index creation.
# Alert when the rate of events exceeds a threshold
# (Optional) # Elasticsearch host es_host:xxx
# (Optional) # Elasticsearch port es_port:9200
# (OptionaL) Connect with SSL to Elasticsearch #use_ssl: True
# (Optional) basic-auth username and password for Elasticsearch #es_username: someusername #es_password: somepassword
# (Required) # Rule name, must be unique name:querytimeout
query_key: -name
realert: minutes:5
# (Required) # Type of alert. # the frequency rule type alerts when num_events events occur with timeframe time type:frequency
# (Required) # Index to search, wildcard supported index:dataservice-custom-api-log*
# (Required, frequency specific) # Alert when this many documents matching the query occur within a timeframe num_events:10
# (Required, frequency specific) # num_events must occur within this amount of time to trigger an alert timeframe: #hours: 4 minutes:1
# (Required) # A list of Elasticsearch filters used for find events # These filters are joined with AND and nested in a filtered query # For more info: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html
#filter: #- term: # some_field: "some_value"
filter: -query_string: query:"logtextJson.totalUsed:>5000 AND -host:(zhike1 OR zhike2 OR zhike3)"
Traceback (most recent call last): File "/usr/local/anaconda2/bin/elastalert", line 11, in <module> sys.exit(main()) File "/usr/local/anaconda2/lib/python2.7/site-packages/elastalert/elastalert.py", line 1925, in main client.start() File "/usr/local/anaconda2/lib/python2.7/site-packages/elastalert/elastalert.py", line 1106, in start self.run_all_rules() File "/usr/local/anaconda2/lib/python2.7/site-packages/elastalert/elastalert.py", line 1158, in run_all_rules self.send_pending_alerts() File "/usr/local/anaconda2/lib/python2.7/site-packages/elastalert/elastalert.py", line 1534, in send_pending_alerts pending_alerts = self.find_recent_pending_alerts(self.alert_time_limit) File "/usr/local/anaconda2/lib/python2.7/site-packages/elastalert/elastalert.py", line 1526, in find_recent_pending_alerts size=1000) File "/usr/local/anaconda2/lib/python2.7/site-packages/elasticsearch/client/utils.py", line 84, in _wrapped return func(*args, params=params, **kwargs) TypeError: search() got an unexpected keyword argument 'doc_type'
版本不匹配
查看版本
1 2 3 4 5
pip freeze | grep elas You are using pip version 9.0.1, however version 19.1.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. elastalert==0.1.39 elasticsearch==7.0.1