Skip to content

Commit b0a2d89

Browse files
committed
sources: started to add the missing common source options
Signed-off-by: Hofi <[email protected]>
1 parent 8eed7ee commit b0a2d89

File tree

13 files changed

+114
-52
lines changed

13 files changed

+114
-52
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## chain-hostname()
2+
3+
| Type:| `yes`, `no`|
4+
|Default:| `no`|
5+
6+
*Description:* This option can be used to enable or disable the chained hostname format. For more information, see the chain-hostnames() global option.
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1+
## default-level()
2+
3+
This is just an alias of default-priority().
4+
15
## default-priority()
26

37
| Type:| priority string |
48
| Default: | {{ page.priority_default | default: '' }} |
59

6-
*Description:* This parameter assigns an emergency level to the messages
7-
received from the {{ page.src | default: 'file' }} source if the message does not specify one. For
8-
example, default-priority(warning).
10+
*Description:* This option defines the default level value if the `PRIORITY` entry does not exist in the msg received from the {{ page.src | default: 'file' }} source.
11+
For example, `default-priority(warning)`.
12+
13+
## default-severity()
14+
15+
This is just an alias of default-priority().
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## dns-cache()
2+
3+
| Type:| `yes`, `no`|
4+
|Default:| `no`|
5+
6+
*Description:* This option enables or disables the DNS cache usage.

_includes/doc/admin-guide/options/source-normalize-hostnames.md renamed to _includes/doc/admin-guide/options/normalize-hostnames.md

File renamed without changes.

doc/_admin-guide/060_Sources/010_Internal/000_Internal_options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The internal() driver has the following options:
1414

1515
{% include doc/admin-guide/options/log-iw-size.md %}
1616

17-
{% include doc/admin-guide/options/source-normalize-hostnames.md %}
17+
{% include doc/admin-guide/options/normalize-hostnames.md %}
1818

1919
{% include doc/admin-guide/options/program-override.md %}
2020

doc/_admin-guide/060_Sources/020_File/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ source s_tail {
4848

4949
**NOTE:** If the message does not have a proper syslog header, syslog-ng
5050
treats messages received from files as sent by the kern facility. Use
51-
the **default-facility()** and **default-priority()** options in the
51+
the default-facility() and default-priority() options in the
5252
source definition to assign a different facility if needed.
5353
{: .notice--info}

doc/_admin-guide/060_Sources/021_Wildcard-file/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Note the following important points:
5050

5151
- If the message does not have a proper syslog header, {{ site.product.short_name }}
5252
treats messages received from files as sent by the user facility.
53-
Use the **default-facility()** and **default-priority()** options in
53+
Use the default-facility() and default-priority() options in
5454
the source definition to assign a different facility if needed.
5555

5656
- For every message that {{ site.product.short_name }} reads from the source files,

doc/_admin-guide/060_Sources/038_Kafka/001_Kafka_options.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: "Options of the kafka() source"
33
id: adm-src-kafka-opt
4+
src: kafka
45
description: >-
56
This section describes the options of the kafka() source in {{ site.product.short_name }}.
67
---
@@ -13,18 +14,32 @@ To use the kafka() source, the following two options are required: bootstrap-ser
1314

1415
{% include doc/admin-guide/options/bootstrap-servers.md %}
1516

17+
{% include doc/admin-guide/options/chain-hostname.md %}
18+
1619
{% include doc/admin-guide/options/config-kafka.md kafka_type='consumer' type='source' protected_options='`bootstrap.servers` `metadata.broker.list` `enable.auto.offset.store` `auto.offset.reset` `enable.auto.commit` `auto.commit.enable`' %}
1720

21+
{% include doc/admin-guide/options/default-facility.md %}
22+
23+
{% include doc/admin-guide/options/default-priority.md %}
24+
1825
{% include doc/admin-guide/options/disable-bookmarks.md %}
1926
See Bookmarking in the kafka() source for more details.
2027

28+
{% include doc/admin-guide/options/dns-cache.md %}
29+
2130
{% include doc/admin-guide/options/hook.md %}
2231

32+
{% include doc/admin-guide/options/host-override.md %}
33+
2334
{% include doc/admin-guide/options/ignore-saved-bookmarks.md %} (depending on the setting of the read-old-records() option.\
2435
See Bookmarking in the kafka() source for more details.
2536

2637
{% include doc/admin-guide/options/kafka-logging.md %}
2738

39+
{% include doc/admin-guide/options/keep-hostname.md %}
40+
41+
{% include doc/admin-guide/options/keep-timestamp.md %}
42+
2843
## log-fetch-limit()
2944

3045
| Type: | integer |
@@ -60,6 +75,8 @@ For example, with `workers(3)` and `fetch-limit(100000)`, the 2 processor worker
6075

6176
*Description:* When the main worker reaches the queued message limit defined by fetch-limit(), the kafka() source temporarily stops retrieving messages from the broker. It then waits for the duration specified by `fetch-queue-full-delay()` before attempting to fetch additional messages.
6277

78+
{% include doc/admin-guide/options/normalize-hostnames.md %}
79+
6380
{% include doc/admin-guide/options/persist-name.md %}
6481

6582
## persist-store()
@@ -78,9 +95,13 @@ For more details, see Bookmarking in the kafka() source.
7895

7996
*Description:* Specifies the maximum amount of time {{ site.product.short_name }} waits during a Kafka broker poll request for new messages to become available.
8097

98+
{% include doc/admin-guide/options/program-override.md %}\
99+
81100
{% include doc/admin-guide/options/read-old-records.md %}\
82101
See Bookmarking in the kafka() source for more details.
83102

103+
<!-- {% include doc/admin-guide/options/sdata-prefix.md %} -->
104+
84105
## single-worker-queue()
85106

86107
| Type: | yes \| no |
@@ -121,13 +142,17 @@ Why is it worth using dual consumer strategies? describes the differences betwee
121142

122143
For details on how the resulting topic names, partitions, and Kafka assign/subscribe strategies are determined in different scenarios, see the Basic strategy usage cross-reference of the different topic configuration cases ; for information on how the resulting strategy participates in offset storing and bookmarking, refer to Bookmarking in the kafka() source.
123144

145+
{% include doc/admin-guide/options/tags.md %}
146+
124147
## time-reopen()
125148

126149
| Type: | integer in seconds |
127150
| Default:| 60 |
128151

129152
*Description:* The time {{ site.product.short_name }} waits between attempts to recover from errors that require re-initialization of the full kafka connection and its internally used data structures.
130153

154+
{% include doc/admin-guide/options/time-zone.md %}
155+
131156
## topic()
132157

133158
| Type: | key-value pairs |
@@ -158,6 +183,10 @@ The partition number must be:
158183

159184
For details about how the resulting topic names, partitions, and Kafka assign/subscribe strategies are determined in different scenarios, see Basic startegy usage cross-reference of the different topic configuration cases and Why is it worth using dual consumer strategies?
160185

186+
{% include doc/admin-guide/options/use-dns.md %}
187+
188+
{% include doc/admin-guide/options/use-fqdn.md %}
189+
161190
## workers()
162191

163192
| Type: | integer |

doc/_admin-guide/060_Sources/038_Kafka/README.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@ no regexp-related characters) and only positive partition numbers are specified.
2222

2323
## Basic startegy usage cross-reference of the different topic configuration cases
2424

25-
| topic(...) in config | topic name(s) | part. number(s) | strategy-hint() | resulting strategy |
25+
| topic(...) | topic name(s) | part. number(s) | strategy-hint() | resulting strategy |
2626
|-------------------------------------------------------|----------------------------|-----------------|-----------------|--------------------|
2727
| topic( "topic-name-1" => "1" } | topic-name-1 | 1 | assign | assign |
2828
| topic( "topic-name-1" => "1" } | topic-name-1 | 1 | subscribe | subscribe |
2929
| topic( "topic-name-1" => "1,2" } | topic-name-1 | 1-2 | assign | assign |
30-
| topic( "topic-name-1" => "1,2" } | topic-name-1 | 1-2 | subscribe | N/A (error) |
30+
| topic( "topic-name-1" => "1,2" } | topic-name-1 | N/A | subscribe | N/A (error) |
3131
| topic( "topic-name-1" => "1" "topic-name-1" => "2" } | topic-name-1 | 1-2 | assign | assign |
32-
| topic( "topic-name-1" => "1" "topic-name-1" => "2" } | topic-name-1 | 1-2 | subscribe | N/A (error) |
32+
| topic( "topic-name-1" => "1" "topic-name-1" => "2" } | topic-name-1 | N/A | subscribe | N/A (error) |
3333
| topic( "topic-name-1" => "1" "topic-name-3" => "2" } | topic-name-1, topic-name-3 | 1, 2 | assign | assign |
3434
| topic( "topic-name-1" => "1" "topic-name-3" => "2" } | topic-name-1, topic-name-3 | 1, 2 | subscribe | subscribe |
3535
| topic( "topic-name-1" => "-1" } | topic-name-1 | all | assign | subscribe |
3636
| topic( "topic-name-1" => "-1" } | topic-name-1 | all | subscribe | subscribe |
37-
| topic( "topic-name-1" => "1" "topic-name-3" => "-1" } | topic-name-1, topic-name-3 | 1, all | assign | subscribe |
38-
| topic( "topic-name-1" => "1" "topic-name-3" => "-1" } | topic-name-1, topic-name-3 | 1, all | subscribe | subscribe |
39-
| topic( "topic-name-3" => "1" "topic-name-3" => "-1" } | topic-name-1, topic-name-3 | 1, all | assign | subscribe |
40-
| topic( "topic-name-3" => "1" "topic-name-3" => "-1" } | topic-name-1, topic-name-3 | 1, all | subscribe | subscribe |
41-
| topic( "^topic-name-[13]$" => "2" } | topic-name-1, topic-name-3 | 2, 2 | assign | subscribe |
42-
| topic( "^topic-name-[13]$" => "2" } | topic-name-1, topic-name-3 | 2, 2 | subscribe | subscribe |
37+
| topic( "topic-name-1" => "1" "topic-name-3" => "-1" } | topic-name-1, topic-name-3 | all, all | assign | subscribe |
38+
| topic( "topic-name-1" => "1" "topic-name-3" => "-1" } | topic-name-1, topic-name-3 | all, all | subscribe | subscribe |
39+
| topic( "topic-name-3" => "1" "topic-name-3" => "-1" } | topic-name-3 | N/A | assign | N/A (error) |
40+
| topic( "topic-name-3" => "1" "topic-name-3" => "-1" } | topic-name-3 | N/A | subscribe | N/A (error) |
41+
| topic( "^topic-name-[13]$" => "2" } | topic-name-1, topic-name-3 | N/A | assign | N/A (error) |
42+
| topic( "^topic-name-[13]$" => "2" } | topic-name-1, topic-name-3 | N/A | subscribe | N/A (error) |
4343
| topic( "^topic-name-[13]$" => "-1" } | topic-name-1, topic-name-3 | all, all | assign | subscribe |
4444
| topic( "^topic-name-[13]$" => "-1" } | topic-name-1, topic-name-3 | all, all | subscribe | subscribe |
4545

@@ -60,9 +60,24 @@ Using both consumer strategies — `assign` and `subscribe` — provides the fle
6060

6161
By supporting both approaches, {{ site.product.short_name }} can be used effectively in a variety of Kafka consumption models — from tightly controlled, partition-specific pipelines to dynamic and scalable consumer setups that evolve with the broker configuration.
6262

63+
For more details about Kafka consumer types and rebalancing, refer to the librdkafka documentation.
64+
6365
## Bookmarking in the kafka() source
6466

65-
By default, {{ site.product.short_name }} stores the offset of the last read message of each topic it consumes in its own persist file. This can be disabled using the disable-bookmarks() option. Automatic offset restoration takes effect at startup or reload, based on the saved offset value and the ignore-saved-bookmarks() and read-old-record() settings. If ignore-saved-bookmarks() is set to `yes`, it will not use the saved offset. Instead, if read-old-record() is set to `yes`, it will start fetching from the oldest available message, otherwise it will start from the newest one.
67+
Where to store the information about the latest consumed Kafka partition offsets can be controlled via the persist-store() option. By default, {{ site.product.short_name }} stores the offset of the last read message of each topic and partition it consumes in its own persist file. Storing this information altogether can be disabled using the disable-bookmarks() option. Automatic offset restoration takes effect at startup or reload, based on the saved offset value and the ignore-saved-bookmarks() and read-old-records() settings. If ignore-saved-bookmarks() is set to `yes`, it will not use the saved offset. Instead, if read-old-records() is set to `yes`, it will start fetching from the oldest available message; otherwise, it will start from the newest one.\
68+
69+
In most cases, you will want to use the `local` storage option, but you can also store the bookmarks remotely on the Kafka side partitions by setting the persist-store() option to `remote`. The only case where using remote-side storage is worth it is when you have multiple kafka() clients consuming the same partitions and using the same consumer group `group.id` in your config(). In this case, you **must use** `remote`; otherwise, you risk data loss and significant message duplication. For all other cases, use the `local` storage option instead.
70+
71+
Usage examples:
72+
73+
| resulting strategy | persist-store() | config( "group.id" ... ) | notes |
74+
|--------------------|-----------------|-----------------------------------------------------------------------------------|-|
75+
| assign | local | not used | |
76+
| assign | remote | used for remote Kafka offset restoration, auto-generated if empty | even if clients use the same "group.id", they are isolated and will NOT participate in Kafka rebalancing |
77+
| subscribe | local | not used and will be overridden if not empty | because of the `local` offset storage option, the user-provided "group.id" will be replaced by a self-generated one to prevent clients with the same "group.id" from participating in Kafka rebalancing; otherwise, inconsistent offsets might be provided by the Kafka broker |
78+
| subscribe | remote | used for remote Kafka offset restoration and rebalancing, auto-generated if empty | clients with the same "group.id" will participate in Kafka rebalancing |
79+
80+
For more details about Kafka consumer types and rebalancing, refer to the librdkafka documentation.
6681

6782
## Multiple workers in the kafka() source
6883

doc/_admin-guide/060_Sources/085_macOS/000_darwin_oslog_options.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,23 @@ description: >-
1010

1111
The `darwin-oslog()` source has the following options.
1212

13+
{% include doc/admin-guide/options/chain-hostname.md %}
14+
15+
{% include doc/admin-guide/options/default-facility.md %}
16+
17+
{% include doc/admin-guide/options/default-priority.md %}
18+
19+
{% include doc/admin-guide/options/disable-bookmarks.md %}
20+
21+
{% include doc/admin-guide/options/dns-cache.md %}
22+
1323
## filter-predicate()
1424

1525
|Type:| string|
1626
|Default:|`(eventType == 'logEvent' || eventType == 'lossEvent' || eventType == 'stateEvent' || eventType == 'userActionEvent') && (logType != 'debug')`|
1727

1828
*Description:* String for native macOS log message filtering using predicates. For example, the following predicate selects AirDrop logs: `subsystem=="com.apple.sharing" and category=="AirDrop"`
1929

20-
{% include doc/admin-guide/options/disable-bookmarks.md %}
21-
2230
## go-reverse()
2331

2432
|Type:| boolean|
@@ -28,10 +36,18 @@ The `darwin-oslog()` source has the following options.
2836

2937
{% include doc/admin-guide/options/hook.md %}
3038

39+
{% include doc/admin-guide/options/host-override.md %}
40+
41+
{% include doc/admin-guide/options/hook.md %}
42+
3143
{% include doc/admin-guide/options/ignore-saved-bookmarks.md %} (depending on the setting of the go-reverse() and the read-old-records() options.
3244

3345
{% include doc/admin-guide/options/deprecated-options.md old='do-not-use-bookmark()' new='ignore-saved-bookmarks()' %}
3446

47+
{% include doc/admin-guide/options/keep-hostname.md %}
48+
49+
{% include doc/admin-guide/options/keep-timestamp.md %}
50+
3551
{% include doc/admin-guide/options/log-fetch-delays.md %}
3652

3753
{% include doc/admin-guide/options/log-fetch-limit.md %}
@@ -43,4 +59,15 @@ The `darwin-oslog()` source has the following options.
4359

4460
*Description:* The maximum distance in seconds that a bookmark can point backward. That is, if {{ site.product.short_name }} is stopped for 10 minutes (600 seconds) and `max-bookmark-distance()` is set to `60`, then {{ site.product.short_name }} starts reading the logs from 60 seconds before the startup, missing 9 minutes (540 seconds) worth of logs.
4561

62+
{% include doc/admin-guide/options/program-override.md %}
63+
4664
{% include doc/admin-guide/options/read-old-records.md %}
65+
66+
{% include doc/admin-guide/options/tags.md %}
67+
68+
{% include doc/admin-guide/options/time-zone.md %}
69+
70+
{% include doc/admin-guide/options/use-dns.md %}
71+
72+
{% include doc/admin-guide/options/use-fqdn.md %}
73+

0 commit comments

Comments
 (0)