> For the complete documentation index, see [llms.txt](https://docs.cennso.com/cennso/netcap/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/cennso/netcap/latest/guides/pcap-livestream.md).

# Observe real-time traffic in Wireshark

NetCap allows you to view traffic streams in real-time directly in [Wireshark](https://www.wireshark.org/) using an HTTP endpoint. You can connect to:

- NetCap Sink – to view aggregated traffic from multiple sources
- NetCap Collector – to view traffic captured on a specific Data Plane node

Follow these steps to view aggregated traffic from NetCap Sink:

1. Use port forwarding to access a NetCap Sink pod:

   ```bash
   kubectl port-forward -n cennso-system pod/netcap-sink-0 9999:9999
   ```

   This command maps port `9999` on your local machine, allowing direct access to the streaming service.

2. Use an HTTP request to fetch the traffic stream and redirect it to Wireshark:

   ```bash
   curl --compressed localhost:9999/pcap/TARGET1 -N | wireshark -k -i - -o 'gui.window_title:netcap-stream' -o 'capture.no_interface_load:TRUE'
   ```

   This command performs the following actions:

   - `curl --compressed` - starts a cURL and requests a server to perform the request compression and decompression before writing data to a pipe.
   - `localhost:9999/pcap/TARGET1` - URL to the forwarded NetCap API port with a name of a traffic stream **TARGET1**, which corresponds to a `NetCaptureJob` CR name or target defined in **netcapCollector.streams[].source.memif.targets**.
   - `-N` - disables pipe buffering to ensure real-time updates in Wireshark.
   - `| wireshark -k -i -` - sends (pipes) the output from curl directly into Wireshark, which starts analyzing the stream immediately.
   - `-o 'gui.window_title:netcap-stream'` - sets the Wireshark window title for easy identification.
   - `-o 'capture.no_interface_load:TRUE'` - prevents Wireshark from listing local interfaces, which speeds up the startup.

As a result, you see real-time traffic in Wireshark.
