Name: fluent-plugin-docker-format
Owner: Center for Open Science
Description: null
Forked from: bwalex/fluent-plugin-docker-format
Created: 2016-09-19 18:41:05.0
Updated: 2016-09-19 18:41:06.0
Pushed: 2016-04-06 04:58:43.0
Homepage: null
Size: 14
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This fluentd output filter plugin can parse a docker container's config.json associated with a certain log entry and add information from config.json to the record.
Add this line to your application's Gemfile:
gem 'fluent-plugin-docker-format'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fluent-plugin-docker-format
ch docker.var.lib.docker.containers.*.*.log>
pe docker_format
cker_containers_path /var/lib/docker/containers
ntainer_id ${tag_parts[5]}
g docker.all
tch>
The docker_containers_path
is optional and defaults to /var/lib/docker/containers
.
The container_id
parameter can either be a string with the id, or use the special interpolated substitution ${tag_parts[<some number>]}
. The tag parts are the dot-separated parts of the incoming tag, so that in the above example they would match the first star.
A full example:
rce>
pe tail
th /var/lib/docker/containers/*/*-json.log
s_file /var/log/fluentd-docker.pos
me_format %Y-%m-%dT%H:%M:%S
g docker.*
rmat json
urce>
ch docker.var.lib.docker.containers.*.*.log>
pe docker_format
ntainer_id ${tag_parts[5]}
g docker.${name}
tch>
The output record will have two additional fields, container_id
and container_name
.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)