Skip to content

Commit 91faf3c

Browse files
committed
Adds some information about using in a Docker container
Fixes #61 Signed-off-by: Ed Robinson <[email protected]>
1 parent 9000ded commit 91faf3c

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ _Required_
9898

9999
A tag that will be added to events generated by this input.
100100

101-
### Example
102-
103-
For an example of a full working setup including the plugin, [take a look at](https://github.com/assemblyline/fluentd)
104101

105102
## Filter Plugin Configuration
106103

@@ -184,11 +181,38 @@ Typically you would not be able to this, so another way is to configure your log
184181

185182
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.
186183

184+
> ### How can I use this plugin inside of a docker container ?
185+
186+
* Install the [systemd dependencies](#dependencies) if required
187+
* You can use an [offical fluentd docker](https://github.com/fluent/fluentd-docker-image) image as a base, (choose the debian based version, as alpine linux doesn't support systemd).
188+
* Bind mount `/var/log/journal` into your container.
189+
190+
### Example
191+
192+
For an example of a full working setup including the plugin, take a look at [the fluentd kubernetes daemonset](https://github.com/fluent/fluentd-kubernetes-daemonset)
187193

188194
## Dependencies
189195

190196
This plugin depends on libsystemd
191197

198+
On Debian or Ubuntu you might need to install the libsystemd0 package:
199+
200+
```
201+
apt-get install libsystemd0
202+
```
203+
204+
On CentOS or RHEL you might need to install the systemd package:
205+
206+
```
207+
yum install -y systemd
208+
```
209+
210+
If you want to do this in a CentOS docker image you might first need to remove the `fakesystemd` package.
211+
212+
```
213+
yum remove -y fakesystemd
214+
```
215+
192216
## Running the tests
193217

194218
To run the tests with docker on several distros simply run `rake`

0 commit comments

Comments
 (0)