fluent-plugin-simple-logentries 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dafc9f608e3b911510e76d89cf0c1bd9ea51bcd
|
4
|
+
data.tar.gz: e18cb26eb01fd0ca79f9bba94ff7ef8ee0e3538f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0203ac1e83df2a3a04dcd0c47b2a20f5ccc70631d07859e9204ee1662385488f0e1177eaf927154c527624ca59f416fe19d08ed97c482623205575780d95a0e1
|
7
|
+
data.tar.gz: 5306980edc8b63a63e16ca7cf240b78d44917762f77780c7fb511bca8f986c488085612e0d2973ae94beebbb70b9838572fcb6ba9d1c144dc5920acfb06df88e
|
@@ -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-plugin-simple-logentries"
|
7
|
-
spec.version = "0.1.
|
7
|
+
spec.version = "0.1.1"
|
8
8
|
spec.description = "Push fluent events to Logentries"
|
9
9
|
spec.authors = ["sowawa"]
|
10
10
|
spec.email = ["kesiuke.sogawa@gmail.com"]
|
@@ -20,7 +20,6 @@ class Fluent::SimpleLogentriesOutput < Fluent::BufferedOutput
|
|
20
20
|
|
21
21
|
def configure(conf)
|
22
22
|
super
|
23
|
-
@last_edit = Time.at(0)
|
24
23
|
end
|
25
24
|
|
26
25
|
def start
|
@@ -76,7 +75,8 @@ class Fluent::SimpleLogentriesOutput < Fluent::BufferedOutput
|
|
76
75
|
elsif data.member?('messages')
|
77
76
|
data['messages']
|
78
77
|
end
|
79
|
-
data.delete(:messages)
|
78
|
+
data.delete(:messages)
|
79
|
+
data.delete('messages')
|
80
80
|
([data] + split_messages(messages).map{|i| {messages: i}} ).each_with_index { |item, idx|
|
81
81
|
push(JSON.generate({sequence: idx, identifyer: identifyer}.merge(item)))
|
82
82
|
}
|
@@ -106,9 +106,26 @@ class Fluent::SimpleLogentriesOutput < Fluent::BufferedOutput
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def split_messages(messages)
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
split_messages(messages[
|
109
|
+
if messages.is_a? String
|
110
|
+
str_length = messages.length
|
111
|
+
return [messages] if SPLITED_ENTRY_SIZE > str_length
|
112
|
+
return split_messages(messages[0..str_length/2-1]) +
|
113
|
+
split_messages(messages[(str_length/2)..str_length])
|
114
|
+
elsif messages.is_a? Array
|
115
|
+
arr_length = messages.length
|
116
|
+
jsonfied = JSON.generate(messages)
|
117
|
+
str_length = jsonfied.length
|
118
|
+
return [messages] if SPLITED_ENTRY_SIZE > str_length
|
119
|
+
if arr_length == 1
|
120
|
+
split_messages(messages[0])
|
121
|
+
else
|
122
|
+
return split_messages(messages[0..arr_length/2-1]) +
|
123
|
+
split_messages(messages[(arr_length/2)..arr_length])
|
124
|
+
end
|
125
|
+
elsif messages.is_a? Hash
|
126
|
+
return split_messages(JSON.generate(messages))
|
127
|
+
else
|
128
|
+
raise TypeError, "Can't split unknown data type."
|
129
|
+
end
|
113
130
|
end
|
114
131
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-simple-logentries
|
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
|
- sowawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -49,7 +49,7 @@ files:
|
|
49
49
|
- Gemfile
|
50
50
|
- fluent-plugin-simple-logentries.gemspec
|
51
51
|
- lib/fluent/plugin/out_simple-logentries.rb
|
52
|
-
- test.conf
|
52
|
+
- test.conf.sample
|
53
53
|
homepage: https://github.com/sowawa/fluent-plugin-simple-logentries
|
54
54
|
licenses:
|
55
55
|
- MIT
|