How to automate PCAP analysis with a watched folder

A watched folder turns “someone should upload this capture” into a repeatable handoff: a new PCAP or PCAPNG file appears in a mounted directory and is queued for analysis automatically.

By Stuart Mathieson7 minute readDocker workflowUpdated 25 September 2026
Feature note

Watched-folder monitoring is a PCAPNG Analyzer Pro feature. Manual and batch upload remain available in the Free tier.

In this guide
  1. Design the handoff
  2. Mount the directory
  3. Enable monitoring
  4. Operate it safely
  5. When not to use it

1. Decide what the folder means

Use the watched directory as an intake boundary, not as your only archive. Give files names that preserve source and time, for example branch-07-wan-20260925T140000Z.pcapng. Keep the original capture and collection metadata according to your retention policy.

The watcher responds to new .pcap and .pcapng files in one directory. It is not a recursive evidence-management system, packet sensor or scheduled capture service. Another tool still has to create or deliver each capture.

2. Bind-mount a host directory into the container

Create an intake directory on the Docker host and restrict who can write to it:

sudo mkdir -p /srv/pcap-intake
sudo chown root:root /srv/pcap-intake
sudo chmod 750 /srv/pcap-intake

Add the bind mount to the pcapng-analyzer service in your Compose file:

services:
  pcapng-analyzer:
    image: smathieson/pcapng-analyzer:latest
    volumes:
      - pcap-data:/data
      - /srv/pcap-intake:/watch

Recreate the service after editing Compose:

docker compose up -d

The application sees the directory as /watch. Enter the container path, not /srv/pcap-intake, in the application settings.

3. Enable the folder monitor

  1. Open Settings → Detection Rules → Folder Monitor.
  2. Enable auto-analysis.
  3. Set the watch folder path to /watch.
  4. Select Apply and confirm the status shows Watching.
  5. Copy a small test capture into /srv/pcap-intake and confirm it appears in History.

The application waits for a new file to stop changing before it queues analysis. That protects against ordinary copy operations, but producers should still use a clean handoff pattern.

4. Use a safe producer pattern

Write or transfer the capture outside the watched directory, close it, then move the completed file into the intake directory. A rename on the same local filesystem is usually atomic:

dumpcap -i eth0 -a duration:300 -w /srv/pcap-staging/capture.pcapng
mv /srv/pcap-staging/capture.pcapng /srv/pcap-intake/

Operational checks matter more than the happy path:

Avoid network filesystems for event delivery.

Filesystem change notifications are not reliably propagated by every NFS, SMB or distributed-filesystem setup. Mount or copy captures onto a local host directory before relying on watched-folder ingestion.

5. Control load and retention

Automation can create resource pressure faster than manual upload. A burst of large files competes for parsing workers and storage. PCAPNG Analyzer applies configured file-size, batch, disk, packet and parse-time limits, plus a process-wide analysis-worker ceiling. Tune these to the server instead of assuming defaults fit every capture source.

Pro keeps unlimited analysis history, but disk remains finite. Decide whether History is an operational queue, a short-term library or a long-term record, then align backups and deletion with that purpose.

When a watched folder is the wrong tool

Manual handoff vs watched folder

Manual upload

  1. Review the capture and its sensitivity.
  2. Open the web interface.
  3. Select one file or a batch.
  4. Wait for processing.
  5. Open the report from History.

Watched folder

  1. A capture process finishes a local file.
  2. The completed file moves into the mounted directory.
  3. The watcher waits for file size to stabilise.
  4. The app queues and stores the analysis.
  5. An analyst reviews the result in History.

Start manually, automate when the pattern is proven

Try the complete parsing and reporting workflow in Free, then add Pro if watched-folder ingestion saves recurring work.

Start freeCompare tiers