fluent-plugin-norikra 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/README.md +6 -1
- data/fluent-plugin-norikra.gemspec +2 -2
- data/lib/fluent/plugin/norikra_target.rb +8 -2
- data/lib/fluent/plugin/out_norikra.rb +5 -6
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15fd701a1f7292330d4194352d96518347ec9ae9
|
4
|
+
data.tar.gz: c2933984c912bdbdd3a07623a1e1a74fe2204839
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e159da05aaa724db968679bfcd55ffe32f98c91cd65105de506838e643fce5c42a6ea5979f06afd4b35ed9128b48db898ca1173ca5db55b31eefb1f3877fae76
|
7
|
+
data.tar.gz: 4505078afa2c522412f74d0b401a89a8f856c6ae318c43aadd15f0895b1e280b3d84d1c1db23c1e585c5d0d9c8d829a9bc25eaa8235d88a10cab2bf78b577a62
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -92,7 +92,7 @@ If you know some field's types of records, you can define types of these fields.
|
|
92
92
|
</default>
|
93
93
|
</match>
|
94
94
|
|
95
|
-
Additional field definitions and query registrations should be written in `<target TARGET_NAME>` sections.
|
95
|
+
Additional field definitions and query registrations should be written in `<target TARGET_NAME>` sections. In each sections (or also in 'default'), you can specify `auto_field false` to suppress field number which increasing infinitely.
|
96
96
|
|
97
97
|
<default>
|
98
98
|
... # for all of access logs
|
@@ -107,10 +107,13 @@ Additional field definitions and query registrations should be written in `<targ
|
|
107
107
|
</query>
|
108
108
|
</target>
|
109
109
|
<target other_action>
|
110
|
+
auto_field false
|
110
111
|
...
|
111
112
|
</target>
|
112
113
|
# ...
|
113
114
|
|
115
|
+
Fields which are referred in queries are automatically registered on norikra server in spite of `auto_field false`.
|
116
|
+
|
114
117
|
### Input event data filtering
|
115
118
|
|
116
119
|
If you want send known fields only, specify `exclude *` and `include` or `include_regexp` like this:
|
@@ -171,6 +174,8 @@ NOTE: 'sweep' get all events from Norikra, and other clients cannot get these ev
|
|
171
174
|
* TODO: write this section
|
172
175
|
* `fetch_interval`
|
173
176
|
* error logs for new target, success logs of retry
|
177
|
+
* input/output plugin
|
178
|
+
* output plugin with active-standby servers
|
174
179
|
|
175
180
|
# TODO
|
176
181
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "fluent-plugin-norikra"
|
5
|
-
spec.version = "0.0.
|
5
|
+
spec.version = "0.0.7"
|
6
6
|
spec.authors = ["TAGOMORI Satoshi"]
|
7
7
|
spec.email = ["tagomoris@gmail.com"]
|
8
8
|
spec.description = %q{process events on fluentd with SQL like query, with built-in Norikra server if needed.}
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
16
16
|
spec.require_paths = ["lib"]
|
17
17
|
|
18
|
-
spec.add_runtime_dependency "norikra-client", ">= 0.0.
|
18
|
+
spec.add_runtime_dependency "norikra-client", ">= 0.0.7"
|
19
19
|
spec.add_runtime_dependency "fluentd"
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.3"
|
@@ -130,7 +130,7 @@ class Fluent::NorikraOutput
|
|
130
130
|
end
|
131
131
|
|
132
132
|
class ConfigSection
|
133
|
-
attr_accessor :target, :target_matcher, :filter_params, :field_definitions, :query_generators
|
133
|
+
attr_accessor :target, :target_matcher, :auto_field, :filter_params, :field_definitions, :query_generators
|
134
134
|
|
135
135
|
def initialize(section)
|
136
136
|
@target = nil
|
@@ -144,6 +144,9 @@ class Fluent::NorikraOutput
|
|
144
144
|
else
|
145
145
|
raise ArgumentError, "invalid section for this class, #{section.name}: ConfigSection"
|
146
146
|
end
|
147
|
+
|
148
|
+
@auto_field = section['auto_field']
|
149
|
+
|
147
150
|
@filter_params = {
|
148
151
|
:include => section['include'],
|
149
152
|
:include_regexp => section['include_regexp'],
|
@@ -175,6 +178,8 @@ class Fluent::NorikraOutput
|
|
175
178
|
other = self.class.new(Fluent::Config::Element.new('target', 'dummy', {}, []))
|
176
179
|
end
|
177
180
|
r = self.class.new(Fluent::Config::Element.new('target', (other.target ? other.target : self.target), {}, []))
|
181
|
+
r.auto_field = (other.auto_field.nil? ? self.auto_field : other.auto_field)
|
182
|
+
|
178
183
|
others_filter = {}
|
179
184
|
other.filter_params.keys.each do |k|
|
180
185
|
others_filter[k] = other.filter_params[k] if other.filter_params[k]
|
@@ -194,7 +199,7 @@ class Fluent::NorikraOutput
|
|
194
199
|
end
|
195
200
|
|
196
201
|
class Target
|
197
|
-
attr_accessor :name, :fields, :queries
|
202
|
+
attr_accessor :name, :auto_field, :fields, :queries
|
198
203
|
attr_reader :escaped_name
|
199
204
|
|
200
205
|
def self.escape(src)
|
@@ -217,6 +222,7 @@ class Fluent::NorikraOutput
|
|
217
222
|
def initialize(target, config)
|
218
223
|
@name = target
|
219
224
|
@escaped_name = self.class.escape(@name)
|
225
|
+
@auto_field = config.auto_field.nil? ? true : config.auto_field
|
220
226
|
|
221
227
|
@filter = RecordFilter.new(*([:include, :include_regexp, :exclude, :exclude_regexp].map{|s| config.filter_params[s]}))
|
222
228
|
@fields = config.field_definitions
|
@@ -177,14 +177,13 @@ module Fluent
|
|
177
177
|
$log.info "starting Norikra server process #{@host}:#{@port}"
|
178
178
|
base_options = [@execute_server_path, 'start', '-H', @host, '-P', @port.to_s]
|
179
179
|
cmd,options = if @execute_jruby_path
|
180
|
-
|
181
|
-
if @execute_server_opts
|
182
|
-
args.unshift(*@execute_server_opts.split(/ +/).map{|opt| '-J' + opt})
|
183
|
-
end
|
184
|
-
[@execute_jruby_path, args]
|
180
|
+
[@execute_jruby_path, [@execute_server_path, 'start', '-H', @host, '-P', @port.to_s]]
|
185
181
|
else
|
186
182
|
[@execute_server_path, ['start', '-H', @host, '-P', @port.to_s]]
|
187
183
|
end
|
184
|
+
if @execute_server_opts
|
185
|
+
options += @execute_server_opts.split(/ +/)
|
186
|
+
end
|
188
187
|
@norikra_pid = fork do
|
189
188
|
ENV.keys.select{|k| k =~ /^(RUBY|GEM|BUNDLE|RBENV|RVM|rvm)/}.each {|k| ENV.delete(k)}
|
190
189
|
exec([cmd, 'norikra(fluentd)'], *options)
|
@@ -324,7 +323,7 @@ module Fluent
|
|
324
323
|
begin
|
325
324
|
unless client.targets.include?(target.escaped_name)
|
326
325
|
$log.debug "opening target #{target.escaped_name}"
|
327
|
-
client.open(target.escaped_name, target.reserve_fields)
|
326
|
+
client.open(target.escaped_name, target.reserve_fields, target.auto_field)
|
328
327
|
$log.debug "opening target #{target.escaped_name}, done."
|
329
328
|
end
|
330
329
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-norikra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TAGOMORI Satoshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: norikra-client
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0.
|
19
|
+
version: 0.0.7
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0.
|
26
|
+
version: 0.0.7
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: fluentd
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -75,6 +75,7 @@ extensions: []
|
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
77
|
- .gitignore
|
78
|
+
- .travis.yml
|
78
79
|
- Gemfile
|
79
80
|
- LICENSE.txt
|
80
81
|
- README.md
|