Skip to content

read_pcap

Reads raw network packets in PCAP file format.

read_pcap [emit_file_headers=bool]

The read_pcap operator converts raw bytes representing a PCAP file into events.

Emit a pcap.file_header event that represents the PCAP file header. If present, the parser injects this additional event before the subsequent stream of packets.

Emitting this extra event makes it possible to seed the write_pcap operator with a file header from the input. This allows for controlling the timestamp formatting (microseconds vs. nanosecond granularity) and byte order in the packet headers.

When the PCAP parser processes a concatenated stream of PCAP files, specifying emit_file_headers will also re-emit every intermediate file header as separate event.

Use this option when you would like to reproduce the identical trace file layout of the PCAP input.

The operator emits events with the following schema.

Contains information about all accessed API endpoints, emitted once per second.

FieldTypeDescription
timestamptimeThe time of capturing the packet.
linktypeuint64The linktype of the captured packet.
original_packet_lengthuint64The length of the original packet.
captured_packet_lengthuint64The length of the captured packet.
datablobThe captured packet’s data as a blob.
load_file "/tmp/trace.pcap"
read_pcap
load_nic "eth0"
read_pcap

write_pcap