using tshark with variable in python

146 views Asked by At

I have large .pcap file for post processing. I am using tshark for it and I am able to get around with hard-coded values with os.system in python.

os.system("tshark -r file.pcap -T fields \
                 -R \"frame.number > 50 && wlan.da == 08:11:96:1e:e2:a4\" \
                 -e radiotap.mcs.index -e wlan.fc.retry\
                 -e radiotap.datarate > hp1.txt")

I want to find a better option to above - wherein I can use variables. example - Filename - variable , total frame count - variable , destination address - variable and so on

I checked few SO links SO but it didnt help me get pass the hurdle.

Are there other options than using os.system to achieve above purpose ?

0

There are 0 answers