aboutsummaryrefslogtreecommitdiff
path: root/examples/py-json-stdout/json-stdout.py
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-08-25 20:08:01 +0200
committerToni Uhlig <matzeton@googlemail.com>2023-08-27 20:08:01 +0200
commita7bd3570b03f6b2fdc9bab09c956193708723cbf (patch)
treead6f22edea20d3d718459ca6b3da8ee121e59b73 /examples/py-json-stdout/json-stdout.py
parentb01498f011eac9b91c076901ffb5c9c04e7691c0 (diff)
Enable custom JSON filter expressions for Python scripts.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'examples/py-json-stdout/json-stdout.py')
-rwxr-xr-xexamples/py-json-stdout/json-stdout.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/py-json-stdout/json-stdout.py b/examples/py-json-stdout/json-stdout.py
index f1aa51b5b..cde22cd9b 100755
--- a/examples/py-json-stdout/json-stdout.py
+++ b/examples/py-json-stdout/json-stdout.py
@@ -15,7 +15,7 @@ def onJsonLineRecvd(json_dict, instance, current_flow, global_user_data):
return True
if __name__ == '__main__':
- argparser = nDPIsrvd.defaultArgumentParser()
+ argparser = nDPIsrvd.defaultArgumentParser('Plain and simple nDPIsrvd JSON event printer with filter capabilities.', True)
args = argparser.parse_args()
address = nDPIsrvd.validateAddress(args)
@@ -23,5 +23,6 @@ if __name__ == '__main__':
sys.stderr.write('Connecting to {} ..\n'.format(address[0]+':'+str(address[1]) if type(address) is tuple else address))
nsock = nDPIsrvdSocket()
+ nDPIsrvd.prepareJsonFilter(args, nsock)
nsock.connect(address)
nsock.loop(onJsonLineRecvd, None, None)