JSONLogIterator - Fix the iteration if the JSON is already unwrapped
@@ -132,6 +132,9 @@ class JSONLogIterator(LogIterator):
for line in self.handle:
try:
data = json.loads(line)
+ if "payload" in data.keys():
+ item = SBP.from_json_dict(data)
+ else:
item = SBP.from_json_dict(data.pop('data', data))
msg = self.dispatch(item, line)
yield (msg, data)
