fluent-parser-elasticsearch 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Fluentd Parser for elasticsearch
|
1
|
+
# Fluentd Parser for elasticsearch [![Build Status](https://travis-ci.org/y-ken/fluent-parser-elasticsearch.png?branch=master)](https://travis-ci.org/y-ken/fluent-parser-elasticsearch)
|
2
2
|
|
3
3
|
[Fluentd](http://fluentd.org/) Parser Plugin to add choice for `format` option for elasticsearch logs with `in_tail` plugin.
|
4
4
|
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "fluent-parser-elasticsearch"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.2"
|
8
8
|
spec.authors = ["Kentaro Yoshida"]
|
9
9
|
spec.email = ["y.ken.studio@gmail.com"]
|
10
10
|
spec.summary = %q{Fluentd Parser Plugin to add choice for `format` option for elasticsearch logs with in_tail plugin.}
|
@@ -3,7 +3,7 @@ module Fluent
|
|
3
3
|
|
4
4
|
parser_elasticsearch = Proc.new {
|
5
5
|
RegexpParser.new(
|
6
|
-
/^\[(?<time>[^ ]* [^ ]*)\]\[(?<log_level>[^ ]*) *?\]\[(?<log_type>[^ ]*) *\] \[(?<node_name>[
|
6
|
+
/^\[(?<time>[^ ]* [^ ]*)\]\[(?<log_level>[^ ]*) *?\]\[(?<log_type>[^ ]*) *\] \[(?<node_name>[^\]]*) *\] (?<message>.+)/,
|
7
7
|
{'time_format' => "%Y-%m-%d %H:%M:%S,%L"}
|
8
8
|
)
|
9
9
|
}
|
@@ -31,5 +31,19 @@ class ElasticsearchParserTest < Test::Unit::TestCase
|
|
31
31
|
'message' => 'bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.0.0.185:9200]}'
|
32
32
|
}, record)
|
33
33
|
end
|
34
|
+
|
35
|
+
def test_call2
|
36
|
+
|
37
|
+
time, record = @parser.call('[2014-10-17 15:24:37,229][WARN ][monitor.jvm ] [James Proudstar] [gc][old][481][8] duration [15s], collections [1]/[15.4s], total [15s]/[23s], memory [7.3gb]->[4.6gb]/[7.9gb], all_pools {[young] [3.8mb]->[5.8mb]/[532.5mb]}{[survivor] [66.5mb]->[0b]/[66.5mb]}{[old] [7.2gb]->[4.6gb]/[7.3gb]}')
|
38
|
+
|
39
|
+
assert_equal(str2time('2014-10-17 15:24:37,229', '%Y-%m-%d %H:%M:%S,%L'), time)
|
40
|
+
assert_equal({
|
41
|
+
'log_level' => 'WARN',
|
42
|
+
'log_type' => 'monitor.jvm',
|
43
|
+
'node_name' => 'James Proudstar',
|
44
|
+
'message' => '[gc][old][481][8] duration [15s], collections [1]/[15.4s], total [15s]/[23s], memory [7.3gb]->[4.6gb]/[7.9gb], all_pools {[young] [3.8mb]->[5.8mb]/[532.5mb]}{[survivor] [66.5mb]->[0b]/[66.5mb]}{[old] [7.2gb]->[4.6gb]/[7.3gb]}'
|
45
|
+
}, record)
|
46
|
+
end
|
47
|
+
|
34
48
|
end
|
35
49
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-parser-elasticsearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-10-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|