Enhance the ES plugin to check the results count field.

The plugin script uses [hits][hits] for checking the total
result count. So, it was updated to use the right field.

Change-Id: I371302bc24e59320a59bd815922d41e387e23e3a
This commit is contained in:
John Lawrence 2020-03-04 16:57:17 +00:00
parent b2b0ba86f4
commit ded4c59dc2
1 changed files with 1 additions and 1 deletions

View File

@ -132,7 +132,7 @@ def evaluate_results(response, args):
pprint(response.json())
results = response.json()
hits = len(results['hits']['hits'])
hits = int(results['hits']['total']['value'])
crit_message = ('Found %s >= %s(threshold) occurrences within the last %s minute(s). %s')
message = ('Found %s >= %s(threshold) occurrences within the last %s minute(s).')
ok_message = ('Found %s [threshold: %s] occurrences within the last %s minute(s).')