Skip to content

Commit c79faea

Browse files
authored
journald: add read-old-on-error() option (#301)
2 parents 902c793 + 4ba8278 commit c79faea

2 files changed

Lines changed: 29 additions & 18 deletions

File tree

doc/_admin-guide/060_Sources/190_systemd-journal/000_systemd-journal_options.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ description: >-
1010

1111
The systemd-journal() driver has the following options:
1212

13+
{% include doc/admin-guide/options/chain-hostnames.md %}
14+
1315
{% include doc/admin-guide/options/default-facility.md %}
1416

1517
{% include doc/admin-guide/options/default-priority.md %}
@@ -22,8 +24,6 @@ The systemd-journal() driver has the following options:
2224
*Description:* The default level value if the `PRIORITY` entry does not
2325
exist.
2426

25-
{% include doc/admin-guide/options/chain-hostnames.md %}
26-
2727
{% include doc/admin-guide/options/format.md %}
2828

2929
{% include doc/admin-guide/options/hook.md %}
@@ -147,8 +147,21 @@ get a prefix (for example: ".SDATA.journald."). By default, {{ site.product.shor
147147
*Description:* If set to **yes**, {{ site.product.short_name }} will start reading the
148148
records from the beginning of the journal, if the journal has not been
149149
read yet. If set to **no**, {{ site.product.short_name }} will read only the new
150-
records. If the source has a state in the persist file, this option will
150+
records.
151+
152+
**NOTE:** If the source has a state in the persist file, this option will
151153
have no effect.
154+
{: .notice--info}
155+
156+
See read-old-on-error() for the behavior of {{ site.product.short_name }} when the source has a state in the persist file but {{ site.product.short_name }} cannot locate this position at startup.
157+
158+
## read-old-on-error()
159+
160+
| Accepted values:| yes \| no|
161+
|Default:| yes|
162+
163+
*Description:* When the source has a state in the persist file, {{ site.product.short_name }} attempts to read the journal from the last recorded position at startup.\
164+
If {{ site.product.short_name }} cannot locate this position (for example, because the journal has been rotated or cleared since the last read), this option determines whether {{ site.product.short_name }} starts reading records from the beginning of the journal or only processes new records. If set to `yes`, it reads from the beginning; otherwise, it reads only new records.
152165

153166
{% include doc/admin-guide/options/sdata-prefix.md %}
154167

doc/_admin-guide/060_Sources/190_systemd-journal/README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,41 @@ description: >-
66
The systemd-journal() source is used on various Linux distributions,
77
such as RHEL (from RHEL7) and CentOS. The systemd-journal() source
88
driver can read the structured name-value format of the journald system
9-
service, making it easier to reach the custom fields in the message. By
10-
default, {{ site.product.short_name }} adds the .journald. prefix to the name of every
11-
parsed value. For a list and description of name-value pairs that
12-
journald provides, see the documentation of journald for your platform
13-
(for example, man systemd.journal-fields).
9+
service, making it easier to reach the custom fields in the message.
1410
---
1511

1612
The systemd-journal() source driver is designed to read only local
1713
messages through the systemd-journal API. It is not possible to set the
18-
location of the journal files, or the directories.
14+
location of the journal files, or the directories.\
15+
By default, {{ site.product.short_name }} adds the `.journald.` prefix to the name of every
16+
parsed value. For a list and description of name-value pairs that
17+
journald provides, see the documentation of journald for your platform
18+
(for example, `man systemd.journal-fields`).
1919

2020
**NOTE:** The log-msg-size() option is not applicable for this source. Use
21-
the **max-field-size()** option instead.
21+
the max-field-size() option instead.
2222
{: .notice--info}
2323

2424
>**NOTE:** This source will not handle the following cases:
25-
>
25+
>
2626
- Corrupted journal file
2727
- Incorrect journal configuration
2828
- Any other journald-related bugs
2929
{: .notice--info}
3030

3131
**NOTE:** If you are using RHEL-7, the default source in the configuration
32-
is systemd-journal() instead of unix-dgram(\"/dev/log\") and
33-
file(\"/proc/kmsg\"). If you are using unix-dgram(\"/dev/log\") or
34-
unix-stream(\"/dev/log\") in your configuration as a source, {{ site.product.short_name }} will revert to using systemd-journal() instead.
32+
is systemd-journal() instead of unix-dgram("/dev/log") and
33+
file("/proc/kmsg"). If you are using unix-dgram("/dev/log") or
34+
unix-stream("/dev/log") in your configuration as a source, {{ site.product.short_name }} will revert to using systemd-journal() instead.
3535
{: .notice--info}
3636

37-
![]({{ site.baseurl}}/assets/images/caution.png) **CAUTION:**
38-
Only one systemd-journal() source can be configured in the configuration file.
37+
![]({{ site.baseurl}}/assets/images/caution.png) **CAUTION:** Only one systemd-journal() source can be configured in the configuration file.
3938
If there is more than one systemd-journal() source configured, {{ site.product.short_name }}
4039
will not start.
4140
{: .notice--warning}
4241

4342
![]({{ site.baseurl}}/assets/images/caution.png)
44-
**CAUTION:**
45-
The systemd-journal() source cannot operate under an Ubuntu 24.04 LTS (Noble Numbat) platform. For more information on supported platforms, see Supported platforms.
43+
**CAUTION:** The systemd-journal() source cannot operate under an Ubuntu 24.04 LTS (Noble Numbat) platform. For more information on supported platforms, see Supported platforms.
4644
{: .notice--warning}
4745

4846
**Declaration**

0 commit comments

Comments
 (0)