filetrace events prints the agent’s records in the order they were made, oldest first: process, socket, network and transfer events, the raw material that the other commands add up. Past events come from a log kept in memory; --follow prints new events as they happen.
Usage
Event types
Byte counts are gathered in the kernel and collected several times a second, so a
network_send, network_receive or file_transfer event carries the bytes of one such interval, not of one system call. File opens and individual system calls are not recorded. Event types lists the fields of each.
What it shows
key=value line per field that applies:
The last line counts the events printed and says how far back the event log reaches.
The event log
Past events come from a log of bounded size kept in the agent’s memory: 1 MB by default, set with--event-log-size of filetrace-agent or [agent] event_log_size in the configuration. It holds only the most recent events and starts empty when the agent starts. Transfer, network and process events have separate shares of the log, so a flood of one kind does not push out the others; when a share has discarded events, the log reaches back only to its oldest remaining one.
Following events
--follow (or -f) keeps printing events as they happen until you press Ctrl-C. It starts at the present, unless --since or --limit asks for past events first:
--follow starts a collector in the foreground for as long as it runs. This needs the same privileges as the agent and shows only activity from the moment it starts. A followed stream ends without the summary line.
If a follower reads more slowly than events arrive and falls more than 1 MB behind, the agent skips events for it and then sends an event_loss event whose cause is this reader fell behind.
Raw output
--raw prints one line per event with every field unformatted, in a fixed order, with the free text last because it may contain spaces:
time_ns is in nanoseconds since the Unix epoch, protocol is the IP protocol number, and method, confidence, loss_kind and flags are the internal numeric codes. --raw is a format of its own and cannot be combined with --format, --json or --jsonl.
JSON output
In JSON and JSON Lines, each event has its type, an RFC 3339 timestamp and a sequence number, and groups its fields underprocess, file, network, transfer and loss, with the same names as the transfer records of files:
Options
string
Only these event types, separated by commas, such as
file_transfer,network_send. An unknown type is reported with the list of valid ones.boolean
Keep printing events as they happen. Starts at the present unless
--since or --limit is given. Short form: -f.boolean
One line per event with every field unformatted.
number
Only this process.
string
Only processes with this name.
* matches any run of characters. Alias: --name.string
Only this file.
* matches any run of characters, / included. Matches only file_seen and file_transfer events. Alias: --file.string
Only this remote address or CIDR network. Like the other network filters, it matches only events that concern a socket.
string
Only this local address or CIDR network.
number
Only this local or remote port.
string
default:"all"
Only this protocol:
tcp, udp or all.string
Only this address family:
ipv4 or ipv6.string
Only events made at or after this time: a duration such as
10m, 1h or 7d, or an RFC 3339 timestamp.string
Only events made at or before this time.
number
Only the most recent n matching events.
string
default:"table"
table, json or jsonl.boolean
Short for
--format json.boolean
Short for
--format jsonl.string
Write to this file instead of standard output.
[output] timestamps = false in the configuration leaves the time out of each event in the text format. See filters and output formats.