python">#!/bin/env python import json import time, datetime stackP = open("./outLog") for eachLine in stackP: result = eachLine.find("signalingDomain") if result == -1: continue stringStart = eachLine.find('{') stringEnd = eachLine.rfind('}') string = eachLine[stringStart:stringEnd + 1] jsonString = json.loads(string) sessionId = jsonString['commandHead']['sessionId'] cCRequestType = jsonString['commandHead']['cCRequestType'] cCRequestNumber = jsonString['commandHead']['cCRequestNumber'] print sessionId, cCRequestType, cCRequestNumber
python 分析日志
最后更新 2018-05-17 08:00 星期四 所属:
Python教程 浏览:873