|
| 1 | +[role="xpack"] |
| 2 | + |
| 3 | +:type: unifiedlogs |
| 4 | + |
| 5 | +[id="{beatname_lc}-input-{type}"] |
| 6 | +=== Unified Logs input |
| 7 | + |
| 8 | +++++ |
| 9 | +<titleabbrev>Unified Logs</titleabbrev> |
| 10 | +++++ |
| 11 | + |
| 12 | +NOTE: Only available for MacOS. |
| 13 | + |
| 14 | +The unified logging system provides a comprehensive and performant API to capture |
| 15 | +telemetry across all levels of the system. This system centralizes the storage of |
| 16 | +log data in memory and on disk, rather than writing that data to a text-based log file. |
| 17 | + |
| 18 | +The input interacts with the `log` command-line tool to provide access to the events. |
| 19 | + |
| 20 | +The input starts streaming events from the current point in time unless a start date or |
| 21 | +the `backfill` options are set. When restarted it will continue where it left off. |
| 22 | + |
| 23 | +Alternatively, it can also do one off operations, such as: |
| 24 | + |
| 25 | +- Stream events contained in a `.logarchive` file. |
| 26 | +- Stream events contained in a `.tracev3` file. |
| 27 | +- Stream events in a specific time span, by providing a specific end date. |
| 28 | + |
| 29 | +After this one off operations complete, the input will stop. |
| 30 | + |
| 31 | +Other configuration options can be specified to filter what events to process. |
| 32 | + |
| 33 | +NOTE: The input can cause some duplicated events when backfilling and/or |
| 34 | +restarting. This is caused by how the underlying fetching method works and |
| 35 | +should be taken into account when using the input. |
| 36 | + |
| 37 | +Example configuration: |
| 38 | + |
| 39 | +Process all old and new logs: |
| 40 | + |
| 41 | +["source","yaml",subs="attributes"] |
| 42 | +---- |
| 43 | +{beatname_lc}.inputs: |
| 44 | +- type: unifiedlogs |
| 45 | + id: unifiedlogs-id |
| 46 | + enabled: true |
| 47 | + backfill: true |
| 48 | +---- |
| 49 | + |
| 50 | +Process logs with predicate filters: |
| 51 | + |
| 52 | +["source","yaml",subs="attributes"] |
| 53 | +---- |
| 54 | +{beatname_lc}.inputs: |
| 55 | +- type: unifiedlogs |
| 56 | + id: unifiedlogs-id |
| 57 | + enabled: true |
| 58 | + predicate: |
| 59 | + # Captures keychain.db unlock events |
| 60 | + - 'process == "loginwindow" && sender == "Security"' |
| 61 | + # Captures user login events |
| 62 | + - 'process == "logind"' |
| 63 | + # Captures command line activity run with elevated privileges |
| 64 | + - 'process == "sudo"' |
| 65 | +---- |
| 66 | + |
| 67 | +==== Configuration options |
| 68 | + |
| 69 | +The `unifiedlogs` input supports the following configuration options plus the |
| 70 | +<<{beatname_lc}-input-{type}-common-options>> described later. |
| 71 | + |
| 72 | +[float] |
| 73 | +==== `archive_file` |
| 74 | + |
| 75 | +Display events stored in the given archive. |
| 76 | +The archive must be a valid log archive bundle with the suffix `.logarchive`. |
| 77 | + |
| 78 | +[float] |
| 79 | +==== `trace_file` |
| 80 | + |
| 81 | +Display events stored in the given `.tracev3` file. |
| 82 | +In order to be decoded, the file must be contained within a valid `.logarchive` |
| 83 | + |
| 84 | +[float] |
| 85 | +==== `start` |
| 86 | + |
| 87 | +Shows content starting from the provided date. |
| 88 | +The following date/time formats are accepted: |
| 89 | +`YYYY-MM-DD`, `YYYY-MM-DD HH:MM:SS`, `YYYY-MM-DD HH:MM:SSZZZZZ`. |
| 90 | + |
| 91 | +[float] |
| 92 | +==== `end` |
| 93 | + |
| 94 | +Shows content up to the provided date. |
| 95 | +The following date/time formats are accepted: |
| 96 | +`YYYY-MM-DD`, `YYYY-MM-DD HH:MM:SS`, `YYYY-MM-DD HH:MM:SSZZZZZ`. |
| 97 | + |
| 98 | +[float] |
| 99 | +==== `predicate` |
| 100 | + |
| 101 | +Filters messages using the provided predicate based on NSPredicate. |
| 102 | +A compound predicate or multiple predicates can be provided as a list. |
| 103 | + |
| 104 | +For detailed information on the use of predicate based filtering, |
| 105 | +please refer to the https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Predicates/Articles/pSyntax.html[Predicate Programming Guide]. |
| 106 | + |
| 107 | +[float] |
| 108 | +==== `process` |
| 109 | + |
| 110 | +A list of the processes on which to operate. It accepts a PID or process name. |
| 111 | + |
| 112 | +[float] |
| 113 | +==== `source` |
| 114 | + |
| 115 | +Include symbol names and source line numbers for messages, if available. |
| 116 | +Default: `false`. |
| 117 | + |
| 118 | +[float] |
| 119 | +==== `info` |
| 120 | + |
| 121 | +Disable or enable info level messages. |
| 122 | +Default: `false`. |
| 123 | + |
| 124 | +[float] |
| 125 | +==== `debug` |
| 126 | + |
| 127 | +Disable or enable debug level messages. |
| 128 | +Default: `false`. |
| 129 | + |
| 130 | +[float] |
| 131 | +==== `backtrace` |
| 132 | + |
| 133 | +Disable or enable display of backtraces. |
| 134 | +Default: `false`. |
| 135 | + |
| 136 | +[float] |
| 137 | +==== `signpost` |
| 138 | + |
| 139 | +Disable or enable display of signposts. |
| 140 | +Default: `false`. |
| 141 | + |
| 142 | +[float] |
| 143 | +==== `unreliable` |
| 144 | + |
| 145 | +Annotate events with whether the log was emitted unreliably. |
| 146 | +Default: `false`. |
| 147 | + |
| 148 | +[float] |
| 149 | +==== `mach_continuous_time` |
| 150 | + |
| 151 | +Use mach continuous time timestamps rather than walltime. |
| 152 | +Default: `false`. |
| 153 | + |
| 154 | +[float] |
| 155 | +==== `backfill` |
| 156 | + |
| 157 | +If set to true the input will process all available logs since the beginning |
| 158 | +of time the first time it starts. |
| 159 | +Default: `false`. |
| 160 | + |
| 161 | + |
| 162 | +[id="{beatname_lc}-input-{type}-common-options"] |
| 163 | +include::../../../../filebeat/docs/inputs/input-common-options.asciidoc[] |
| 164 | + |
| 165 | +[float] |
| 166 | +=== Metrics |
| 167 | + |
| 168 | +This input exposes metrics under the <<http-endpoint, HTTP monitoring endpoint>>. |
| 169 | +These metrics are exposed under the `/inputs/` path. They can be used to |
| 170 | +observe the activity of the input. |
| 171 | + |
| 172 | +You must assign a unique `id` to the input to expose metrics. |
| 173 | + |
| 174 | +[options="header"] |
| 175 | +|======= |
| 176 | +| Metric | Description |
| 177 | +| `errors_total` | Total number of errors. |
| 178 | +|======= |
| 179 | + |
| 180 | +:type!: |
0 commit comments