mirror of
https://github.com/valitydev/SigmaHQ.git
synced 2024-11-07 09:48:58 +00:00
Update elasticsearch.py
From ElasticSearch 7.0, the URI to access to Watcher API changes Deprecation: [PUT /_xpack/watcher/watch/{id}] is deprecated! Use [PUT /_watcher/watch/{id}] instead.
This commit is contained in:
parent
9e2345c491
commit
f86342012a
@ -564,9 +564,9 @@ class XPackWatcherBackend(ElasticsearchQuerystringBackend, MultiRuleOutputMixin)
|
||||
result = ""
|
||||
for rulename, rule in self.watcher_alert.items():
|
||||
if self.output_type == "plain": # output request line + body
|
||||
result += "PUT _xpack/watcher/watch/%s\n%s\n" % (rulename, json.dumps(rule, indent=2))
|
||||
result += "PUT _watcher/watch/%s\n%s\n" % (rulename, json.dumps(rule, indent=2))
|
||||
elif self.output_type == "curl": # output curl command line
|
||||
result += "curl -s -XPUT -H 'Content-Type: application/json' --data-binary @- %s/_xpack/watcher/watch/%s <<EOF\n%s\nEOF\n" % (self.es, rulename, json.dumps(rule, indent=2))
|
||||
result += "curl -s -XPUT -H 'Content-Type: application/json' --data-binary @- %s/_watcher/watch/%s <<EOF\n%s\nEOF\n" % (self.es, rulename, json.dumps(rule, indent=2))
|
||||
elif self.output_type == "json": # output compressed watcher json, one per line
|
||||
result += json.dumps(rule) + "\n"
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user