summaryrefslogtreecommitdiff
path: root/examples/py-flow-info/flow-info.py
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2020-10-12 20:02:20 +0200
committerToni Uhlig <matzeton@googlemail.com>2020-10-12 20:02:20 +0200
commitec9dc251d2ca9d86627dfaf79abaa88185cd4b54 (patch)
treecf7f0311261cfb2d85eccf09141c138b88b84255 /examples/py-flow-info/flow-info.py
parent3cfb4d9c737debfbd8d74936a33a5a0eab79ac60 (diff)
py-flow-info: Print BasicEvents.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'examples/py-flow-info/flow-info.py')
-rwxr-xr-xexamples/py-flow-info/flow-info.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/py-flow-info/flow-info.py b/examples/py-flow-info/flow-info.py
index 044d11d9b..85ada4847 100755
--- a/examples/py-flow-info/flow-info.py
+++ b/examples/py-flow-info/flow-info.py
@@ -13,8 +13,13 @@ def parse_json_str(json_str):
j = nDPIsrvd.JsonParseBytes(json_str[0])
nDPIdEvent = nDPIsrvd.nDPIdEvent.validateJsonEventTypes(j)
if nDPIdEvent.isValid is False:
- raise RuntimeError('Missing flow_event_name in the JSON string: {}'.format(j))
- if nDPIdEvent.FlowEventID == -1:
+ raise RuntimeError('Missing event id or event name invalid in the JSON string: {}'.format(j))
+ if nDPIdEvent.BasicEventID != -1:
+ be = '{}: {}'.format(TermColor.WARNING + TermColor.BLINK + 'BASIC-EVENT' + TermColor.END,
+ nDPIdEvent.BasicEventPrettyName)
+ print('{:>18}'.format(be))
+ return
+ elif nDPIdEvent.FlowEventID == -1:
return
ndpi_proto_categ = ''