Skip to content

Commit 7b83ee5

Browse files
[chore][receiver/journald]: improve README.md examples (#42692)
#### Description Add the following examples to the documentation: - Minimal configuration - Cursor tracking - Reading from the beginning <!--Describe the documentation added.--> #### Documentation This PR improves the documented examples --------- Co-authored-by: Andrzej Stencel <[email protected]>
1 parent eae8d71 commit 7b83ee5

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

receiver/journaldreceiver/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,49 @@ Each operator performs a simple responsibility, such as parsing a timestamp or J
5656
- Only parsers and general purpose operators should be used.
5757

5858
### Example Configurations
59+
#### Minimal configuration
60+
61+
The following configuration is the minimal configuration to read
62+
journald logs:
63+
64+
```yaml
65+
receivers:
66+
journald:
67+
```
68+
will be passed to journalctl as the following arguments: `journalctl
69+
... --priority info`. This will read the 10 most recent entries and
70+
any subsequent entry. `--priority info` is the default priority, the
71+
following examples will omit it for simplicity.
72+
73+
#### Cursor tracking
74+
```yaml
75+
receivers:
76+
journald:
77+
storage: file_storage/journald
78+
79+
extensions:
80+
file_storage/journald:
81+
directory: .
82+
83+
service:
84+
extensions: [file_storage/journald]
85+
```
86+
87+
If you stop and start the otel collector, only new entries will be
88+
read.
89+
90+
#### Reading from the beginning
91+
92+
```yaml
93+
receivers:
94+
journald:
95+
start_at: beginning
96+
```
97+
98+
will be passed to journalctl as the following arguments: `journalctl
99+
... --no-tail`. This will read all messages from the current boot.
100+
101+
#### Units
59102

60103
```yaml
61104
receivers:

0 commit comments

Comments
 (0)