diff --git a/scripts/understand_tor.py b/scripts/understand_tor.py old mode 100644 new mode 100755 index cbaea7a..8cf5cbc --- a/scripts/understand_tor.py +++ b/scripts/understand_tor.py @@ -9,7 +9,8 @@ input() with open('better_logs.txt', 'w') as f: for line in sys.stdin: - r = re.search(r'650 CIRC (\d+) (\S+) \S+ BUILD_FLAGS=\S+ PURPOSE=(\S+) HS_STATE=(\S+) TIME_CREATED=(\S+) (REASON=(\S+))? -', line) + r = re.search(r'650 CIRC (\d+) (\S+) (\S+) BUILD_FLAGS=(\S+) PURPOSE=(\S+) HS_STATE=(\S+)( REND_QUERY=(\S+))? TIME_CREATED=(\S+)( REASON=(\S+))?', line) if not r: continue - f.write("\n") + circ_id, circ_status, circ_relay_list, build_flags, purpose, hs_state, _, rend_query, time_created, _, reason= r.groups() + f.write(f"{circ_id},{circ_status},{purpose},{hs_state},{rend_query},{reason}\n") + f.flush()