Linux Datasets
Linux datasets define collection rules for Linux devices (dataset type linux). Most collector types, including file log collection, are configured through the dataset creation wizard — see Management; the connection event and script execution collectors below are configured via device YAML. For the dataset and profile model, see Overview.
A Linux device collecting agentless over SSH runs inventory collection only — every dataset assigned to it is skipped, including the collectors on this page. Assign datasets to Linux devices running the VirtualMetric Agent. See Linux for the two deployment modes.
Collector Types
- Linux System Events (
linux_host_log_collector): File path input for the system log source. - Linux Audit Events (
linux_audit_report_log_collector): File path input for the audit log source. - Linux Firewall Events (
linux_firewall_log_collector): File path input for the firewall log source. - Linux TCP Connections (
linux_tcp_connection_collector): Established TCP connections with process attribution and destination geolocation. - Linux Remote Connections (
linux_remote_connection_collector): Remote login sessions (SSH and console) from host session records. - Linux Script Execution (
linux_execute_collector): Runs a script or executable and collects its standard output as log events. - Linux Metrics (
linux_metrics_collector): The host's performance, sampled on an interval — CPU, memory, swap, volumes, block devices, network interfaces, and the busiest processes — as ECS metric documents. - Linux Suricata Stats (
linux_suricata_stats_collector): The engine counters of a Suricata IDS/IPS sensor on the host, read from its command socket on an interval, as ECS metric documents. - Linux WireGuard Interfaces (
linux_wireguard_interface_collector): The WireGuard interfaces on the host, read on an interval as ECS metric documents. See WireGuard. - Linux WireGuard Peers (
linux_wireguard_peer_collector): The peers of the host's WireGuard interfaces — endpoint, last handshake, and bytes received and sent — read on an interval as ECS metric documents. See WireGuard. - Linux Certificates (
linux_certificate_collector): The certificates in the host's certificate files, read on an interval as an inventory, each markedadded,changed,unchangedorremoved. See Linux Certificates. - Linux Docker Containers (
linux_docker_container_collector): The containers of a Docker engine, running or not, read on an interval as an inventory, each markedadded,changed,unchangedorremoved. See Linux Docker. - Linux Docker Logs (
linux_docker_log_collector): The lines the containers of a Docker engine write to their standard output and error, with each container's name, image and labels. See Linux Docker. - Kubernetes Pod Logs (
linux_kubernetes_pod_log_collector): Container logs written by the kubelet under/var/log/pods, decoded as CRI and filtered by namespace, pod label, or owner kind. - Kubernetes Metrics (
linux_kubernetes_metrics_collector): Node, pod, and container usage and status read from the kubelet, with optional cluster-object and cAdvisor series.
Connection Event Collectors
The TCP connection (linux_tcp_connection_collector) and remote connection (linux_remote_connection_collector) collectors capture host network activity as ECS events. The TCP collector reports established TCP connections with process attribution and destination geolocation. The remote connection collector reports remote login sessions (SSH, derived from pts* devices) and local console sessions (tty*) from the host session records. Both accept only a pipeline_name property for routing; collection cadence, connection caching, and country-level geolocation are handled automatically.
These collectors are configured via device YAML files under config/devices/ — they are not available in the dataset creation wizard.
Enabling TCP and remote connection collection on a Linux device, routing both to a pipeline... | |
Each established TCP connection is emitted as an ECS event with process and destination geo... | |
A remote login session is emitted with the authenticated user and session type... | |
Script Execution
The linux_execute_collector runs a script or executable on the Linux host and collects its standard output as log events. Each execution is defined as an input with its own interpreter, arguments, schedule, and pipeline routing, so a single dataset can run multiple scripts.
This collector is configured via device YAML files under config/devices/. Scripts must be placed in the agent's user/scripts (operator-owned, survives upgrades) or package/scripts (product-shipped) directory; the path property is a file name only.
Input properties
Each entry under inputs: defines one script execution. Inputs share the standard dataset input frame (id, name, status) plus the following properties:
| Field | Required | Type | Default | Description |
|---|---|---|---|---|
path | Y | string | — | Script or executable file name (not a path). Resolved under the agent's scripts directories. Absolute paths and .. traversal are rejected. |
interpreter | N | string | — | Interpreter that runs the script. Linux: sh, bash, or exe. Windows: ps1, cmd, or exe. exe runs path directly. There is no implicit default; if unset (or unrecognized), shell is used instead. |
shell | N | string | — | Custom interpreter for the fall-through case (e.g. python3 or an executable path). On Windows with interpreter: ps1, selects the PowerShell edition: pwsh (7+), powershell (5.1), or unset (auto). |
args | N | list | — | Arguments passed to the script or executable. |
environment | N | map | — | KEY: VALUE pairs appended to the inherited process environment. |
working_directory | N | string | inherit | Working directory for the child process. |
timeout | N | int | 120 | Maximum run time in seconds. A non-positive value falls back to 120. On timeout, the entire child process group is terminated. |
max_bytes | N | int | 0 | Cap on captured output in bytes. 0 means unbounded. |
emit_on_error | N | boolean | false | When true, a non-zero exit code still emits the captured stdout. A timeout or a failure to start never emits, regardless of this setting. |
execution_policy_bypass | N | boolean | false | Windows ps1 only. Adds -ExecutionPolicy Bypass to the PowerShell invocation. |
cron | N | string | — | Per-input schedule (cron expression). An empty value or "0" runs the script on every collection cycle. |
max_retries | N | int | 1 | Number of times a failed run is retried on subsequent collection cycles. |
skippable | N | boolean | true | When true, missed schedule slots collapse into a single run. When false, each missed slot is replayed. |
pipeline_name | N | string | — | Route the output to a specific preprocessing pipeline by name. |
ignore_time | N | boolean | true | Skip time-based filtering on the emitted events. |
Output
Captured stdout is converted to log events one line at a time:
- Trailing line terminators are trimmed once; if nothing remains, no events are emitted (an empty or whitespace-only run produces nothing).
- The remaining output is split on newlines, producing one event per line. A trailing carriage return on each line is stripped, so CRLF output is handled.
- Interior blank lines are preserved; only trailing blank lines from a final newline are dropped.
stderris never emitted as events. The exit code is logged and gatesemit_on_error.
Example
Running a health-check shell script every five minutes and routing its output to a pipeline... | |
Each line of standard output becomes a separate log event... | |
File Log Collection
The linux_file_log_collector collects lines from arbitrary log files on Linux hosts. It supports glob path expansion, lookback-based backfill, multiline parsing, include/exclude filtering, character-set decoding, and per-pipeline routing. The path syntax uses Linux-style paths (e.g. /var/log/myapp/*.log).
File log datasets can be created through the dataset creation wizard (Linux File Logs) or configured via device YAML files under config/devices/ using the schema below.
Device-level property
| Field | Required | Type | Default | Description |
|---|---|---|---|---|
file_log_concurrency | N | int | 8 | Maximum number of inputs processed in parallel per device. A zero or negative value resolves to 8. |
Input properties
Each entry under inputs: defines one file log source. Inputs share the standard dataset input frame (id, name, status) plus the following properties:
| Field | Required | Type | Default | Description |
|---|---|---|---|---|
path | Y | string | — | File path or glob pattern. Supports wildcards (e.g. /var/log/myapp/*.log, C:\Logs\*\app-*.log). |
start_date | N | int | 300 | Lookback window in seconds: only files modified within this window are read. A negative value (e.g. -1) disables time-based filtering. 0 is not a way to narrow the window — it resolves to the 300 default. |
ignore_cache | N | boolean | false | Skip the persisted file-position cache (re-read from the start). |
ignore_old_date | N | boolean | false | Skip old-date filtering. |
ignore_retention | N | boolean | false | Skip retention filtering. |
ignore_time | N | boolean | false | Skip time-based filtering. |
date_format | N | string | — | Custom timestamp layout using Java-style tokens (e.g. yyyy-MM-dd HH:mm:ss). Used to extract an event timestamp from each line. |
line_parser | N | object | string | — | Multiline detection rules. See Line parser. |
filter_mode | N | string | exclude | include or exclude. Synonyms: inclusive/allow (include), exclusive/deny (exclude). |
filter_rules | N | array | — | Include/exclude rules. See Filter rules. Alias: filters. |
encoding | N | string | int | — | Character encoding for the file. Accepts an alias (e.g. utf-8, windows-1252) or a numeric decoder ID. See Encoding aliases. |
pipeline_name | N | string | — | Route matched lines to a specific preprocessing pipeline by name. |
Line parser
line_parser controls how multi-line log entries are reassembled. It accepts either an object or a bare string shorthand.
Accepted type values:
| Value | Aliases | Behavior |
|---|---|---|
regex | 1 | A regex pattern detects where a new entry begins. |
newline | new_line, 2 | Each raw line is a separate entry. |
string | prefix, 3 | Lines beginning with a literal string mark a new entry. |
Object fields:
| Field | Required | Type | Description |
|---|---|---|---|
type | N | string | int | One of the values above. If omitted and regex is set, regex is assumed. |
regex | N | string | Pattern used by regex, or the literal prefix used by string/prefix. Compiled with Go's RE2 engine, which does not support lookarounds or backreferences. |
value | N | string | Alias for regex. |
date_based | N | boolean | Merge continuation lines using date boundaries detected via date_format. |
has_space | N | boolean | Treat leading whitespace on a line as a continuation of the previous entry. |
A bare string at line_parser: is treated as type: regex with that pattern:
line_parser: '^\d{4}-\d{2}-\d{2}'
Filter rules
filter_rules is an array of include/exclude rules applied to the content of each record, after line parsing. The effect of each match (keep or drop) is determined by filter_mode. These rules select content; the files themselves are selected by path.
Each rule accepts:
| Field | Required | Type | Description |
|---|---|---|---|
type | N | string | int | regex (1) or string (2). If omitted, inferred from which field is set. |
regex | N | string | Regex pattern matched against the record. Compiled with a .NET-compatible engine, so lookarounds and backreferences are available — unlike line_parser.regex, which uses RE2. |
source | N | string | Literal text matched against the record, with optional leading and trailing wildcards. Not a file path — use path to select files. |
value | N | string | Alias for source. |
A bare array of regex strings is also accepted and is equivalent to type: regex for each entry.
A string rule matches its text literally: regex metacharacters carry no special meaning, so *[error]* looks for the six characters [error] rather than a character class. Wildcards are positional and only recognized at the ends:
source | Matches a record that |
|---|---|
*text* | contains text |
text* | starts with text |
*text | ends with text |
text | contains text |
An interior * is matched as a literal asterisk and reported in the Console Logs — use type: regex for pattern matching. A source that is empty once its wildcards are removed matches nothing.
A rule the reader cannot use — an invalid regex, or a string rule with an empty literal — is reported and then discounted. When no rule in the set is usable, filtering is inactive and no record is dropped, including under filter_mode: include.
Encoding aliases
encoding accepts a numeric decoder ID or one of the following aliases. Dashes, underscores, dots, and spaces are ignored during alias lookup, so utf-8, utf_8, and UTF 8 all resolve identically.
| Alias(es) | ID |
|---|---|
utf8 | 1 |
utf8bom | 2 |
utf16be | 3 |
utf16le | 4 |
utf16bebom | 5 |
utf16lebom | 6 |
gbk | 11 |
latin1, iso88591 | 15 |
windows1250, cp1250 | 50 |
windows1251, cp1251 | 51 |
windows1252, cp1252 | 52 |
windows1256, cp1256 | 56 |
The EBCDIC code pages (IDs 40--42) end lines with NEL (0x15), not LF, so they are not split into lines correctly. No alias maps to them.
Earlier versions accepted encoding but did not apply it to plain-text log files, which were read as raw bytes. A UTF-16 or code-page source therefore arrived garbled. If you compensated downstream, for example with a processor that strips NUL bytes or re-encodes the text, remove that workaround when you upgrade. The file is now decoded correctly, and the workaround will corrupt the correctly decoded text.
Example
Collecting a rotating application log on Linux with regex-based multiline detection and an include filter for errors and warnings... | |
Linux Metrics
The linux_metrics_collector samples the host's performance on the agent at a fixed interval: CPU, memory, swap, volumes, block devices, network interfaces, and the busiest processes. It reads them from /proc, df, and ps.
Linux Metrics datasets can be created through the dataset creation wizard (Linux Metrics, under the Linux category) or configured via device YAML files under config/devices/. Like every dataset on this page, it runs only on Linux devices with the VirtualMetric Agent, not on devices collecting agentless over SSH.
Wizard fields
The
| Field | Required | Behavior |
|---|---|---|
| N | Leave empty to read every 60 seconds. At least 10. | |
| Y | At least one part must be ticked. All seven are ticked by default, and with every part ticked, all of them are read. | |
| N | The pipeline the dataset's records enter, as on every dataset. |
The wizard writes interval only when one is entered, and items only when a part is left out. An untouched dataset therefore follows the agent's defaults.
Properties
| Field | Required | Type | Default | Description |
|---|---|---|---|---|
interval | N | int | 60 | Seconds between readings. At least 10. A restart or a failover keeps the schedule: the next reading is due one interval after the last. The rate baseline is not kept, so the rate parts start again with the second reading. |
items | N | string[] | every part | The parts to read, as listed below. |
pipeline_name | N | string | — | Route the dataset's records to a specific preprocessing pipeline by name. |
| Part | Console label | One document per |
|---|---|---|
cpu | reading | |
memory | reading | |
swap | reading | |
filesystem | volume | |
diskio | block device | |
network | network interface | |
processes | busy process |
The busiest processes are the 25 that use the most CPU and the 25 with the most resident memory.
Most of what the kernel reports are counters since boot, so a rate is measured between two readings. The first reading after the agent starts, or after a part is added to items, has nothing to measure against: it writes only the gauges (memory, swap, and filesystem). The rate parts (cpu, diskio, network, and processes) start with the second reading, one interval later. A disk, interface, or process that appears between two readings is measured from the next one.
Output
Each reading writes ECS metric documents with event.dataset set to linux.<part> — for example linux.cpu or linux.network.
Example
Reading every part except the busiest processes, every 30 seconds... | |
Suricata Stats
The linux_suricata_stats_collector reads the engine counters of a Suricata IDS/IPS sensor running on the host:
- packets captured and dropped;
- the decoder, flow, TCP, defrag, and app-layer counters;
- alerts;
- memory in use.
On its interval the agent asks Suricata's command socket for dump-counters. It writes one ECS metric document for the engine's totals and one for each Suricata thread: the workers (W#01-eth0, ...), the flow manager (FM#01), and Global, which holds the counters no thread owns.
This dataset is configured via device YAML files under config/devices/. Like every dataset on this page, it runs only on Linux devices with the VirtualMetric Agent. One Suricata sensor is read per host: if a device is assigned more than one dataset of this type, only the first is read.
Sensor setup
Nothing has to be set up on the sensor. The dataset relies on two Suricata defaults in suricata.yaml:
unix-command:
enabled: auto # packaged Suricata puts the socket at /var/run/suricata/suricata-command.socket
stats:
enabled: yes
Suricata creates the socket with mode 0660, in a directory it creates with mode 0750, both owned by the user Suricata runs as. The agent's user must be that user, root, or a member of that user's group.
Properties
| Field | Required | Type | Default | Description |
|---|---|---|---|---|
socket | N | string | /var/run/suricata/suricata-command.socket | The command socket. Set it whenever the sensor's socket is elsewhere: when unix-command.filename is set in suricata.yaml, or when Suricata was built with a different state directory — a source build with the default prefix uses /usr/local/var/run/suricata/suricata-command.socket. |
timeout | N | int | 10 | Seconds one reading may take, connecting included. At most 60. |
interval | N | int | 60 | Seconds between readings. At least 10, as for every Linux metrics dataset; a smaller value falls back to the default. |
pipeline_name | N | string | — | Route the dataset's records to a specific preprocessing pipeline by name. |
Output
Every document carries definition id 16150 and event.dataset linux.suricata_stats, with the same event.* and host.* fields as the host's other metrics documents.
linux.suricata_stats.threadistotalfor the totals document and the thread's name otherwise.- The counters sit under
linux.suricata_statsby Suricata's own names — for examplelinux.suricata_stats.capture.kernel_packets,linux.suricata_stats.decoder.pkts,linux.suricata_stats.detect.alert, andlinux.suricata_stats.flow.memuse. - The totals document also has
linux.suricata_stats.uptime, in seconds.
Most counters count from Suricata's start; some are current figures, such as flow.memuse and tcp.memuse. The socket does not say which is which, so a rate is a query's or a pipeline's job. This differs from the host metrics datasets, which write a *_per_sec value beside each counter.
When the sensor cannot be read, the reading writes nothing, logs why, and is retried after the interval. The causes are no Suricata on the host, the command socket turned off, stats are disabled in the config, or stats not yet synchronized just after Suricata starts.
Suricata's EVE events (alerts, flows, DNS, HTTP, TLS) are logs, not counters. Collect them with a file log dataset on eve.json, which is read as JSON lines.
Example
Reading the counters of the host's Suricata sensor every 60 seconds from its default command socket... | |
WireGuard
The linux_wireguard_interface_collector and linux_wireguard_peer_collector read the WireGuard interfaces on the host and their peers, as wg show does — what Telegraf's wireguard input reports. WireGuard logs almost nothing by design: which peer connected from where, and when it last shook hands, is known only by asking the interface. These datasets ask it on an interval and write the answer.
The agent reads the kernel's own interfaces and those of a userspace implementation, such as wireguard-go or boringtun. An interface and a peer are two schemas, so they are two datasets. A device may be assigned either or both, and the two read the host in one listing when they are due together.
WireGuard datasets can be created through the dataset creation wizard (Linux WireGuard Interfaces and Linux WireGuard Peers, under the Linux category) or configured via device YAML files under config/devices/. Like every dataset on this page, they run only on Linux devices with the VirtualMetric Agent. Windows and macOS have WireGuard datasets of their own; Solaris and AIX have none.
| Dataset | Collector | event.dataset | Definition id | One record per |
|---|---|---|---|---|
linux_wireguard_interface_collector | linux.wireguard_interface | 20150 | interface | |
linux_wireguard_peer_collector | linux.wireguard_peer | 20151 | peer of each interface |
The agent has to be allowed to administer the network (CAP_NET_ADMIN), which it is when it runs as root. An agent that is not allowed is told operation not permitted: the datasets write nothing for that reading and log why. A host without WireGuard, or with no interface, writes nothing, and that is no error.
Wizard fields
The
| Field | Required | Behavior |
|---|---|---|
| N | Leave empty to read every 60 seconds. At least 10. | |
| N | The pipeline the dataset's records enter, as on every dataset. |
Below them, the
Properties
Both datasets take the same properties:
| Field | Required | Type | Default | Description |
|---|---|---|---|---|
interval | N | int | 60 | Seconds between readings. At least 10, as for every Linux metrics dataset. |
filter | N | object | — | Which interfaces it reads, by their names, under the interface scope the network interface datasets also use: filter.interface.include and filter.interface.exclude. With none, it reads every interface. The Peers dataset reads the peers of the interfaces its own filter keeps, and may follow a Linux WireGuard Interfaces dataset's filter instead. |
pipeline_name | N | string | — | Route the dataset's records to a specific preprocessing pipeline by name. |
A listing is given 10 seconds. The kernel answers at once, but a userspace implementation that does not answer holds a listing for as long as it likes: one that outlives its 10 seconds is left to end, and no other is started until it has.
Output
Every document carries the same event.* and host.* fields as the host's other metrics documents, with event.kind metric and event.category network.
Linux WireGuard Interfaces writes one document per interface, in the order of their names. Its fields are under linux.wireguard_interface:
| Field | Description |
|---|---|
name | The interface's name, such as wg0. |
type | Where the interface runs: linux_kernel for the kernel's own, userspace for an implementation such as wireguard-go or boringtun. |
public_key | The interface's public key. Left out for an interface that has no key yet. |
listen_port | The UDP port it listens on, 0 when it has none. |
firewall_mark | Its firewall mark, 0 when it has none. |
peer_count | How many peers it has. |
received_bytes, sent_bytes | Its peers' received_bytes and sent_bytes, summed: WireGuard counts per peer. |
received_bytes_per_sec, sent_bytes_per_sec | What was received and sent per second since the dataset's last delivered reading. See the rates below. |
Linux WireGuard Peers writes one document per peer of each interface, in the order of the interfaces' names and of the peers' public keys. Its fields are under linux.wireguard_peer:
| Field | Description |
|---|---|
interface | The name of the interface the peer belongs to. |
public_key | The peer's public key. |
allowed_ips | The addresses the peer may send from, as a list of CIDR ranges. |
endpoint | Where the peer was last heard from, or where it is configured to be, as address:port. Left out for a peer never heard from and configured nowhere. |
last_handshake | When the last handshake was made, in UTC. |
seconds_since_handshake | How long before the reading the last handshake was made. |
received_bytes, sent_bytes | The bytes received from the peer and sent to it since the interface came up. |
received_bytes_per_sec, sent_bytes_per_sec | What was received from the peer and sent to it per second since the dataset's last delivered reading. See the rates below. |
persistent_keepalive | The keepalive interval in seconds, 0 when none is sent. |
protocol_version | The WireGuard protocol version. Left out when the implementation does not say it. |
The endpoint is also the document's source.address, source.ip, and source.port, with network.transport udp. A peer that roams answers from another address in the next reading, so its endpoint and source change.
last_handshake and seconds_since_handshake are left out for a peer no handshake was made with since the interface came up. WireGuard shakes hands again every two minutes or so while a tunnel carries traffic, so a peer whose handshake is older than a few minutes is idle or gone.
The kernel answers an interface's private key and a peer's preshared key to whoever may ask for an interface. The agent leaves both behind: no document holds either.
received_bytes and sent_bytes count from when the interface came up. received_bytes_per_sec and sent_bytes_per_sec are what was received and sent since the dataset's last delivered reading, per second, to two decimals; none on a first reading, for a new interface or peer, or for a counter that went back.
Migrating from Telegraf
- Telegraf's
wireguardinput writes awireguard_deviceand awireguard_peermeasurement. They correspond to the Linux WireGuard Interfaces and Linux WireGuard Peers datasets here, which can be assigned separately. - The interfaces a Telegraf
wireguardinput lists indevicesare the datasets'filter.interface.include. With none, every interface is read, as in Telegraf.