Authored by wuxiao

解析json

... ... @@ -43,16 +43,16 @@ while True:
db = 'error'
measurement = Config.debug_channel+time.strftime('_%Y%m%d')
data['data'] = json.loads(data['data'])
json_body = dict(data['data'],**data['tags'])
json_body['context'] = json.loads(json_body['context'])
mongodb_insert(db,measurement,json_body)
elif data['group'] == 'shutdown':
db = 'error'
measurement = Config.shutdown_channel+time.strftime('_%Y%m%d')
data['data'] = json.loads(data['data'])
json_body = dict(data['data'],**data['tags'])
json_body['context'] = json.loads(json_body['context'])
mongodb_insert(db,measurement,json_body)
else:
... ...