logstash-codec-rfc6587 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash/codecs/rfc6587.rb +1 -0
- data/logstash-codec-rfc6587.gemspec +2 -2
- data/spec/codecs/rfc6587_spec.rb +28 -0
- 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: 15099317e64a62990e4c3f58872acd7c75e3efbc384343052a078003ce1260f3
|
4
|
+
data.tar.gz: 25eeec0596b026729fd2d0982609de06c77171c33cb7647a4a7377024663747e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8da66783b0b0326f11d507ba5cbc024ef871a62bda77bcbc6bdc7cfcdf210a77bdaae1d33d128ca7998261d5904854d83a2707ebea7aae822379c911ebaed1d0
|
7
|
+
data.tar.gz: 9667b5c7002f3739b9d4175931375c165ba17119e8b4884296336af5d495b86fbd69f85af1d8ae38bbf76a5096b639030cb9766cf46acad8d4d7ff01d8443978
|
@@ -49,6 +49,7 @@ class LogStash::Codecs::Rfc6587 < LogStash::Codecs::Base
|
|
49
49
|
def read(data)
|
50
50
|
header = ""
|
51
51
|
while c = data.read(1)
|
52
|
+
next if ["\0", "\x00"].include?(c) # ignore null characters
|
52
53
|
raise "Unknown header character '#{c}'" if not [@delimiter, nil, c.to_i.to_s].include?(c)
|
53
54
|
header += c if c
|
54
55
|
break if c == @delimiter or data.eof or c == nil
|
@@ -1,13 +1,13 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-codec-rfc6587'
|
4
|
-
s.version = '0.1.
|
4
|
+
s.version = '0.1.2'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Reads lines as described in rfc6587"
|
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"
|
8
8
|
s.authors = ["Elastic", "ThePsyjo"]
|
9
9
|
s.email = 'info@elastic.co'
|
10
|
-
s.homepage = "
|
10
|
+
s.homepage = "https://github.com/ThePsyjo/logstash-codec-rfc6587"
|
11
11
|
s.require_paths = ["lib"]
|
12
12
|
|
13
13
|
# Files
|
data/spec/codecs/rfc6587_spec.rb
CHANGED
@@ -49,6 +49,7 @@ describe LogStash::Codecs::Rfc6587, :ecs_compatibility_support do
|
|
49
49
|
#end
|
50
50
|
|
51
51
|
context "#decode" do
|
52
|
+
|
52
53
|
it "should return an event from an ascii string" do
|
53
54
|
decoded = false
|
54
55
|
subject.decode("11 hello world") do |e|
|
@@ -59,6 +60,33 @@ describe LogStash::Codecs::Rfc6587, :ecs_compatibility_support do
|
|
59
60
|
insist { decoded } == true
|
60
61
|
end
|
61
62
|
|
63
|
+
it "should return nothing if input data is empty" do
|
64
|
+
decoded = false
|
65
|
+
subject.decode("") do |e|
|
66
|
+
decoded = true
|
67
|
+
end
|
68
|
+
insist { decoded } == false
|
69
|
+
end
|
70
|
+
|
71
|
+
it "should return nothing if input data is only '\\0' or '\\x00'" do
|
72
|
+
decoded = false
|
73
|
+
subject.decode("\0\x00") do |e|
|
74
|
+
decoded = true
|
75
|
+
end
|
76
|
+
insist { decoded } == false
|
77
|
+
end
|
78
|
+
|
79
|
+
it "should return an event from an ascii string prefixed with \\0" do
|
80
|
+
decoded = false
|
81
|
+
subject.decode("\x004 test") do |e|
|
82
|
+
decoded = true
|
83
|
+
insist { e.is_a?(LogStash::Event) }
|
84
|
+
insist { e.get("message") } == "test"
|
85
|
+
end
|
86
|
+
insist { decoded } == true
|
87
|
+
end
|
88
|
+
|
89
|
+
|
62
90
|
ecs_compatibility_matrix(:disabled, :v1, :v8 => :v1) do |ecs_select|
|
63
91
|
|
64
92
|
before(:each) do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-codec-rfc6587
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-03-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -105,7 +105,7 @@ files:
|
|
105
105
|
- lib/logstash/codecs/rfc6587.rb
|
106
106
|
- logstash-codec-rfc6587.gemspec
|
107
107
|
- spec/codecs/rfc6587_spec.rb
|
108
|
-
homepage:
|
108
|
+
homepage: https://github.com/ThePsyjo/logstash-codec-rfc6587
|
109
109
|
licenses:
|
110
110
|
- Apache License (2.0)
|
111
111
|
metadata:
|