read hash mismatch errors from influx and error if > 0 (#14240)

This commit is contained in:
Jeff Washington (jwash)
2020-12-30 12:47:48 -06:00
committed by GitHub
parent 71b88da48e
commit b36ad91792
3 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,14 @@
#!/usr/bin/env python3
import sys, json
data=json.load(sys.stdin)
# this code is designed for influx queries where 'no data' means 0
if 'results' in data:
for result in data['results']:
val = "0"
if 'series' in result:
val = str(result['series'][0]['values'][0][1])
print(val)
else:
print("No results returned from CURL request")