1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| import re, subprocess
| text = subprocess.run(["docker","logs","--since","30m","mom-kyzn"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, timeout=180).stdout.decode("utf-8","replace")
| text = re.sub(r"\x1b\[[0-9;]*m","",text)
| lines = text.split("\n")
| want = ["HttpMessageNotWritableException","IORuntimeException","InvalidCacheLoadException","MybatisPlusException","NullPointerException","FlowableIllegalArgumentException","HttpMessageNotReadableException"]
| cur=""
| res={}
| for i,l in enumerate(lines):
| m = re.search(r"\[preHandle\]\[开始请求 URL\(([^)]+)\)", l)
| if m: cur = m.group(1).split("?")[0]
| for w in want:
| if w in l:
| res.setdefault(w, set()).add(cur)
| for w in want:
| if w in res:
| print("##", w)
| for u in sorted(res[w]):
| print(" ", u)
|
|