Created
July 25, 2017 17:15
-
-
Save remyleone/7cfd5514a4f7ad73ca8c7a371551e36a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess | |
| import sys | |
| import json | |
| your_command = ["tshark", "-T", "ek", "-x", "-i", "tun0"] | |
| process = subprocess.Popen(your_command, stdout=subprocess.PIPE) | |
| for line in iter(process.stdout.readline, ''): | |
| # We remove blank lines with strip | |
| if line.strip(): | |
| d = json.loads(line) | |
| if not "index" in d.keys(): | |
| print(d) | |
| print("----------------") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment