Skip to content

Commit 1390145

Browse files
kalleepgrafana-alloybot[bot]
authored andcommitted
docs: Fix broken listener table and format using prettier (#5972)
This page is broken on the latest version <img width="1424" height="603" alt="2026-04-02-09:09:37" src="https://github.com/user-attachments/assets/cffecbf4-4e60-4034-b16d-01d01892e7a0" /> (cherry picked from commit fc2f5b1)
1 parent a9e01e7 commit 1390145

1 file changed

Lines changed: 49 additions & 48 deletions

File tree

docs/sources/reference/components/loki/loki.source.syslog.md

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ If your messages aren't RFC5424 compliant, you can use `raw` syslog format in co
2222
Please note, that the `raw` syslog format is an [experimental][] feature.
2323

2424
[experimental]: https://grafana.com/docs/release-life-cycle/
25+
2526
{{< /admonition >}}
2627

2728
The component starts a new syslog listener for each of the given `config` blocks and fans out incoming entries to the list of receivers in `forward_to`.
@@ -46,27 +47,27 @@ loki.source.syslog "<LABEL>" {
4647
You can use the following arguments with `loki.source.syslog`:
4748

4849
| Name | Type | Description | Default | Required |
49-
|-----------------|----------------------|-------------------------------------------|---------|----------|
50+
| --------------- | -------------------- | ----------------------------------------- | ------- | -------- |
5051
| `forward_to` | `list(LogsReceiver)` | List of receivers to send log entries to. | | yes |
5152
| `relabel_rules` | `RelabelRules` | Relabeling rules to apply on log entries. | `{}` | no |
5253

5354
The `relabel_rules` field can make use of the `rules` export value from a [`loki.relabel`][loki.relabel] component to apply one or more relabeling rules to log entries before they're forwarded to the list of receivers in `forward_to`.
5455

5556
`loki.source.syslog` applies the following labels to log entries from the client information if possible.
5657

57-
* `__syslog_connection_ip_address`
58-
* `__syslog_connection_hostname`
58+
- `__syslog_connection_ip_address`
59+
- `__syslog_connection_hostname`
5960

6061
`loki.source.syslog` applies the following labels to log entries if they have been parsed from the syslog message.
6162

62-
* `__syslog_message_severity`
63-
* `__syslog_message_facility`
64-
* `__syslog_message_hostname`
65-
* `__syslog_message_app_name`
66-
* `__syslog_message_proc_id`
67-
* `__syslog_message_msg_id`
68-
* `__syslog_message_msg_counter`
69-
* `__syslog_message_sequence`
63+
- `__syslog_message_severity`
64+
- `__syslog_message_facility`
65+
- `__syslog_message_hostname`
66+
- `__syslog_message_app_name`
67+
- `__syslog_message_proc_id`
68+
- `__syslog_message_msg_id`
69+
- `__syslog_message_msg_counter`
70+
- `__syslog_message_sequence`
7071

7172
If there is [RFC5424](https://www.rfc-editor.org/rfc/rfc5424) compliant structured data in the parsed message, it will be applied to the log entry as a label with prefix `__syslog_message_sd_`.
7273
For example, if the structured data provided is `[example@99999 test="value"]`, the log entry will have the label `__syslog_message_sd_example_99999_test` with a value of `value`.
@@ -91,7 +92,7 @@ loki.relabel "syslog" {
9192
You can use the following blocks with `loki.source.syslog`:
9293

9394
| Name | Description | Required |
94-
|-------------------------------------------------------------|-----------------------------------------------------------------------------|----------|
95+
| ----------------------------------------------------------- | --------------------------------------------------------------------------- | -------- |
9596
| [`listener`][listener] | Configures a listener for Syslog messages. | no |
9697
| `listener` > [`raw_format_options`][raw_format_options] | Configures `raw` syslog format behavior. | no |
9798
| `listener` > [`rfc3164_cisco_components`][cisco_components] | Configures parsing of non-standard Cisco IOS syslog extensions. | no |
@@ -112,20 +113,19 @@ The `listener` block defines the listen address and protocol where the listener
112113
The following arguments can be used to configure a `listener`.
113114
Only the `address` field is required and any omitted fields take their default values.
114115

115-
| Name | Type | Description | Default | Required |
116-
|---------------------------|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|
117-
| `address` | `string` | The `<host:port>` address to listen to for syslog messages. | | yes |
118-
| `allow_empty_rfc5424_msg` | `bool` | Whether to forward RFC5424 messages with empty MSG content. When `false`, such messages are dropped. Only applies when `syslog_format` is `rfc5424`. | `false` | no |
119-
| `idle_timeout` | `duration` | The idle timeout for TCP connections. | `"120s"` | no |
120-
| `label_structured_data` | `bool` | Whether to translate syslog structured data to Loki labels. | `false` | no |
121-
| `labels` | `map(string)` | The labels to associate with each received syslog record. | `{}` | no |
122-
123-
| `max_message_length` | `int` | The maximum limit to the length of syslog messages. | `8192` | no |
124-
| `protocol` | `string` | The protocol to listen to for syslog messages. Must be either `tcp` or `udp`. | `"tcp"` | no |
125-
| `rfc3164_default_to_current_year` | `bool` | Whether to default the incoming timestamp of an `rfc3164` message to the current year. | `false` | no |
126-
| `syslog_format` | `string` | The format for incoming messages. See [supported formats](#supported-formats). | `"rfc5424"` | no |
127-
| `use_incoming_timestamp` | `bool` | Whether to set the timestamp to the incoming syslog record timestamp. | `false` | no |
128-
| `use_rfc5424_message` | `bool` | Whether to forward the full RFC5424-formatted syslog message. | `false` | no |
116+
| Name | Type | Description | Default | Required |
117+
| --------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | -------- |
118+
| `address` | `string` | The `<host:port>` address to listen to for syslog messages. | | yes |
119+
| `idle_timeout` | `duration` | The idle timeout for TCP connections. | `"120s"` | no |
120+
| `label_structured_data` | `bool` | Whether to translate syslog structured data to Loki labels. | `false` | no |
121+
| `labels` | `map(string)` | The labels to associate with each received syslog record. | `{}` | no |
122+
| `max_message_length` | `int` | The maximum limit to the length of syslog messages. | `8192` | no |
123+
| `protocol` | `string` | The protocol to listen to for syslog messages. Must be either `tcp` or `udp`. | `"tcp"` | no |
124+
| `rfc3164_default_to_current_year` | `bool` | Whether to default the incoming timestamp of an `rfc3164` message to the current year. | `false` | no |
125+
| `rfc5424_allow_empty_msg` | `bool` | Whether to forward RFC5424 messages with empty MSG content. When `false`, such messages are dropped. Only applies when `syslog_format` is `rfc5424`. | `false` | no |
126+
| `syslog_format` | `string` | The format for incoming messages. See [supported formats](#supported-formats). | `"rfc5424"` | no |
127+
| `use_incoming_timestamp` | `bool` | Whether to set the timestamp to the incoming syslog record timestamp. | `false` | no |
128+
| `use_rfc5424_message` | `bool` | Whether to forward the full RFC5424-formatted syslog message. | `false` | no |
129129

130130
By default, the component assigns the log entry timestamp as the time it was processed.
131131

@@ -134,7 +134,7 @@ The `labels` map is applied to every message that the component reads.
134134
All header fields from the parsed RFC5424 messages are brought in as internal labels, prefixed with `__syslog_`.
135135

136136
If `label_structured_data` is set, structured data in the syslog header is also translated to internal labels in the form of `__syslog_message_sd_<ID>_<KEY>`.
137-
For example, a structured data entry of `[example@99999 test="yes"]` becomes the label `__syslog_message_sd_example_99999_test` with the value `"yes"`.
137+
For example, a structured data entry of `[example@99999 test="yes"]` becomes the label `__syslog_message_sd_example_99999_test` with the value `"yes"`.
138138

139139
The `rfc3164_default_to_current_year` argument is only relevant when `use_incoming_timestamp` is also set to `true`.
140140
`rfc3164` message timestamps don't contain a year, and this component's default behavior is to mimic Promtail behavior and leave the year as 0.
@@ -146,17 +146,17 @@ The `rfc3164_default_to_current_year`, `use_incoming_timestamp` and `use_rfc5424
146146

147147
#### Supported formats
148148

149-
* **`rfc3164`**
149+
- **`rfc3164`**
150150
A legacy syslog format, also known as BSD syslog.
151151
Example: `<34>Oct 11 22:14:15 my-server-01 sshd[1234]: Failed password for root from 192.168.1.10 port 22 ssh2`.
152152
`loki.source.syslog` drops messages with empty MSG content and increments the `loki_source_syslog_empty_messages_total` counter.
153-
* **`rfc5424`**
153+
- **`rfc5424`**
154154
A modern, structured syslog format. Uses ISO 8601 for timestamps.
155155
Example: `<165>1 2025-12-18T00:33:00Z web01 nginx - - [audit@123 id="456"] Login failed`.
156156
`loki.source.syslog` drops messages with empty MSG content by default.
157157
Set `rfc5424_allow_empty_msg` to `true` to forward them.
158158
`loki.source.syslog` increments the `loki_source_syslog_empty_messages_total` counter in both cases for debugging.
159-
* **`raw`**
159+
- **`raw`**
160160
Disables log line parsing. This format allows receiving non-RFC5424 compliant logs, such as [CEF][cef].
161161
Raw logs can be forwarded to [`loki.process`](./loki.process.md) component for parsing.
162162
`loki.source.syslog` drops messages with nil or empty body and increments the `loki_source_syslog_empty_messages_total` counter.
@@ -170,6 +170,7 @@ To enable and use an experimental feature, you must set the `stability.level` [f
170170

171171
[flag]: https://grafana.com/docs/alloy/<ALLOY_VERSION>/reference/cli/run/
172172
[experimental]: https://grafana.com/docs/release-life-cycle/
173+
173174
{{< /admonition >}}
174175

175176
### `raw_format_options`
@@ -185,35 +186,35 @@ This block can only be used when you set `syslog_format` to `raw`.
185186
The following argument is supported:
186187

187188
| Name | Type | Description | Default | Required |
188-
|---------------------------------|--------|-----------------------------------------------------------------------------|---------|----------|
189+
| ------------------------------- | ------ | --------------------------------------------------------------------------- | ------- | -------- |
189190
| `use_null_terminator_delimiter` | `bool` | Use null-terminator (`\0`) instead of line break (`\n`) to split log lines. | `false` | no |
190191

191192
### `rfc3164_cisco_components`
192193

193194
{{< docs/shared lookup="stability/experimental_feature.md" source="alloy" version="<ALLOY_VERSION>" >}}
194195

195-
The `rfc3164_cisco_components` configures parsing of non-standard Cisco IOS syslog extensions.
196+
The `rfc3164_cisco_components` configures parsing of non-standard Cisco IOS syslog extensions.
196197

197198
{{< admonition type="note" >}}
198199
This block can only be used when you set `syslog_format` to `rfc3164`.
199200
{{< /admonition >}}
200201

201202
The following arguments are supported:
202203

203-
| Name | Type | Description | Default | Required |
204-
|--------------------|--------|-------------------------------------------------|---------|----------|
205-
| `enable_all` | `bool` | Enables all components below. | `false` | no |
206-
| `message_counter` | `bool` | Enables syslog message counter field parsing. | `false` | no |
207-
| `sequence_number` | `bool` | Enables service sequence number field parsing. | `false` | no |
208-
| `hostname` | `bool` | Enables origin hostname field parsing. | `false` | no |
209-
| `second_fractions` | `bool` | Enables milliseconds parsing in timestamp field.| `false` | no |
204+
| Name | Type | Description | Default | Required |
205+
| ------------------ | ------ | ------------------------------------------------ | ------- | -------- |
206+
| `enable_all` | `bool` | Enables all components below. | `false` | no |
207+
| `message_counter` | `bool` | Enables syslog message counter field parsing. | `false` | no |
208+
| `sequence_number` | `bool` | Enables service sequence number field parsing. | `false` | no |
209+
| `hostname` | `bool` | Enables origin hostname field parsing. | `false` | no |
210+
| `second_fractions` | `bool` | Enables milliseconds parsing in timestamp field. | `false` | no |
210211

211212
{{< admonition type="note" >}}
212213
At least one option has to be enabled if `enable_all` is set to `false`.
213214
{{< /admonition >}}
214215

215216
{{< admonition type="caution" >}}
216-
The `rfc3164_cisco_components` configuration must match your Cisco device configuration.
217+
The `rfc3164_cisco_components` configuration must match your Cisco device configuration.
217218
The `loki.source.syslog` component cannot auto-detect which components are present because they share similar formats.
218219
{{< /admonition >}}
219220

@@ -240,9 +241,9 @@ ntp server <your-ntp-server>
240241

241242
#### Current Limitations
242243

243-
* **Component Ordering**: When Cisco components are selectively disabled on the device but the parser expects them, parsing will fail or produce incorrect results.
244+
- **Component Ordering**: When Cisco components are selectively disabled on the device but the parser expects them, parsing will fail or produce incorrect results.
244245
Always match your parser configuration to your device configuration.
245-
* **Structured Data**: Messages with RFC5424-style structured data blocks (from `logging host X session-id` or `sequence-num-session`) are not currently supported.
246+
- **Structured Data**: Messages with RFC5424-style structured data blocks (from `logging host X session-id` or `sequence-num-session`) are not currently supported.
246247
See the [upstream issue][go-syslog-issue] for details.
247248

248249
[go-syslog-issue]: https://github.com/leodido/go-syslog/issues/35
@@ -264,15 +265,15 @@ configuration.
264265

265266
`loki.source.syslog` exposes some debug information per syslog listener:
266267

267-
* Whether the listener is running.
268-
* The listen address.
269-
* The labels that the listener applies to incoming log entries.
268+
- Whether the listener is running.
269+
- The listen address.
270+
- The labels that the listener applies to incoming log entries.
270271

271272
## Debug metrics
272273

273-
* `loki_source_syslog_empty_messages_total` (counter): Total number of empty messages received from the syslog component.
274-
* `loki_source_syslog_entries_total` (counter): Total number of successful entries sent to the syslog component.
275-
* `loki_source_syslog_parsing_errors_total` (counter): Total number of parsing errors while receiving syslog messages.
274+
- `loki_source_syslog_empty_messages_total` (counter): Total number of empty messages received from the syslog component.
275+
- `loki_source_syslog_entries_total` (counter): Total number of successful entries sent to the syslog component.
276+
- `loki_source_syslog_parsing_errors_total` (counter): Total number of parsing errors while receiving syslog messages.
276277

277278
## Example
278279

0 commit comments

Comments
 (0)