Skip to content

Instantly share code, notes, and snippets.

@chetan
Created May 21, 2013 20:03
Show Gist options
  • Save chetan/5622761 to your computer and use it in GitHub Desktop.
Save chetan/5622761 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
files = `ls -1 *.pcap`.split("\n")
threads = []
8.times do
threads << Thread.new do
while not files.empty? do
f = files.pop
puts "\nprocessing next file: #{f}\n"
cmd = "tshark -r #{f} -n -R http -T fields -e http.request.uri -e ip.src -e http.x_forwarded_for -e http.user_agent >> /mnt/mnt2/#{f}.txt"
system(cmd)
end
end
end
threads.each{ |t| t.join }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment