logstash-codec-line 3.0.5 → 3.0.6
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 -4
- data/logstash-codec-line.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 557a33da05984ae2d0b80ca0fc87fc6f7cb3b7e5f9d937cf0583c14b2127d6ee
|
4
|
+
data.tar.gz: 97391206d608f08ac6f1fe5d6d54799a0df4d09b32acaf7946b5b92dfbb407a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c678f702065da1cecc3771f1ec72c955625a7585dc5adeb0af15fcb7ee529d559b1923d1b9f8b7e742fc83dd25d15f7e3ed24b2c631f570545c91cbbaef533fc
|
7
|
+
data.tar.gz: bd7d40da070e17e0332ed8377cd5fd9808363fc4ae538ed95c45c8225c5657348a5b7022567ecc8b0f9f52c8aa706c13717930ba6710ad23aafbe1fc993c7e80
|
data/CHANGELOG.md
CHANGED
data/lib/logstash/codecs/line.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require "logstash/codecs/base"
|
3
3
|
require "logstash/util/charset"
|
4
|
+
require "thread"
|
4
5
|
|
5
6
|
# Line-oriented text data.
|
6
7
|
#
|
@@ -31,18 +32,18 @@ class LogStash::Codecs::Line < LogStash::Codecs::Base
|
|
31
32
|
@buffer = FileWatch::BufferedTokenizer.new(@delimiter)
|
32
33
|
@converter = LogStash::Util::Charset.new(@charset)
|
33
34
|
@converter.logger = @logger
|
35
|
+
@buffer_mutex = Mutex.new
|
34
36
|
end
|
35
37
|
|
36
38
|
public
|
37
39
|
def decode(data)
|
38
|
-
@buffer.extract(data)
|
39
|
-
|
40
|
-
end
|
40
|
+
lines = @buffer_mutex.synchronize { @buffer.extract(data) }
|
41
|
+
lines.each { |line| yield LogStash::Event.new("message" => @converter.convert(line)) }
|
41
42
|
end # def decode
|
42
43
|
|
43
44
|
public
|
44
45
|
def flush(&block)
|
45
|
-
remainder = @buffer.flush
|
46
|
+
remainder = @buffer_mutex.synchronize { @buffer.flush }
|
46
47
|
if !remainder.empty?
|
47
48
|
block.call(LogStash::Event.new("message" => @converter.convert(remainder)))
|
48
49
|
end
|
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.6'
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
86
|
rubyforge_project:
|
87
|
-
rubygems_version: 2.6.
|
87
|
+
rubygems_version: 2.6.13
|
88
88
|
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: Reads line-oriented text data
|