The macOS Unified Logging Receiver collects logs from macOS systems using the native log command. This receiver supports both live system logs and archived log files (.logarchive).
| Platform | Metrics | Logs | Traces |
|---|---|---|---|
| macOS (10.12+) | ✓ |
Available in the Bindplane Distro for OpenTelemetry Collector v1.87.0+ .
log command must be available in PATH..logarchive directory.| Parameter | Type | Default | Description |
|---|---|---|---|
| mode | enum |
stream | The collection mode to run the collector in. |
| format | enum |
default | The format of the logs to collect. |
| archive_path | string |
"" | The path to the .logarchive directory to collect logs from. Only applicable in archive mode. |
| predicate | predicate |
"" | The expression to use to filter logs. |
| start_time | datetime |
"" | The time to start collecting logs from. |
| end_time | datetime |
"" | The time to stop collecting logs at. Only applicable in archive mode. |
| poll_interval | int |
30 | The interval to poll for new logs in seconds. Only applicable in stream mode. |
| max_log_age | int |
24 | The maximum age of a log to collect in hours. Only applicable in stream mode. |
The receiver converts macOS logs to OpenTelemetry log records:
ndjson and json formats When using JSON formats, each log line is captured as a complete JSON string in the body, with timestamp and severity extracted:
timestamp field in the JSONmessageType (Error, Fault, Default, Info, Debug)default, syslog, and compact formats When using plain text formats, each log line is captured as plain text in the body:
Since the source passes values to the built-in log command on the agent, there are security risks in using this source if malicious code is passed in by a user. The source uses the following validation to mitigate these risks:
;|$`>>, <<&& (logical AND), <, > (comparison) are allowed.
> operator is allowed for comparisons (e.g., processID > 100) but blocked when followed by file paths.&& operator is automatically normalized to AND to prevent command chaining.|| operator is normalized to OR to prevent piping.