fluent-plugin-watch-process 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +17 -3
- data/Appraisals +7 -0
- data/README.md +6 -3
- data/example1.conf +9 -11
- data/example2.conf +3 -2
- data/fluent-plugin-watch-process.gemspec +4 -2
- data/gemfiles/fluentd_v0.12.gemfile +7 -0
- data/gemfiles/fluentd_v0.14.gemfile +7 -0
- data/lib/fluent/plugin/in_watch_process.rb +3 -6
- data/test/plugin/test_in_watch_process.rb +0 -1
- metadata +50 -29
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9173fb842925d14e0f0acfc0fb42ee8b52fe7479
|
4
|
+
data.tar.gz: ef71cd69721481c35a648bf42fcf7da68e7fe320
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 297dd832e5db012b66dbecf2323071143c9acbad29c0dea7f7fb4712e6cfc2e2af7eab78dc5be8af8c94cc2d83f3c1dfa48e049a299fa5881ddd7f857ea7a117
|
7
|
+
data.tar.gz: 4502c116b2af32e99d0f47d340b690033e4cd958c774b79b283b0ad692fbbc12e021ab5e6eadadf76ee13fd49bbcac51b825afbee3bcab6a8bd2a1649fd99375
|
data/.travis.yml
CHANGED
@@ -1,6 +1,20 @@
|
|
1
1
|
language: ruby
|
2
2
|
|
3
3
|
rvm:
|
4
|
-
- 2.1
|
5
|
-
- 2.
|
6
|
-
- 1
|
4
|
+
- 2.3.1
|
5
|
+
- 2.2
|
6
|
+
- 2.1
|
7
|
+
|
8
|
+
before_install:
|
9
|
+
- gem update bundler
|
10
|
+
|
11
|
+
gemfile:
|
12
|
+
- Gemfile
|
13
|
+
- gemfiles/fluentd_v0.12.gemfile
|
14
|
+
- gemfiles/fluentd_v0.14.gemfile
|
15
|
+
|
16
|
+
matrix:
|
17
|
+
include:
|
18
|
+
- rvm: 2.0.0
|
19
|
+
gemfile: gemfiles/fluentd_v0.12.gemfile
|
20
|
+
|
data/Appraisals
ADDED
data/README.md
CHANGED
@@ -25,7 +25,10 @@ install with gem or fluent-gem command as:
|
|
25
25
|
$ gem install fluent-plugin-watch-process
|
26
26
|
|
27
27
|
# for td-agent
|
28
|
-
$ sudo /usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-watch-process
|
28
|
+
$ sudo /usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-watch-process -v 0.1.0
|
29
|
+
|
30
|
+
# for td-agent2 (recommend)
|
31
|
+
$ sudo td-agent-gem install fluent-plugin-watch-process -v 0.1.0
|
29
32
|
```
|
30
33
|
|
31
34
|
## Configuration
|
@@ -36,14 +39,14 @@ It is a quick sample to output log to `/var/log/td-agent/td-agent.log` with td-a
|
|
36
39
|
|
37
40
|
`````
|
38
41
|
<source>
|
39
|
-
type
|
42
|
+
@type watch_process
|
40
43
|
tag debug.batch.${hostname} # Required
|
41
44
|
lookup_user batchuser # Optional
|
42
45
|
interval 10s # Optional (default: 5s)
|
43
46
|
</source>
|
44
47
|
|
45
48
|
<match debug.**>
|
46
|
-
type
|
49
|
+
@type stdout
|
47
50
|
</match>
|
48
51
|
`````
|
49
52
|
|
data/example1.conf
CHANGED
@@ -6,10 +6,10 @@
|
|
6
6
|
# * fluent-plugin-elasticsearch
|
7
7
|
|
8
8
|
<source>
|
9
|
-
type watch_process
|
9
|
+
@type watch_process
|
10
10
|
|
11
11
|
# specify output tag
|
12
|
-
tag
|
12
|
+
tag batch.process
|
13
13
|
|
14
14
|
# filter specific user owned process. if no need to filter, delete this line.
|
15
15
|
lookup_user batchuser
|
@@ -18,18 +18,16 @@
|
|
18
18
|
interval 10s
|
19
19
|
</source>
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
enable_ruby false
|
21
|
+
# add hostname key into record
|
22
|
+
<filter batch.process>
|
23
|
+
@type record_transformer
|
25
24
|
<record>
|
26
|
-
|
27
|
-
hostname ${hostname}
|
25
|
+
hostname ${hostname}
|
28
26
|
</record>
|
29
|
-
</
|
27
|
+
</filter>
|
30
28
|
|
31
|
-
<match
|
32
|
-
type
|
29
|
+
<match batch.*>
|
30
|
+
@type elasticsearch
|
33
31
|
host localhost
|
34
32
|
port 9200
|
35
33
|
logstash_format true
|
data/example2.conf
CHANGED
@@ -5,9 +5,10 @@
|
|
5
5
|
# * fluent-plugin-s3
|
6
6
|
|
7
7
|
<source>
|
8
|
-
type
|
8
|
+
@type watch_process
|
9
9
|
|
10
10
|
# use ${hostname} placeholder to use filename
|
11
|
+
# If you want to customize it, Use #{Socket.gethostname} or #{Socket.gethostname.split('.').first} snippet for tag.
|
11
12
|
tag batch_process.${hostname}
|
12
13
|
|
13
14
|
# filter specific user owned process. if no need to filter, delete this line.
|
@@ -18,7 +19,7 @@
|
|
18
19
|
</source>
|
19
20
|
|
20
21
|
<match batch_process.*>
|
21
|
-
type s3
|
22
|
+
@type s3
|
22
23
|
|
23
24
|
aws_key_id YOUR_AWS_KEY_ID
|
24
25
|
aws_sec_key YOUR_AWS_SECRET/KEY
|
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "fluent-plugin-watch-process"
|
6
|
-
s.version = "0.0
|
6
|
+
s.version = "0.1.0"
|
7
7
|
s.authors = ["Kentaro Yoshida"]
|
8
8
|
s.email = ["y.ken.studio@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/y-ken/fluent-plugin-watch-process"
|
@@ -16,7 +16,9 @@ Gem::Specification.new do |s|
|
|
16
16
|
|
17
17
|
# specify any dependencies:
|
18
18
|
s.add_development_dependency "rake"
|
19
|
-
s.
|
19
|
+
s.add_development_dependency "test-unit", ">= 3.1.0"
|
20
|
+
s.add_development_dependency "appraisal"
|
21
|
+
s.add_runtime_dependency "fluentd", ">= 0.10.58"
|
20
22
|
s.add_runtime_dependency "fluent-mixin-rewrite-tag-name"
|
21
23
|
s.add_runtime_dependency "fluent-mixin-type-converter"
|
22
24
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require "fluent/input"
|
1
2
|
require 'fluent/mixin/rewrite_tag_name'
|
2
3
|
require 'fluent/mixin/type_converter'
|
3
4
|
|
@@ -16,13 +17,9 @@ module Fluent
|
|
16
17
|
DEFAULT_TYPES = "pid:integer,parent_pid:integer,cpu_percent:float,memory_percent:float,mem_rss:integer,mem_size:integer"
|
17
18
|
|
18
19
|
include Fluent::HandleTagNameMixin
|
19
|
-
|
20
20
|
include Fluent::Mixin::RewriteTagName
|
21
|
-
config_set_default :enable_placeholder_upcase, true
|
22
|
-
config_set_default :enable_placeholder_hostname, true
|
23
|
-
|
24
21
|
include Fluent::Mixin::TypeConverter
|
25
|
-
|
22
|
+
config_set_default :types, DEFAULT_TYPES
|
26
23
|
|
27
24
|
def initialize
|
28
25
|
super
|
@@ -64,7 +61,7 @@ module Fluent
|
|
64
61
|
next unless @lookup_user.nil? || @lookup_user.include?(data['user'])
|
65
62
|
emit_tag = tag.dup
|
66
63
|
filter_record(emit_tag, Engine.now, data)
|
67
|
-
|
64
|
+
router.emit(emit_tag, Engine.now, data)
|
68
65
|
end
|
69
66
|
io.close
|
70
67
|
sleep @interval
|
metadata
CHANGED
@@ -1,78 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-watch-process
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Kentaro Yoshida
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2017-03-26 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rake
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
|
-
name:
|
28
|
+
name: test-unit
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 3.1.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 3.1.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: appraisal
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
36
46
|
- !ruby/object:Gem::Version
|
37
47
|
version: '0'
|
38
|
-
type: :
|
48
|
+
type: :development
|
39
49
|
prerelease: false
|
40
50
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
51
|
requirements:
|
43
|
-
- -
|
52
|
+
- - ">="
|
44
53
|
- !ruby/object:Gem::Version
|
45
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: fluentd
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.10.58
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.10.58
|
46
69
|
- !ruby/object:Gem::Dependency
|
47
70
|
name: fluent-mixin-rewrite-tag-name
|
48
71
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
72
|
requirements:
|
51
|
-
- -
|
73
|
+
- - ">="
|
52
74
|
- !ruby/object:Gem::Version
|
53
75
|
version: '0'
|
54
76
|
type: :runtime
|
55
77
|
prerelease: false
|
56
78
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
79
|
requirements:
|
59
|
-
- -
|
80
|
+
- - ">="
|
60
81
|
- !ruby/object:Gem::Version
|
61
82
|
version: '0'
|
62
83
|
- !ruby/object:Gem::Dependency
|
63
84
|
name: fluent-mixin-type-converter
|
64
85
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
86
|
requirements:
|
67
|
-
- -
|
87
|
+
- - ">="
|
68
88
|
- !ruby/object:Gem::Version
|
69
89
|
version: '0'
|
70
90
|
type: :runtime
|
71
91
|
prerelease: false
|
72
92
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
93
|
requirements:
|
75
|
-
- -
|
94
|
+
- - ">="
|
76
95
|
- !ruby/object:Gem::Version
|
77
96
|
version: '0'
|
78
97
|
description:
|
@@ -82,8 +101,9 @@ executables: []
|
|
82
101
|
extensions: []
|
83
102
|
extra_rdoc_files: []
|
84
103
|
files:
|
85
|
-
- .gitignore
|
86
|
-
- .travis.yml
|
104
|
+
- ".gitignore"
|
105
|
+
- ".travis.yml"
|
106
|
+
- Appraisals
|
87
107
|
- Gemfile
|
88
108
|
- LICENSE.txt
|
89
109
|
- README.md
|
@@ -91,32 +111,33 @@ files:
|
|
91
111
|
- example1.conf
|
92
112
|
- example2.conf
|
93
113
|
- fluent-plugin-watch-process.gemspec
|
114
|
+
- gemfiles/fluentd_v0.12.gemfile
|
115
|
+
- gemfiles/fluentd_v0.14.gemfile
|
94
116
|
- lib/fluent/plugin/in_watch_process.rb
|
95
117
|
- test/helper.rb
|
96
118
|
- test/plugin/test_in_watch_process.rb
|
97
119
|
homepage: https://github.com/y-ken/fluent-plugin-watch-process
|
98
120
|
licenses: []
|
121
|
+
metadata: {}
|
99
122
|
post_install_message:
|
100
123
|
rdoc_options: []
|
101
124
|
require_paths:
|
102
125
|
- lib
|
103
126
|
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
-
none: false
|
105
127
|
requirements:
|
106
|
-
- -
|
128
|
+
- - ">="
|
107
129
|
- !ruby/object:Gem::Version
|
108
130
|
version: '0'
|
109
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
-
none: false
|
111
132
|
requirements:
|
112
|
-
- -
|
133
|
+
- - ">="
|
113
134
|
- !ruby/object:Gem::Version
|
114
135
|
version: '0'
|
115
136
|
requirements: []
|
116
137
|
rubyforge_project:
|
117
|
-
rubygems_version:
|
138
|
+
rubygems_version: 2.2.5
|
118
139
|
signing_key:
|
119
|
-
specification_version:
|
140
|
+
specification_version: 4
|
120
141
|
summary: Fluentd Input plugin to collect continual process information via ps command.
|
121
142
|
It is useful for cron/barch process monitoring.
|
122
143
|
test_files:
|