logstash-codec-line 3.0.6 → 3.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/logstash/codecs/line.rb +5 -6
- data/logstash-codec-line.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9b636d4be5390300c7b3fd33df823eb9002823df3af8d02b1ced2790103820a
|
4
|
+
data.tar.gz: df823ff3c67121a8cd89126bf3bc2b7df61843c03a82d5cb686023ede92bbf0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afbd0da2bf5e3fec8f0cf45be012fee0a70d7b78f7092221adf989a46ef3ab3c5842340daca035caf30dbce1a561db7f05b30d72f4ee7069a00ef816a4adb601
|
7
|
+
data.tar.gz: b974b5f8077ca89b11a640478286fc414405377b9ea624243050f33e5d191be2a0c5c9ca25a37b5014c8502905fb9595451bc5c0d9879cc7b0026bbac7c6c833
|
data/CHANGELOG.md
CHANGED
data/lib/logstash/codecs/line.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require "logstash/codecs/base"
|
3
3
|
require "logstash/util/charset"
|
4
|
-
require "thread"
|
5
4
|
|
6
5
|
# Line-oriented text data.
|
7
6
|
#
|
@@ -26,26 +25,26 @@ class LogStash::Codecs::Line < LogStash::Codecs::Base
|
|
26
25
|
# Change the delimiter that separates lines
|
27
26
|
config :delimiter, :validate => :string, :default => "\n"
|
28
27
|
|
28
|
+
MESSAGE_FIELD = "message".freeze
|
29
|
+
|
29
30
|
public
|
30
31
|
def register
|
31
32
|
require "logstash/util/buftok"
|
32
33
|
@buffer = FileWatch::BufferedTokenizer.new(@delimiter)
|
33
34
|
@converter = LogStash::Util::Charset.new(@charset)
|
34
35
|
@converter.logger = @logger
|
35
|
-
@buffer_mutex = Mutex.new
|
36
36
|
end
|
37
37
|
|
38
38
|
public
|
39
39
|
def decode(data)
|
40
|
-
|
41
|
-
lines.each { |line| yield LogStash::Event.new("message" => @converter.convert(line)) }
|
40
|
+
@buffer.extract(data).each { |line| yield LogStash::Event.new(MESSAGE_FIELD => @converter.convert(line)) }
|
42
41
|
end # def decode
|
43
42
|
|
44
43
|
public
|
45
44
|
def flush(&block)
|
46
|
-
remainder = @
|
45
|
+
remainder = @buffer.flush
|
47
46
|
if !remainder.empty?
|
48
|
-
block.call(LogStash::Event.new(
|
47
|
+
block.call(LogStash::Event.new(MESSAGE_FIELD => @converter.convert(remainder)))
|
49
48
|
end
|
50
49
|
end
|
51
50
|
|
data/logstash-codec-line.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-codec-line'
|
4
|
-
s.version = '3.0.
|
4
|
+
s.version = '3.0.7'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Reads line-oriented text data"
|
7
7
|
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-codec-line
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|