logstash-filter-docker_metadata 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/dockerTest.sh +0 -1
- data/lib/logstash/filters/docker_metadata.rb +9 -9
- data/logstash-filter-docker_metadata.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 000be01a06b8f7d60099cf0b4fb958cc8f4f1620
|
4
|
+
data.tar.gz: 36332effcda2cd70d8d404b1066d1d6346a337ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 926be3f80c06cf3d560775bc4122e62c52de798328931233b38f68f6f04a98d1bbdf53b1eae860806ff6f054a1d20c5e7050feb9b02cef9a5716558bad68a374
|
7
|
+
data.tar.gz: 8f906e5bb6ab7c8e9db7d3069cd8248f7d5918d09824ea727fbc7b50260cb7985e0f508d7ecb1fb4abc05cbd036bb8630fd9c987992da80748d3f420dc5fe7f2
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[](http://badge.fury.io/rb/logstash-filter-docker_metadata)
|
2
|
+
|
1
3
|
# Logstash Plugin
|
2
4
|
|
3
5
|
This is a plugin for [Logstash](https://github.com/elasticsearch/logstash).
|
@@ -56,7 +58,8 @@ Logstash output :
|
|
56
58
|
|
57
59
|
| name | default value | comment |
|
58
60
|
| :------------- | :------------- | :------------- |
|
59
|
-
| `docker_url` | `unix:///var/run/docker.sock` | make sure it match where you mount the docker socket |
|
61
|
+
| `docker_url` | `'unix:///var/run/docker.sock'` | make sure it match where you mount the docker socket |
|
62
|
+
| `field_docker_id` | `'path'` | The field from which you read the docker ID |
|
60
63
|
| `container_id_regexp` | `(\w{64})` | match the complete Id of a docker container |
|
61
64
|
| `cache_size` | 100 | |
|
62
65
|
|
@@ -126,4 +129,4 @@ It is more important to the community that you are able to contribute.
|
|
126
129
|
For more information about contributing, see the [CONTRIBUTING](https://github.com/elasticsearch/logstash/blob/master/CONTRIBUTING.md) file.
|
127
130
|
|
128
131
|
## Licence
|
129
|
-
It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
|
132
|
+
It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
|
data/dockerTest.sh
CHANGED
@@ -20,6 +20,12 @@ class LogStash::Filters::DockerMetadata < LogStash::Filters::Base
|
|
20
20
|
:required => false,
|
21
21
|
:deprecated => false
|
22
22
|
|
23
|
+
config :field_docker_id,
|
24
|
+
:validate => :string,
|
25
|
+
:default => 'path',
|
26
|
+
:required => false,
|
27
|
+
:deprecated => false
|
28
|
+
|
23
29
|
config :cache_size,
|
24
30
|
:validate => :number,
|
25
31
|
:default => 100,
|
@@ -63,17 +69,11 @@ class LogStash::Filters::DockerMetadata < LogStash::Filters::Base
|
|
63
69
|
public
|
64
70
|
def filter(event)
|
65
71
|
|
66
|
-
# get container id from
|
67
|
-
if event[
|
68
|
-
container_id = event[
|
72
|
+
# get container id from @field_docker_id field
|
73
|
+
if event[@field_docker_id]
|
74
|
+
container_id = event[@field_docker_id].match(@container_id_regexp_compiled)
|
69
75
|
end
|
70
76
|
|
71
|
-
# if it failed fall back to message field
|
72
|
-
if !container_id || !container_id[0]
|
73
|
-
if event["message"]
|
74
|
-
container_id = event["message"].match(@container_id_regexp_compiled)
|
75
|
-
end
|
76
|
-
end
|
77
77
|
|
78
78
|
if container_id && container_id[0]
|
79
79
|
container_id = container_id[0]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-filter-docker_metadata'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.4'
|
4
4
|
s.licenses = ['Apache License (2.0)']
|
5
5
|
s.summary = "This filter add docker metadata to messages that contain a docker ID. It's heavily inspired from https://github.com/fabric8io/fluent-plugin-docker_metadata_filter."
|
6
6
|
s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
|