fluent-plugin-heroku-parser 0.3.0 → 0.4.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36f74cee9b25489eb5a9c05bb57f93e3594a322669a8647658e4b8ad7d1b06cb
|
4
|
+
data.tar.gz: ac5bb30ac9e9b44c064a715bbc68230749e05a64c2f891294ad53fd76bb7ecca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e592cd6776468d759d8b9c8ccad569bb61cde3a75671fa7188a185208431f92b4116f873f507cbefcb99b88291d7e6bba18f84e1c8f0685c94bf2a3bee36d43
|
7
|
+
data.tar.gz: 3db35ae66ac7c974e5a821f1c83bb72dcd7184ea97d51ad8a4b874a172673f07adba22f09012081d65fa3a6a300d9f199ed46d7ae5fdaff5f6c1026e081ea506
|
@@ -29,19 +29,16 @@ module Fluent
|
|
29
29
|
super
|
30
30
|
end
|
31
31
|
|
32
|
-
def configure(conf
|
32
|
+
def configure(conf)
|
33
33
|
super
|
34
|
+
@time_format = conf["time_format"] || "%b %m %H:%M:%S%z"
|
34
35
|
end
|
35
36
|
|
36
37
|
def parse(text)
|
37
38
|
text =~ /^([^ ]*\s+[^ ]*\s+[^ ]*?)\s([^ ]*?)\s([a-zA-Z0-9_\/\.\-]*)\[([a-zA-Z0-9\.]+)\]?\s(.*)$/
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
ident: $3,
|
42
|
-
pid: $4,
|
43
|
-
message: $5
|
44
|
-
}.merge(parse_message($5))
|
39
|
+
time = Time.strptime($1+"+00:00", @time_format).to_i
|
40
|
+
record = { host: $2, ident: $3, pid: $4 }.merge(parse_message($5))
|
41
|
+
return time, record
|
45
42
|
end
|
46
43
|
|
47
44
|
# TODO: 取得するログを config で指定できるようにする
|
@@ -22,7 +22,7 @@ class HerokuParserTest < Test::Unit::TestCase
|
|
22
22
|
private
|
23
23
|
|
24
24
|
def create_driver(conf)
|
25
|
-
Fluent::Test::Driver::Parser.new(Fluent::
|
25
|
+
Fluent::Test::Driver::Parser.new(Fluent::TextParser::HerokuParser).configure(conf)
|
26
26
|
end
|
27
27
|
|
28
28
|
def exec_test(text, expected_time, expected_record)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-heroku-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ymurata
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|