fluent-plugin-multiline-parser 0.1.0 → 0.1.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faba87e84857d3ce484bade7c89f79f05ecb1d6f
|
4
|
+
data.tar.gz: 0d0e93368d60621bf7a9600c8ef3bc5d09817055
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48d08b204746d1dc17004bd98b14faf302d7c6468b55512dbbf17b8984e7c3aa73b35a76687548593fcbcab284651d7663770e114683018af46d7f850ef9976c
|
7
|
+
data.tar.gz: f7ebc6f16416346807f0f536c9c7c7a426468b67906ab157dc1126465d1db525d81ed26059fa3c87c689b949d6abb380e26ab2d1336c97d8b62765e1191822fa
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
Gem::Specification.new do |gem|
|
3
3
|
gem.name = "fluent-plugin-multiline-parser"
|
4
|
-
gem.version = "0.1.
|
4
|
+
gem.version = "0.1.1"
|
5
5
|
gem.authors = ["Jerry Zhou"]
|
6
6
|
gem.email = ["quicksort@outlook.com"]
|
7
7
|
gem.description = %q{fluentd plugin to parse single field, or to combine log structure into single field, and support multiline format}
|
@@ -30,7 +30,7 @@ class Fluent::ParserFilter < Fluent::Filter
|
|
30
30
|
method(:parse_singleline)
|
31
31
|
end
|
32
32
|
|
33
|
-
@parser = Fluent::
|
33
|
+
@parser = Fluent::TextParser.new
|
34
34
|
@parser.estimate_current_event = false
|
35
35
|
@parser.configure(conf)
|
36
36
|
if !@time_parse && @parser.parser.respond_to?("time_key=".to_sym)
|
@@ -44,7 +44,11 @@ class Fluent::ParserFilter < Fluent::Filter
|
|
44
44
|
line.chomp!
|
45
45
|
@parser.parse(line) do |t,values|
|
46
46
|
if values
|
47
|
-
|
47
|
+
if @time_parse
|
48
|
+
t ||= time
|
49
|
+
else
|
50
|
+
t = time
|
51
|
+
end
|
48
52
|
r = handle_parsed(tag, record, t, values)
|
49
53
|
new_es.add(t, r)
|
50
54
|
else
|
@@ -61,7 +65,7 @@ class Fluent::ParserFilter < Fluent::Filter
|
|
61
65
|
|
62
66
|
def parse_multilines(tag, time, record, line, new_es, es)
|
63
67
|
if @@lines_buffer.has_key?(tag)
|
64
|
-
matches = @parser.firstline?(line)
|
68
|
+
matches = @parser.parser.firstline?(line)
|
65
69
|
if matches
|
66
70
|
index = line.index(matches[0])
|
67
71
|
if index && index > 0
|
@@ -52,7 +52,7 @@ class Fluent::ParserOutput < Fluent::Output
|
|
52
52
|
method(:parse_singleline)
|
53
53
|
end
|
54
54
|
|
55
|
-
@parser = Fluent::
|
55
|
+
@parser = Fluent::TextParser.new
|
56
56
|
@parser.estimate_current_event = false
|
57
57
|
@parser.configure(conf)
|
58
58
|
if !@time_parse && @parser.parser.respond_to?("time_key=".to_sym)
|
@@ -66,7 +66,11 @@ class Fluent::ParserOutput < Fluent::Output
|
|
66
66
|
line.chomp!
|
67
67
|
@parser.parse(line) do |t,values|
|
68
68
|
if values
|
69
|
-
|
69
|
+
if @time_parse
|
70
|
+
t ||= time
|
71
|
+
else
|
72
|
+
t = time
|
73
|
+
end
|
70
74
|
r = handle_parsed(tag, record, t, values)
|
71
75
|
else
|
72
76
|
log.warn "pattern not match with data #{tag} '#{line}'" unless @suppress_parse_error_log
|
@@ -80,7 +84,7 @@ class Fluent::ParserOutput < Fluent::Output
|
|
80
84
|
|
81
85
|
def parse_multilines(tag, time, record, line)
|
82
86
|
if @@lines_buffer.has_key?(tag)
|
83
|
-
matches = @parser.firstline?(line)
|
87
|
+
matches = @parser.parser.firstline?(line)
|
84
88
|
if matches
|
85
89
|
index = line.index(matches[0])
|
86
90
|
if index && index > 0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-multiline-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jerry Zhou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-unit
|