Is there a possibility to filter tcpdump (live or after creating a dump) based on tcp connection time (connection duration)?
I'm recording http json rpc traffic. I want to record only connections that are longer than lets say 1000 ms.
In wireshark there is tool in Menu->Statistics->Conversations (TCP tab) and there i can sort by "Duration". But i want to record (or filter) long lived connections before (not in wireshark).
In pseudo commands I want to do something like this:
tcpdump -i eth0 port 80 and connectionTime>1000ms -w data.pcap
or after recording:
cat data.pcap | SOMETOOL -connectionTime>1000ms > dataLongConnections.pcap
SOMETOOL must export filtered data to format that Wireshark will understand. Because after filtering I want to analyze that data in Wireshark.
How I can do this?