fluent-plugin-norikra 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e15eebb32dfadbfe46e9c5d52c7c3eae438cb772
4
- data.tar.gz: 25e60695315a63fd5e3e774a63e03500bb4b5bef
3
+ metadata.gz: f504242a8eb349502eea219ee7ba8c378e1f7f63
4
+ data.tar.gz: 4b6ae2bbfdc505b8217e44d6770d154aaf58c34b
5
5
  SHA512:
6
- metadata.gz: ab124b24f446d522b688ace53ea7f1a65ffc095c82e2fef64f44cf78327214908ed9e9fc4e0deecee30aade019973f2482be83bae33eba7b356c6741bb076dff
7
- data.tar.gz: f03549e79600346c01af7806274c7d004bbcd374fdfeea589b0f955f2da1efccc6e348c46b0169aa1997291708a23bc000e4c538d6c3a75c314e6d62cb93f603
6
+ metadata.gz: 27f5ea700e25021121a250c0737e5644b63ea2c412c3c739debfadf0ccadd16b2e7bf1e24237779a25b3c55f100011a5ff2f2424bd7e038e4d3c00c40bec5656
7
+ data.tar.gz: 4f30c7a90aef5a8ddf08e062477a77050183a0d08d852a34bff5376c57c791f8795d642324a6fdf049d5bc3a6c4bdb894d9404513b4e9cd873e14966bdde642b
@@ -0,0 +1,29 @@
1
+ <source>
2
+ type forward
3
+ </source>
4
+
5
+ <match {accesslog,applog}.**>
6
+ type norikra
7
+ norikra localhost:26571
8
+ target_map_tag yes
9
+
10
+ <default>
11
+ include *
12
+ exclude hhmmss
13
+ </default>
14
+
15
+ <target accesslog.**>
16
+ field_string vhost,path,method,referer,rhost,userlabel,agent,ua_name,ua_category,ua_os,ua_version,ua_vendor
17
+ field_int status
18
+ field_long bytes,duration
19
+ field_boolean FLAG,status_redirection,status_errors,rhost_internal,suffix_miscfile,suffix_imagefile,agent_bot
20
+ </target>
21
+
22
+ <events>
23
+ method sweep
24
+ tag query_name
25
+ tag_prefix norikra.event
26
+ sweep_interval 5s
27
+ </events>
28
+ </match>
29
+
@@ -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.4"
5
+ spec.version = "0.0.5"
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.}
@@ -130,17 +130,20 @@ class Fluent::NorikraOutput
130
130
  end
131
131
 
132
132
  class ConfigSection
133
- attr_accessor :target, :filter_params, :field_definitions, :query_generators
133
+ attr_accessor :target, :target_matcher, :filter_params, :field_definitions, :query_generators
134
134
 
135
135
  def initialize(section)
136
- @target = case section.name
137
- when 'default'
138
- nil
139
- when 'target'
140
- section.arg
141
- else
142
- raise ArgumentError, "invalid section for this class, #{section.name}: ConfigSection"
143
- end
136
+ @target = nil
137
+ @target_matcher = nil
138
+ if section.name == 'default'
139
+ # nil
140
+ elsif section.name == 'target'
141
+ # unescaped target name (tag style with dots)
142
+ @target = section.arg
143
+ @target_matcher = Fluent::GlobMatchPattern.new(section.arg)
144
+ else
145
+ raise ArgumentError, "invalid section for this class, #{section.name}: ConfigSection"
146
+ end
144
147
  @filter_params = {
145
148
  :include => section['include'],
146
149
  :include_regexp => section['include_regexp'],
@@ -75,7 +75,7 @@ module Fluent
75
75
  @execute_jruby_path = element['jruby']
76
76
  @execute_server_path = element['path']
77
77
  @execute_server_opts = element['opts']
78
- when 'event'
78
+ when 'event', 'events'
79
79
  event_section = element
80
80
  else
81
81
  raise Fluent::ConfigError, "unknown configuration section name for this plugin: #{element.name}"
@@ -264,7 +264,16 @@ module Fluent
264
264
 
265
265
  t = @target_map[target]
266
266
  unless t || tobe_registered_target_names.include?(target)
267
- t = Target.new(target, @default_target + @config_targets[target])
267
+ conf = @config_targets[target]
268
+ unless conf
269
+ @config_targets.values.each do |c|
270
+ if c.target_matcher.match(target)
271
+ conf = c
272
+ break
273
+ end
274
+ end
275
+ end
276
+ t = Target.new(target, @default_target + conf)
268
277
  @register_queue.push(t)
269
278
  tobe_registered_target_names.push(target)
270
279
  end
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
4
+ version: 0.0.5
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-08-28 00:00:00.000000000 Z
11
+ date: 2013-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: norikra-client
@@ -82,6 +82,7 @@ files:
82
82
  - example/blank.conf
83
83
  - example/example1.conf
84
84
  - example/test1.conf
85
+ - example/test2.conf
85
86
  - fluent-plugin-norikra.gemspec
86
87
  - lib/fluent/plugin/norikra_target.rb
87
88
  - lib/fluent/plugin/out_norikra.rb
@@ -124,4 +125,3 @@ test_files:
124
125
  - test/test_query_generator.rb
125
126
  - test/test_record_filter.rb
126
127
  - test/test_target.rb
127
- has_rdoc: