adp-fluentd-plugin-gzip 0.0.6 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/adp-fluentd-plugin-gzip.gemspec +1 -1
- data/lib/fluent/plugin/parser_gzip.rb +3 -3
- data/lib/fluent/stream.rb +12 -0
- data/test/adp/fluentd/plugin/gzip_test.rb +31 -7
- data/test/test_helper.rb +3 -4
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df5876802b00df66da44d3a050c88eddfbb61a28a7a2da1bad9577921fa89e3c
|
4
|
+
data.tar.gz: a9c9c34c677541aea1e1f4c224a6be9889aca5edeb91aa76fd4ba1e137cc5068
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0904d2bd67acff59246d15d2d6c495a203f5d83454a0bc494dde16ba71d14093662bec597a5af22ad83f5d121eb6aa6ae9ab0036a889415a07b48344dd531419'
|
7
|
+
data.tar.gz: '0782da9df68907082cc5df7c8ba4cdcaf36cfa1678cdf0ed5915ea067372dcee0033b8226df57452f642757e424053992ed8685acffaaa3accab60b8a00188a5'
|
@@ -2,7 +2,7 @@ $:.push File.expand_path('../lib', __FILE__)
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "adp-fluentd-plugin-gzip"
|
5
|
-
spec.version = "0.0.
|
5
|
+
spec.version = "0.0.10"
|
6
6
|
spec.authors = ["Aleksander Dudek"]
|
7
7
|
spec.email = ["aleksander.dudek@ringieraxelspringer.pl"]
|
8
8
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'fluent/plugin/parser'
|
2
2
|
require 'zlib'
|
3
|
+
require 'fluent/stream'
|
3
4
|
|
4
5
|
module Fluent
|
5
6
|
module Plugin
|
@@ -11,9 +12,8 @@ module Fluent
|
|
11
12
|
end
|
12
13
|
|
13
14
|
def parse(text)
|
14
|
-
log.
|
15
|
-
|
16
|
-
text
|
15
|
+
log.warn("Parsing")
|
16
|
+
compress(text)
|
17
17
|
end
|
18
18
|
|
19
19
|
def compress(string, level = Zlib::DEFAULT_COMPRESSION, strategy = Zlib::DEFAULT_STRATEGY)
|
@@ -1,11 +1,35 @@
|
|
1
|
-
require
|
1
|
+
require 'test/unit'
|
2
|
+
require 'fluent/test/driver/parser'
|
3
|
+
require 'fluent/plugin/parser_gzip'
|
2
4
|
|
3
|
-
class
|
4
|
-
def
|
5
|
-
refute_nil ::Adp::Fluentd::Plugin::Gzip::VERSION
|
5
|
+
class ParserYourOwnTest < Test::Unit::TestCase
|
6
|
+
def setup
|
6
7
|
end
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
CONFIG = %[
|
9
|
+
pattern apache
|
10
|
+
]
|
11
|
+
def create_driver(conf = CONF)
|
12
|
+
Fluent::Test::Driver::Parser.new(Fluent::Plugin::GzipParser).configure(conf)
|
13
|
+
end
|
14
|
+
sub_test_case 'configured with invalid configurations' do
|
15
|
+
test 'empty' do
|
16
|
+
assert_raise(Fluent::ConfigError) do
|
17
|
+
create_driver('')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
sub_test_case 'plugin will parse text' do
|
22
|
+
test 'record has a field' do
|
23
|
+
d = create_driver(CONFIG)
|
24
|
+
text = '192.168.0.1 - - [28/Feb/2013:12:00:00 +0900] "GET / HTTP/1.1" 200 777'
|
25
|
+
expected_time = event_time('28/Feb/2013:12:00:00 +0900', format: '%d/%b/%Y:%H:%M:%S %z')
|
26
|
+
expected_record = {
|
27
|
+
'method' => 'GET',
|
28
|
+
}
|
29
|
+
d.instance.parse(text) do |time, record|
|
30
|
+
assert_equal(expected_time, time)
|
31
|
+
assert_equal(expected_record, record)
|
32
|
+
end
|
33
|
+
end
|
10
34
|
end
|
11
35
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
|
-
require
|
3
|
-
|
4
|
-
require "minitest/autorun"
|
1
|
+
require 'test/unit'
|
2
|
+
require 'fluent/test'
|
3
|
+
require "fluent/plugin/parser_gzip"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adp-fluentd-plugin-gzip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksander Dudek
|
@@ -86,6 +86,7 @@ files:
|
|
86
86
|
- bin/console
|
87
87
|
- bin/setup
|
88
88
|
- lib/fluent/plugin/parser_gzip.rb
|
89
|
+
- lib/fluent/stream.rb
|
89
90
|
- test/adp/fluentd/plugin/gzip_test.rb
|
90
91
|
- test/test_helper.rb
|
91
92
|
homepage: https://example.com
|