You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Join the #plugin-systemd channel on the [Fluentd Slack](http://slack.fluentd.org
22
22
| 0.0.x |~> 0.12.0 | 2 | >= 1.9 |
23
23
24
24
* The 0.x.x series is developed from this branch (master)
25
-
* The 0.0.x series (compatible with fluentd v0.12, and td-agent 2) is developed on the [0.0.x branch](https://github.com/reevoo/fluent-plugin-systemd/tree/0.0.x)
25
+
* The 0.0.x series (compatible with fluentd v0.12, and td-agent 2) is maintained on the [0.0.x branch](https://github.com/reevoo/fluent-plugin-systemd/tree/0.0.x)
26
26
* The next version is currently under development on the [1.0.0 branch](https://github.com/reevoo/fluent-plugin-systemd/tree/1.0.0) it's progress is tracked [here](https://github.com/reevoo/fluent-plugin-systemd/issues/53)
27
27
28
28
## Installation
@@ -86,11 +86,11 @@ Configuration for a [storage plugin](http://docs.fluentd.org/v0.14/articles/stor
86
86
**`read_from_head`**
87
87
88
88
If true reads all available journal from head, otherwise starts reading from tail,
89
-
ignored if pos file exists (and is valid). Defaults to false.
89
+
ignored if cursor exists in storage (and is valid). Defaults to false.
90
90
91
91
**`entry`**
92
92
93
-
Optional configuration for an embeded systemd entry filter. See the [Filter Plugin Configuration](#filter-plugin-configuration) for config reference.
93
+
Optional configuration for an embedded systemd entry filter. See the [Filter Plugin Configuration](#filter-plugin-configuration) for config reference.
94
94
95
95
**`tag`**
96
96
@@ -166,14 +166,24 @@ The resulting entry using the above sample configuration:
166
166
167
167
## Common Issues
168
168
169
-
> ### When I look at fluentd logs, everything looks fine but no journal logs are read
169
+
> ### When I look at fluentd logs, everything looks fine but no journal logs are read ?
170
170
171
171
This is commonly caused when the user running fluentd does not have the correct permissions
172
172
to read the systemd journal.
173
173
174
174
According to the [systemd documentation](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html):
175
175
> Journal files are, by default, owned and readable by the "systemd-journal" system group but are not writable. Adding a user to this group thus enables her/him to read the journal files.
176
176
177
+
> ### How can I deal with multi-line logs ?
178
+
179
+
Ideally you want to ensure that your logs are saved to the systemd journal as a single entry regardless of how many lines they span.
180
+
181
+
It is possible for applications to naively support this (but only if they have tight integration with systemd it seems) see: https://github.com/systemd/systemd/issues/5188.
182
+
183
+
Typically you would not be able to this, so another way is to configure your logger to replace newline characters with something else. See this blog post for an example configuring a Java logging library to do this https://fabianlee.org/2018/03/09/java-collapsing-multiline-stack-traces-into-a-single-log-event-using-spring-backed-by-logback-or-log4j2/
184
+
185
+
Another strategy would be to use a plugin like [fluent-plugin-concat](https://github.com/fluent-plugins-nursery/fluent-plugin-concat) to combine multi line logs into a single event, this is more tricky though because you need to be able to identify the first and last lines of a multi line message with a regex.
0 commit comments