fluent-plugin-norikra 0.0.4 → 0.0.5
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/example/test2.conf +29 -0
- data/fluent-plugin-norikra.gemspec +1 -1
- data/lib/fluent/plugin/norikra_target.rb +12 -9
- data/lib/fluent/plugin/out_norikra.rb +11 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f504242a8eb349502eea219ee7ba8c378e1f7f63
|
4
|
+
data.tar.gz: 4b6ae2bbfdc505b8217e44d6770d154aaf58c34b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27f5ea700e25021121a250c0737e5644b63ea2c412c3c739debfadf0ccadd16b2e7bf1e24237779a25b3c55f100011a5ff2f2424bd7e038e4d3c00c40bec5656
|
7
|
+
data.tar.gz: 4f30c7a90aef5a8ddf08e062477a77050183a0d08d852a34bff5376c57c791f8795d642324a6fdf049d5bc3a6c4bdb894d9404513b4e9cd873e14966bdde642b
|
data/example/test2.conf
ADDED
@@ -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.
|
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 =
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
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
|
-
|
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
|
+
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-
|
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:
|