Link to home
Start Free TrialLog in
Avatar of RonWensley
RonWensley

asked on

In python how can I redirect the output from tcpdump to a variable

Greetings,

I am looking for a way to make this work in python,

f=os.system("tcpdump -l src 172.16.0.3 and dst 172.16.0.33")
print "Dump is ", f

I will then process 'f' downstream of this

This produces an output of tcpdump to the console but nothing to the 'f' string

Thanks,
Ron
ASKER CERTIFIED SOLUTION
Avatar of clockwatcher
clockwatcher

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RonWensley
RonWensley

ASKER

Thanks for the quick reply.  This is working out great.  I will have a look at the link you offered and see how that can be used.