fluent-plugin-out-solr 0.0.5 → 0.0.6
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/.rubocop.yml +7 -0
- data/Rakefile +2 -3
- data/fluent-plugin-out-solr.gemspec +10 -8
- data/lib/fluent/plugin/out_solr.rb +38 -36
- data/lib/fluent/plugin/out_solr_time_sliced.rb +42 -40
- data/test/plugin/.rubocop.yml +0 -15
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b582635ea5b9599bb0ffad3ff691afe325faa65
|
4
|
+
data.tar.gz: 940b3f04bcb7a3cdfdbd5dbabef135be23c0656c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6eb9e32bbe6766c0a5d278a9131b45af9fc03412d16e72266bf153e88c30354d5c7bf0acd6ffc643d10c8a4fc07030cf7abdd71cccb348bdf484b78489294ee3
|
7
|
+
data.tar.gz: 367a03794954616edfc202e9ea4d0b199838ab66fb23cf16826d95897baa6424aa69332faa8e90b87177e9660616b973609077e06e05e5585ff000d9c1849d22
|
data/.rubocop.yml
ADDED
data/Rakefile
CHANGED
@@ -1,19 +1,21 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
2
|
+
require 'English'
|
3
|
+
|
4
|
+
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
3
5
|
|
4
6
|
Gem::Specification.new do |s|
|
5
7
|
s.name = 'fluent-plugin-out-solr'
|
6
|
-
s.version = '0.0.
|
7
|
-
s.authors =
|
8
|
-
s.email = ['
|
9
|
-
s.description = %q
|
8
|
+
s.version = '0.0.6'
|
9
|
+
s.authors = %w(diogo pitr haruyama )
|
10
|
+
s.email = ['haruyama@unixuser.org']
|
11
|
+
s.description = %q(Solr output plugin for Fluent event collector)
|
10
12
|
s.summary = s.description
|
11
13
|
s.homepage = 'https://github.com/haruyama/fluent-plugin-out-solr'
|
12
14
|
s.license = 'MIT'
|
13
15
|
|
14
|
-
s.files = `git ls-files`.split(
|
15
|
-
s.executables = s.files.grep(
|
16
|
-
s.test_files = s.files.grep(
|
16
|
+
s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
17
|
+
s.executables = s.files.grep(/^bin\//).map { |f| File.basename(f) }
|
18
|
+
s.test_files = s.files.grep(/^(test|spec|features)\//)
|
17
19
|
s.require_paths = ['lib']
|
18
20
|
|
19
21
|
s.add_runtime_dependency 'fluentd'
|
@@ -1,46 +1,48 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
Fluent::
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
def configure(conf)
|
23
|
-
if conf['utc']
|
24
|
-
@localtime = false
|
25
|
-
elsif conf['localtime']
|
3
|
+
module Fluent
|
4
|
+
# Solr output plugin for Fluent
|
5
|
+
class SolrOutput < Fluent::BufferedOutput
|
6
|
+
Fluent::Plugin.register_output('solr', self)
|
7
|
+
|
8
|
+
require 'fluent/plugin/solr_util'
|
9
|
+
include SolrUtil
|
10
|
+
require 'fluent/plugin/solr_config_common'
|
11
|
+
include SolrConfigCommon
|
12
|
+
|
13
|
+
config_param :core, :string, default: 'collection1'
|
14
|
+
|
15
|
+
def initialize
|
16
|
+
require 'net/http'
|
17
|
+
require 'uri'
|
18
|
+
require 'time'
|
19
|
+
super
|
26
20
|
@localtime = true
|
27
21
|
end
|
28
|
-
super
|
29
|
-
end
|
30
22
|
|
31
|
-
|
32
|
-
|
33
|
-
|
23
|
+
def configure(conf)
|
24
|
+
if conf['utc']
|
25
|
+
@localtime = false
|
26
|
+
elsif conf['localtime']
|
27
|
+
@localtime = true
|
28
|
+
end
|
29
|
+
super
|
30
|
+
end
|
34
31
|
|
35
|
-
|
36
|
-
|
37
|
-
|
32
|
+
def start
|
33
|
+
super
|
34
|
+
end
|
38
35
|
|
39
|
-
|
40
|
-
|
41
|
-
|
36
|
+
def format(tag, time, record)
|
37
|
+
[tag, time, record].to_msgpack
|
38
|
+
end
|
42
39
|
|
43
|
-
|
44
|
-
|
40
|
+
def shutdown
|
41
|
+
super
|
42
|
+
end
|
43
|
+
|
44
|
+
def write(chunk)
|
45
|
+
update_core(chunk, @core)
|
46
|
+
end
|
45
47
|
end
|
46
48
|
end
|
@@ -1,57 +1,59 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
|
+
module Fluent
|
3
4
|
# Solr output plugin for Fluent
|
4
|
-
class
|
5
|
-
|
5
|
+
class SolrTimeSlicedOutput < Fluent::TimeSlicedOutput
|
6
|
+
Fluent::Plugin.register_output('solr_time_sliced', self)
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
require 'fluent/plugin/solr_util'
|
9
|
+
include SolrUtil
|
10
|
+
require 'fluent/plugin/solr_config_common'
|
11
|
+
include SolrConfigCommon
|
11
12
|
|
12
|
-
|
13
|
-
|
13
|
+
config_set_default :buffer_type, 'memory'
|
14
|
+
config_set_default :time_slice_format, '%Y%m%d'
|
14
15
|
|
15
|
-
|
16
|
+
config_param :core, :string, default: 'log-%Y%m%d'
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
def initialize
|
19
|
+
require 'net/http'
|
20
|
+
require 'uri'
|
21
|
+
require 'time'
|
22
|
+
super
|
23
|
+
@localtime = true
|
24
|
+
end
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
def configure(conf)
|
27
|
+
if conf['core']
|
28
|
+
if conf['core'].index('%S')
|
29
|
+
conf['time_slice_format'] = '%Y%m%d%H%M%S'
|
30
|
+
elsif conf['core'].index('%M')
|
31
|
+
conf['time_slice_format'] = '%Y%m%d%H%M'
|
32
|
+
elsif conf['core'].index('%H')
|
33
|
+
conf['time_slice_format'] = '%Y%m%d%H'
|
34
|
+
end
|
33
35
|
end
|
36
|
+
super
|
34
37
|
end
|
35
|
-
super
|
36
|
-
end
|
37
38
|
|
38
|
-
|
39
|
-
|
40
|
-
|
39
|
+
def start
|
40
|
+
super
|
41
|
+
end
|
41
42
|
|
42
|
-
|
43
|
-
|
44
|
-
|
43
|
+
def format(tag, time, record)
|
44
|
+
[tag, time, record].to_msgpack
|
45
|
+
end
|
45
46
|
|
46
|
-
|
47
|
-
|
48
|
-
|
47
|
+
def shutdown
|
48
|
+
super
|
49
|
+
end
|
49
50
|
|
50
|
-
|
51
|
-
|
52
|
-
|
51
|
+
def core_format(chunk_key)
|
52
|
+
Time.strptime(chunk_key, @time_slice_format).strftime(@core)
|
53
|
+
end
|
53
54
|
|
54
|
-
|
55
|
-
|
55
|
+
def write(chunk)
|
56
|
+
update_core(chunk, core_format(chunk.key))
|
57
|
+
end
|
56
58
|
end
|
57
59
|
end
|
data/test/plugin/.rubocop.yml
CHANGED
@@ -6,20 +6,5 @@ MethodLength:
|
|
6
6
|
CountComments: false # count full line comments?
|
7
7
|
Max: 50
|
8
8
|
|
9
|
-
FavorSprintf:
|
10
|
-
Enabled: false
|
11
|
-
|
12
|
-
MultilineBlocks:
|
13
|
-
Enabled: false
|
14
|
-
|
15
|
-
AvoidPerlBackrefs:
|
16
|
-
Enabled: false
|
17
|
-
|
18
|
-
PercentLiterals:
|
19
|
-
Enabled: false
|
20
|
-
|
21
|
-
BraceAfterPercent:
|
22
|
-
Enabled: false
|
23
|
-
|
24
9
|
ClassLength:
|
25
10
|
Enabled: false
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-out-solr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- diogo
|
@@ -10,59 +10,59 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-04-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: fluentd
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '0'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rake
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - ">="
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: '0'
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: webmock
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
description: Solr output plugin for Fluent event collector
|
58
58
|
email:
|
59
|
-
- team@uken.com
|
60
59
|
- haruyama@unixuser.org
|
61
60
|
executables: []
|
62
61
|
extensions: []
|
63
62
|
extra_rdoc_files: []
|
64
63
|
files:
|
65
|
-
- .gitignore
|
64
|
+
- ".gitignore"
|
65
|
+
- ".rubocop.yml"
|
66
66
|
- Gemfile
|
67
67
|
- LICENSE.txt
|
68
68
|
- README.md
|
@@ -86,17 +86,17 @@ require_paths:
|
|
86
86
|
- lib
|
87
87
|
required_ruby_version: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- -
|
89
|
+
- - ">="
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
98
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.2.
|
99
|
+
rubygems_version: 2.2.2
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: Solr output plugin for Fluent event collector
|