Capture by instead:
sudo wireshark -f http -k
sudo wireshark -f icmp -k
Filter by both protocol and host:
sudo wireshark -f 'host 192.168.1.102 and icmp' -k
For application layer capture filtering, the best you can do is by port:
sudo wireshark -f 'tcp port 80'
There is an http filter but only for as a wireshark display filter
tshark by Ciro Santilli 37 Updated 2025-07-16
Sample usage:
sudo tshark -f 'host 192.168.1.102
This produces simple one liners for each request.
What you likely want is the -V option which fully disassembles each frame much as you can do in the GUI Wireshark:
sudo tshark -V -f 'host 192.168.1.102
ICMP runs on top of IP by Ciro Santilli 37 Updated 2025-07-16
This can be seen with Wireshark very clearly for example, just make a ping and disssemble it.
As per stackoverflow.com/a/52351480/895245 our standard test setup is:
while true; do
  resp=$"$(date): hello\n"
  len="$(printf '%s' "$resp" | wc -c)"
  printf "HTTP/1.1 200 OK\r\nContent-Length: $len\r\n\r\n${resp}\n" | nc -Nl 8000
done

Unlisted articles are being shown, click here to show only listed articles.