This pull request introduces a new -j option that allows users to receive network traffic data in newline-delimited JSON format. This feature is intended for users who wish to parse the output programmatically.
Changes include:
A new command-line option -j that enables JSON formatted output.
The jsontrace variable to toggle JSON trace mode.
A new function show_json_trace for displaying information in JSON.
A utility function log_json for structured logging.
The feature has been tested on Ubuntu 22.04, and Ubuntu 20.4 and includes error handling to ensure robustness.
Please let me know if there are any adjustments I should make. I am looking forward to your feedback!
This pull request introduces a new
-j
option that allows users to receive network traffic data in newline-delimited JSON format. This feature is intended for users who wish to parse the output programmatically.Changes include:
-j
that enables JSON formatted output.jsontrace
variable to toggle JSON trace mode.show_json_trace
for displaying information in JSON.log_json
for structured logging.The feature has been tested on Ubuntu 22.04, and Ubuntu 20.4 and includes error handling to ensure robustness.
Please let me know if there are any adjustments I should make. I am looking forward to your feedback!