From a7bd3570b03f6b2fdc9bab09c956193708723cbf Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Fri, 25 Aug 2023 20:08:01 +0200 Subject: Enable custom JSON filter expressions for Python scripts. Signed-off-by: Toni Uhlig --- examples/py-json-stdout/json-stdout.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples/py-json-stdout/json-stdout.py') 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) -- cgit v1.2.3