These examples explain the current output formats. All displayed payloads, process IDs, timestamps, and secret placeholders are synthetic; they are not captured traffic or evidence of a successful run. For setup, see the README.
Repeat --output to send runtime logs and captured events to multiple
destinations. Without an explicit value, it defaults to stdout. Terminal
outputs prefix each text event once, preserving its content and line endings;
operational logs and keylogs label every line. Files and outgoing TCP
use Protobuf v2 JSON Lines, with log_type distinguishing the two record kinds.
Native keylog and pcapng artifacts use separate file parameters; --output
files receive only runtime logs in those two modes. See the
output matrix.
sudo ecapture tls --model text --text-source pcapng --output stdoutGenerate a request using an OpenSSL-linked application. The SDK reconstructs messages from captured packets and TLS secrets. A synthetic excerpt of a terminal event is shown below; its first line identifies its timestamp, protocol, direction, network endpoints, host, process and connection:
[log_type=event capture_format=text module=tls] [2026-11-22T12:00:00.000000000Z] http/1.1 request 192.0.2.1:50000 -> 192.0.2.2:443 host="example.com" domain_source="Host" pid=12345 pname="curl" connection="192.0.2.1:50000--192.0.2.2:443/tcp#1"
GET / HTTP/1.1
Host: example.com
pid and pname identify the observed local process; unavailable process
metadata is shown as pid=0 pname="". connection identifies the original
connection endpoints, transport and generation, without PID, FD or process name.
Text payload bytes are preserved, including HTTP CRLF line endings and blank
lines; carriage returns are no longer displayed as \x0d. Operational log
lines start with [log_type=log module=tls] and still escape control characters.
To retain a machine-readable
record alongside the terminal and optionally save the packets used for
reconstruction:
sudo ecapture tls --model text --text-source pcapng -i eth0 \
--output stdout --output records.jsonl --pcapfile capture.pcapng 'tcp port 443'Replace eth0 and the filter with the target interface and traffic. The JSON
file contains both LOG_TYPE_PROCESS_LOG and LOG_TYPE_EVENT records. TEXT
records store the same formatted decoded output in
event_payload.text.payload (base64 in ProtoJSON), alongside process, network,
TLS and application-stream metadata when available. Decode the payload once;
it is not the whole JSON record. In text mode with --text-source pcapng,
--pcapfile optionally saves the pcapng stream used for decryption.
HTTP/1.1 and HTTP/2 are the default parsers. Explicit raw, application-protocol,
HTTP-event and UDP options are described in the
text decryption guide.
The older function-hook source remains available through --text-source hook,
but its reads and writes may contain message fragments.
sudo ecapture tls --model pcapng -i eth0 --pcapfile capture.pcapng \
--output stdout --output runtime.jsonl 'tcp port 443'capture.pcapng is a binary pcapng file containing captured network packets and
embedded TLS Decryption Secrets Blocks (DSBs). The terminal and runtime.jsonl
show only operational logs. After generating traffic and stopping eCapture, open the
pcapng in Wireshark. For a strict decryption check, follow the
embedded-secret verification steps
in the README; a non-empty file alone does not prove successful capture or
decryption.
sudo ecapture tls --model keylog --keylogfile tls.keys \
--output stdout --output runtime.jsonltls.keys contains NSS Key Log lines; runtime.jsonl contains runtime logs
only. The terminal labels each NSS line as an event. The following shows the
native file shape only; angle-bracket placeholders are not valid hex values
or usable secrets:
CLIENT_RANDOM <client-random-hex> <master-secret-hex>
CLIENT_HANDSHAKE_TRAFFIC_SECRET <client-random-hex> <secret-hex>
SERVER_HANDSHAKE_TRAFFIC_SECRET <client-random-hex> <secret-hex>
Keylog output contains no packets. Capture the target traffic separately, then combine that capture with the generated keylog:
tshark -n -r traffic.pcapng -o tls.keylog_file:tls.keys -q -z follow,tls,ascii,0Both native modes require an explicit local artifact path, distinct from any
--output file. To receive native events remotely, use --output tcp://HOST:PORT
or --stream-listen ws://HOST:PORT/PATH. Receivers decode the v2 envelope and
append the KEYLOG/PCAPNG data bytes in arrival order; see the
receiver example for session and
partial-file handling. WebSocket clients must negotiate ecapture.v2.
The same text, keylog, and pcapng output choices apply to GoTLS and GnuTLS. Select the actual Go executable or GnuTLS library used by the workload:
sudo ecapture gotls --elfpath /path/to/go-client --model text --text-source pcapng
sudo ecapture gnutls --gnutls /path/to/libgnutls.so --model text --text-source pcapngRun the matching application while capture is active. For keylog/pcapng,
select the mode and native file as above. Text defaults to the pcapng source;
packet capture selects an interface automatically. Use -i <interface> to
override it. GnuTLS support depends on the library's patch-specific asset mapping.
sudo ecapture bash
sudo ecapture mysqldBash captures command events; MySQL captures queries at supported server
hooks. These are not terminal-output recording or database audit-log
replacements. See each command's --help for target and filtering options.