Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions elastalert/test_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_file(self, conf, args):

# Get one document for schema
try:
res = es_client.search(index, size=1, body=query, ignore_unavailable=True)
res = es_client.search(index=index, size=1, body=query, ignore_unavailable=True)
except Exception as e:
print("Error running your filter:", file=sys.stderr)
print(repr(e)[:2048], file=sys.stderr)
Expand All @@ -109,7 +109,7 @@ def test_file(self, conf, args):
five=conf['five']
)
try:
res = es_client.count(index, doc_type=doc_type, body=count_query, ignore_unavailable=True)
res = es_client.count(index=index, doc_type=doc_type, body=count_query, ignore_unavailable=True)
except Exception as e:
print("Error querying Elasticsearch:", file=sys.stderr)
print(repr(e)[:2048], file=sys.stderr)
Expand Down Expand Up @@ -153,7 +153,7 @@ def test_file(self, conf, args):
# Download up to max_query_size (defaults to 10,000) documents to save
if (args.save or args.formatted_output) and not args.count:
try:
res = es_client.search(index, size=args.max_query_size, body=query, ignore_unavailable=True)
res = es_client.search(index=index, size=args.max_query_size, body=query, ignore_unavailable=True)
except Exception as e:
print("Error running your filter:", file=sys.stderr)
print(repr(e)[:2048], file=sys.stderr)
Expand Down