logstash-input-gelf 3.3.1 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/logstash/inputs/gelf.rb +3 -1
- data/logstash-input-gelf.gemspec +1 -1
- data/spec/inputs/gelf_spec.rb +9 -4
- 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: dbaa212dd64992aea162a2d0888468f52e91b9a251fcbd7eb3d02850b82da24a
|
4
|
+
data.tar.gz: 804762f84e844e55ed7efb4bb9dd02a4d0e7a6a56f5c2ea8fea0e5945a2683c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49f13ce13d7acdd4862f4db62f31dfbeea263013d201cf9e761c6f76f1621f06dee7206c39b8e991f06b0150377d10f24d2b955787ae02c49b8eced72541be4e
|
7
|
+
data.tar.gz: 1b7eb70bd7eb91728f9feb23d937c62cd896a9c12b1aa575950aa2e87cdcaffbacd90949dcd3799230650691d846b82165101e98c1e9176008a71d72ae303bc0
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 3.3.2
|
2
|
+
- Fix: avoid panic when handling very-large exponent-notation `_@timestamp` values [#71](https://github.com/logstash-plugins/logstash-input-gelf/pull/71)
|
3
|
+
|
1
4
|
## 3.3.1
|
2
5
|
- Fix: safely coerce the value of `_@timestamp` to avoid crashing the plugin [#67](https://github.com/logstash-plugins/logstash-input-gelf/pull/67)
|
3
6
|
|
data/lib/logstash/inputs/gelf.rb
CHANGED
@@ -243,7 +243,9 @@ class LogStash::Inputs::Gelf < LogStash::Inputs::Base
|
|
243
243
|
def self.coerce_timestamp(timestamp)
|
244
244
|
# prevent artificial precision from being injected by floats
|
245
245
|
timestamp = timestamp.rationalize if timestamp.kind_of?(Float)
|
246
|
-
|
246
|
+
|
247
|
+
# bug in JRuby prevents correcly parsing a BigDecimal fractional part, see https://github.com/elastic/logstash/issues/4565
|
248
|
+
timestamp.is_a?(BigDecimal) ? LogStash::Timestamp.at(timestamp.to_i, timestamp.frac * 1000000) : LogStash::Timestamp.at(timestamp)
|
247
249
|
end
|
248
250
|
|
249
251
|
def self.parse(json)
|
data/logstash-input-gelf.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-input-gelf'
|
4
|
-
s.version = '3.3.
|
4
|
+
s.version = '3.3.2'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Reads GELF-format messages from Graylog2 as events"
|
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"
|
data/spec/inputs/gelf_spec.rb
CHANGED
@@ -176,9 +176,9 @@ describe LogStash::Inputs::Gelf do
|
|
176
176
|
|
177
177
|
context "BigDecimal numeric values" do
|
178
178
|
it "should coerce and preserve millisec precision in iso8601" do
|
179
|
-
expect(LogStash::Inputs::Gelf.coerce_timestamp(BigDecimal.new("946702800.1"))
|
180
|
-
expect(LogStash::Inputs::Gelf.coerce_timestamp(BigDecimal.new("946702800.12"))
|
181
|
-
expect(LogStash::Inputs::Gelf.coerce_timestamp(BigDecimal.new("946702800.123"))
|
179
|
+
expect(LogStash::Inputs::Gelf.coerce_timestamp(BigDecimal.new("946702800.1"))).to be_a_logstash_timestamp_equivalent_to("2000-01-01T05:00:00.100Z")
|
180
|
+
expect(LogStash::Inputs::Gelf.coerce_timestamp(BigDecimal.new("946702800.12"))).to be_a_logstash_timestamp_equivalent_to("2000-01-01T05:00:00.120Z")
|
181
|
+
expect(LogStash::Inputs::Gelf.coerce_timestamp(BigDecimal.new("946702800.123"))).to be_a_logstash_timestamp_equivalent_to("2000-01-01T05:00:00.123Z")
|
182
182
|
end
|
183
183
|
|
184
184
|
it "should coerce and preserve usec precision" do
|
@@ -206,7 +206,12 @@ describe LogStash::Inputs::Gelf do
|
|
206
206
|
|
207
207
|
it "should coerce float numeric value and preserve milliseconds precision in iso8601" do
|
208
208
|
event = LogStash::Inputs::Gelf.new_event("{\"timestamp\":946702800.123}", "dummy")
|
209
|
-
expect(event.timestamp
|
209
|
+
expect(event.timestamp).to be_a_logstash_timestamp_equivalent_to("2000-01-01T05:00:00.123Z")
|
210
|
+
end
|
211
|
+
|
212
|
+
it "should coerce exponent-notation timestamps" do
|
213
|
+
event = LogStash::Inputs::Gelf.new_event("{\"timestamp\":1.660873462488E13}", "dummy")
|
214
|
+
expect(event.timestamp).to be_a_logstash_timestamp_equivalent_to("+528279-11-06T19:48:00Z")
|
210
215
|
end
|
211
216
|
|
212
217
|
it "should coerce float numeric value and preserve usec precision" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-gelf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|