20.9. PCAP File Reading
Suricata offers a pcap-file capture method to process PCAP files and
directories of PCAP files in an offline or live-feed manner.
20.9.1. Configuration
pcap-file:
checksum-checks: auto
# buffer-size: 128 KiB
# tenant-id: none
# Applies to file and directory. Options: false (no deletion), true (always delete),
# "non-alerts" (delete only files with no alerts)
# delete-when-done: false
# recursive: false
# continuous: false
# delay: 30
# poll-interval: 5
20.9.2. Buffer Size
This option specifies the size of the read buffer for the PCAP file. The larger the buffer, the more data Suricata can read at once. This can improve performance, especially for large files. The size can be specified through the command line option, see --pcap-file-buffer-size
20.9.4. Other options
checksum-checks
auto (default): Suricata detects checksum offloading statistically.
yes: Forces checksum validation.
no: Disables checksum validation.
The command-line option is -k
tenant-id
Specifies the tenant for multi-tenant setups with direct select.
The PCAP is processed by the detection engine assigned to the specified tenant.
delete-when-done
Controls when PCAP files are deleted after processing. Three values are supported:
false(default): Files are never deletedtrue: Files are always deleted after processing"non-alerts": Files are deleted only if they didn't generate any alerts
Note
The command-line option --pcap-file-delete
overrides this configuration and forces "always delete" mode (true).
Warning
When using "non-alerts" mode, file deletion is deferred until thread
cleanup to ensure alert counts are finalized. This may delay deletion
compared to other modes.
BPF filter
Suricata supports BPF filters for packet capture that is also applicable to the
pcap-filecapture method.The BPF filter is specified in the file with the -F command-line option.