pcapfile

Queries packet data from a PCAP file.

Command properties

ItemDescription
Command typeDriver query
Required permissionCluster administrator
License usageLicensed command
Parallel executionNot supported
Distributed executionNot supported

Syntax

pcapfile PATH
PATH (required)
Path to the PCAP file

Error codes

Parse errors
Error codeMessageDescription
11900invalid-file-pathThe file does not exist or cannot be read
11901invalid-enclosing-pathThe parent directory does not exist or cannot be read
11902missing-fieldNo file path specified
11903access-denied-to-fileFile access is denied
11904permission-deniedThe user does not have cluster administrator privilege
Runtime errors

N/A

Description

The pcapfile command reads packet data from a PCAP file and returns each packet as a record. Because it returns the packet binary in the payload field, pass it to packet processing commands such as decodedhcp, decodedns, decodehttp, decodesflow, and pcapdecode.

Output fields
FieldTypeDescription
_timetimestampPacket capture time
payloadbinaryPacket binary data

Examples

  1. Reading a PCAP file and decoding DNS packets

    pcapfile /opt/logpresso/data/capture.pcap | decodedns
    

    Reads packets from the PCAP file and decodes the DNS protocol using the decodedns command.