rsyslog/tests/es_response_get_msgnum.py
jwslater0823 343a0853a0
testbench: modify es_response_get_msgnum.py for python3
python3 does not like mixing spaces and tabs for indentation, so we get rid of the tab before print().
2020-02-15 16:34:51 -08:00

9 lines
235 B
Python

import json
import os
with open(os.environ['RSYSLOG_DYNNAME'] + ".work") as json_file:
json_data = json.load(json_file)
json_data = json_data["hits"]
for item in json_data["hits"]:
print(item["_source"]["msgnum"])