summaryrefslogtreecommitdiff
path: root/examples/py-flow-info/flow-info.py
diff options
context:
space:
mode:
authorlns <matzeton@googlemail.com>2022-04-24 15:42:28 +0200
committerlns <matzeton@googlemail.com>2022-04-24 15:42:28 +0200
commit22a8d04c748ff3e04ca11c5c29b4433c7136f5f5 (patch)
treed8ee070e1b6943130f80a320761cb1e921adeffd /examples/py-flow-info/flow-info.py
parent9aeff586bd2b1af01fd798c2b7f1ade1ffb879d2 (diff)
Added proper DLT_RAW dissection for IPv4 and IPv6.
* nDPId: Improved TCP timeout handling if FIN/RST seen which caused Midstream TCP flows when there shouldn't be any. * nDPIsrvd: Unified remote descriptor resource cleanup on disconnects/shutdown. * nDPIsrvd: Added additional error messages for remote descriptors. * py-flow-info: Better daemon status message printing. Signed-off-by: lns <matzeton@googlemail.com>
Diffstat (limited to 'examples/py-flow-info/flow-info.py')
-rwxr-xr-xexamples/py-flow-info/flow-info.py26
1 files changed, 15 insertions, 11 deletions
diff --git a/examples/py-flow-info/flow-info.py b/examples/py-flow-info/flow-info.py
index f11750351..541a8c16d 100755
--- a/examples/py-flow-info/flow-info.py
+++ b/examples/py-flow-info/flow-info.py
@@ -262,19 +262,23 @@ def onJsonLineRecvd(json_dict, instance, current_flow, global_user_data):
if 'daemon_event_id' in json_dict:
if json_dict['daemon_event_name'] == 'status':
color = [TermColor.WARNING]
- daemon_msg = '[Processed: {} pkts][ZLib][compressions: {}|diff: {} / {}][Flows][active: {} / {}|skipped: {}|!detected: {}' \
- '|guessed: {}|detection-updates: {}|updates: {}]'.format(
- json_dict['packets-processed'],
- json_dict['total-compressions'], json_dict['current-compression-diff'], json_dict['total-compression-diff'],
- json_dict['current-active-flows'], json_dict['total-active-flows'],
- json_dict['total-skipped-flows'],
- json_dict['total-not-detected-flows'], json_dict['total-guessed-flows'],
- json_dict['total-detection-updates'], json_dict['total-updates'])
+ daemon_msg = list()
+ daemon_msg += ['[Processed: {} pkts][ZLib][compressions: {}|diff: {} / {}]'.format(
+ json_dict['packets-processed'],
+ json_dict['total-compressions'], json_dict['current-compression-diff'], json_dict['total-compression-diff'])]
+ daemon_msg += ['[Flows][active: {} / {}|skipped: {}|!detected: {}|guessed: {}|' \
+ 'detection-updates: {}|updates: {}]'.format(
+ json_dict['current-active-flows'], json_dict['total-active-flows'],
+ json_dict['total-skipped-flows'],
+ json_dict['total-not-detected-flows'], json_dict['total-guessed-flows'],
+ json_dict['total-detection-updates'], json_dict['total-updates'])]
else:
color = [TermColor.WARNING, TermColor.BLINK]
- daemon_msg = json_dict['daemon_event_name']
- print('{}{}{} {}: {}'.format(timestamp, basic_daemon_event_prefix, instance_and_source,
- prettifyEvent(color, 15, 'DAEMON-EVENT'), daemon_msg))
+ daemon_msg = list()
+ daemon_msg += [json_dict['daemon_event_name']]
+ for dm in daemon_msg:
+ print('{}{}{} {}: {}'.format(timestamp, basic_daemon_event_prefix, instance_and_source,
+ prettifyEvent(color, 15, 'DAEMON-EVENT'), dm))
stats.printStatus()
return True
if 'error_event_id' in json_dict: