This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

invalid address:port pair

1

I ran this script:

file=man.pcap
for stream in $(tshark -nlr $file -Y tcp.flags.syn==1 -T fields -e tcp.stream | sort -n | uniq)
do
  echo "Processing stream $stream"
  tshark -nlr $file -qz "follow,tcp,ascii,$stream" > stream-$stream.log
done

but I got this message for all streams:

Processing stream 0 tshark: follow - Invalid address:port pair.

Processing stream 1 tshark: follow - Invalid address:port pair.

Processing stream 2 tshark: follow - Invalid address:port pair.

. . .

what is the reason?

asked 30 Aug ‘13, 10:40

Soroor's gravatar image

Soroor
21448
accept rate: 0%

converted to question 30 Aug ‘13, 10:44


One Answer:

2

what is the reason?

There is a carriage return that needs to be removed. Try something like the following:

file=man.pcap
for stream in $(tshark -nlr $file -Y tcp.flags.syn==1 -T fields -e tcp.stream | sort -n | uniq | sed 's/\r//')
do
    echo "Processing stream $stream"
    tshark -nlr $file -qz "follow,tcp,ascii,$stream" > stream-$stream.log
done

answered 30 Aug '13, 11:27

cmaynard's gravatar image

cmaynard ♦♦
9.4k1038142
accept rate: 20%