how to run pkt2flow from python
Hello,
how can I use pkt2flow in python scripts? I am generating the pcap file from python script and I want to get tcp sessions from that pcap file using a python script as well pkt2flow
Thanks,
Unfortunately, you can not use pkt2flow in python directly. Instead, you can write the pcap file to disk, and invoke pkt2flow using subprocess module in python to process the pcap file. May this help u.
I tried to invoke but i failed. Do you have any idea how to do it?
Many thanks,
Sent from my iPhone
On Jan 21, 2015, at 6:11 PM, Xiaming [email protected] wrote:
Unfortunately, you can not use pkt2flow in python directly. Instead, you can write the pcap file to disk, and invoke pkt2flow using subprocess module in python to process the pcap file. May this help u.
— Reply to this email directly or view it on GitHub.
Give a try
cmd = '/path/to/pkt2flow -o flows {0}'.format(pcap_file_name)
Popen(cmd, shell=True, stdout=PIPE).communicate()
Good luck! :+1: