logstash-codec-json_lines 3.2.0 → 3.2.2

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
  SHA256:
3
- metadata.gz: d755546df11b55f67fe5d75b1062988fc8acf5f04883c0843d4dc4b67ee6e110
4
- data.tar.gz: a3377cb9ba69e200724f4552db30541a67dd0a5174126158ce172a99e573e0d8
3
+ metadata.gz: b6144dd055fd15fde7daf27092041711f2a7ca16057cca37a5744ca665d37482
4
+ data.tar.gz: 8ea744258a3705fc9a0fe88f56e93a4bbde4bae76e8d163bc2134746356560d9
5
5
  SHA512:
6
- metadata.gz: a2d11e5da18e6ab3b478122a06e4bb247f864e5921888a9e4dd8d52a963a1389a2d2b9f9812f09dcef8284006a71b97be86b62961d25d0007b3c4aee4109e199
7
- data.tar.gz: fbbb593297ad8fc1090f98da984c1e894ec0013b84aa1eb5fdae767e2ac89093366a1e8ecddbef6c304d65cf134ca3d3961fa40b7aabf01b1991453d613660ca
6
+ metadata.gz: ba3dd43f634c7d5dc216e8f361d3b086172d8350cce52704926ecdf9eec5506e256adc5b6e05bb3265f93056cf6417f9e02f94ab0dc155cae1c67f5305a57413
7
+ data.tar.gz: 905e268a78ff9c47ce2bf9cb92a540d66a5f2bb270e2fc10d8052e823e9054ebf8ceff98b26dcf7dd6234b898a0e66e7cdaa2752f7bda4808731c49976d981eb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 3.2.2
2
+ - Fix: updated the way to check if the `decode_size_limit_bytes` has been explicitly customised. [#47](https://github.com/logstash-plugins/logstash-codec-json_lines/pull/47)
3
+
4
+ ## 3.2.1
5
+ - Raise the default value of `decode_size_limit_bytes` up to 512 MB. [#46](https://github.com/logstash-plugins/logstash-codec-json_lines/pull/46)
6
+
1
7
  ## 3.2.0
2
8
  - Add decode_size_limit_bytes option to limit the maximum size of each JSON line that can be parsed.[#43](https://github.com/logstash-plugins/logstash-codec-json_lines/pull/43)
3
9
 
data/docs/index.asciidoc CHANGED
@@ -35,6 +35,7 @@ Therefore this codec cannot work with line oriented inputs.
35
35
  |=======================================================================
36
36
  |Setting |Input type|Required
37
37
  | <<plugins-{type}s-{plugin}-charset>> |<<string,string>>, one of `["ASCII-8BIT", "UTF-8", "US-ASCII", "Big5", "Big5-HKSCS", "Big5-UAO", "CP949", "Emacs-Mule", "EUC-JP", "EUC-KR", "EUC-TW", "GB2312", "GB18030", "GBK", "ISO-8859-1", "ISO-8859-2", "ISO-8859-3", "ISO-8859-4", "ISO-8859-5", "ISO-8859-6", "ISO-8859-7", "ISO-8859-8", "ISO-8859-9", "ISO-8859-10", "ISO-8859-11", "ISO-8859-13", "ISO-8859-14", "ISO-8859-15", "ISO-8859-16", "KOI8-R", "KOI8-U", "Shift_JIS", "UTF-16BE", "UTF-16LE", "UTF-32BE", "UTF-32LE", "Windows-31J", "Windows-1250", "Windows-1251", "Windows-1252", "IBM437", "IBM737", "IBM775", "CP850", "IBM852", "CP852", "IBM855", "CP855", "IBM857", "IBM860", "IBM861", "IBM862", "IBM863", "IBM864", "IBM865", "IBM866", "IBM869", "Windows-1258", "GB1988", "macCentEuro", "macCroatian", "macCyrillic", "macGreek", "macIceland", "macRoman", "macRomania", "macThai", "macTurkish", "macUkraine", "CP950", "CP951", "IBM037", "stateless-ISO-2022-JP", "eucJP-ms", "CP51932", "EUC-JIS-2004", "GB12345", "ISO-2022-JP", "ISO-2022-JP-2", "CP50220", "CP50221", "Windows-1256", "Windows-1253", "Windows-1255", "Windows-1254", "TIS-620", "Windows-874", "Windows-1257", "MacJapanese", "UTF-7", "UTF8-MAC", "UTF-16", "UTF-32", "UTF8-DoCoMo", "SJIS-DoCoMo", "UTF8-KDDI", "SJIS-KDDI", "ISO-2022-JP-KDDI", "stateless-ISO-2022-JP-KDDI", "UTF8-SoftBank", "SJIS-SoftBank", "BINARY", "CP437", "CP737", "CP775", "IBM850", "CP857", "CP860", "CP861", "CP862", "CP863", "CP864", "CP865", "CP866", "CP869", "CP1258", "Big5-HKSCS:2008", "ebcdic-cp-us", "eucJP", "euc-jp-ms", "EUC-JISX0213", "eucKR", "eucTW", "EUC-CN", "eucCN", "CP936", "ISO2022-JP", "ISO2022-JP2", "ISO8859-1", "ISO8859-2", "ISO8859-3", "ISO8859-4", "ISO8859-5", "ISO8859-6", "CP1256", "ISO8859-7", "CP1253", "ISO8859-8", "CP1255", "ISO8859-9", "CP1254", "ISO8859-10", "ISO8859-11", "CP874", "ISO8859-13", "CP1257", "ISO8859-14", "ISO8859-15", "ISO8859-16", "CP878", "MacJapan", "ASCII", "ANSI_X3.4-1968", "646", "CP65000", "CP65001", "UTF-8-MAC", "UTF-8-HFS", "UCS-2BE", "UCS-4BE", "UCS-4LE", "CP932", "csWindows31J", "SJIS", "PCK", "CP1250", "CP1251", "CP1252", "external", "locale"]`|No
38
+ | <<plugins-{type}s-{plugin}-decode_size_limit_bytes>> |<<string,string>>|No
38
39
  | <<plugins-{type}s-{plugin}-delimiter>> |<<string,string>>|No
39
40
  | <<plugins-{type}s-{plugin}-ecs_compatibility>> |<<string,string>>|No
40
41
  | <<plugins-{type}s-{plugin}-target>> |<<string,string>>|No
@@ -58,6 +59,14 @@ actual encoding of the text and logstash will convert it for you.
58
59
 
59
60
  For nxlog users, you'll want to set this to `CP1252`
60
61
 
62
+ [id="plugins-{type}s-{plugin}-decode_size_limit_bytes"]
63
+ ===== `decode_size_limit_bytes`
64
+
65
+ * Value type is <<string,string>>
66
+ * Default value is 512 MB
67
+
68
+ Maximum number of bytes for a single line before stop processing.
69
+
61
70
  [id="plugins-{type}s-{plugin}-delimiter"]
62
71
  ===== `delimiter`
63
72
 
@@ -28,6 +28,8 @@ class LogStash::Codecs::JSONLines < LogStash::Codecs::Base
28
28
 
29
29
  config_name "json_lines"
30
30
 
31
+ DEFAULT_DECODE_SIZE_LIMIT_BYTES = 512 * (1024 * 1024)
32
+
31
33
  # The character encoding used in this codec. Examples include `UTF-8` and
32
34
  # `CP1252`
33
35
  #
@@ -43,9 +45,9 @@ class LogStash::Codecs::JSONLines < LogStash::Codecs::Base
43
45
  config :delimiter, :validate => :string, :default => "\n"
44
46
 
45
47
  # Maximum number of bytes for a single line before a fatal exception is raised
46
- # which will stop Logsash.
47
- # The default is 20MB which is quite large for a JSON document
48
- config :decode_size_limit_bytes, :validate => :number, :default => 20 * (1024 * 1024) # 20MB
48
+ # which will stop Logstash.
49
+ # The default is 512MB which is quite large for a JSON document
50
+ config :decode_size_limit_bytes, :validate => :number, :default => DEFAULT_DECODE_SIZE_LIMIT_BYTES # 512MB
49
51
 
50
52
  # Defines a target field for placing decoded fields.
51
53
  # If this setting is omitted, data gets stored at the root (top level) of the event.
@@ -55,6 +57,9 @@ class LogStash::Codecs::JSONLines < LogStash::Codecs::Base
55
57
  public
56
58
 
57
59
  def register
60
+ if original_params['decode_size_limit_bytes'].nil?
61
+ deprecation_logger.deprecated "The default value for `decode_size_limit_bytes`, currently at 512Mb, will be lowered in a future version to prevent Out of Memory errors from abnormally large messages or missing delimiters. Please set a value that reflects the largest expected message size (e.g. 20971520 for 20Mb)"
62
+ end
58
63
  @buffer = FileWatch::BufferedTokenizer.new(@delimiter, @decode_size_limit_bytes)
59
64
  @converter = LogStash::Util::Charset.new(@charset)
60
65
  @converter.logger = @logger
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-codec-json_lines'
4
- s.version = '3.2.0'
4
+ s.version = '3.2.2'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Reads and writes newline-delimited JSON"
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"
@@ -119,6 +119,7 @@ describe LogStash::Codecs::JSONLines, :ecs_compatibility_support do
119
119
  end
120
120
 
121
121
  describe "decode_size_limits_bytes" do
122
+ let(:codec_options) { { "decode_size_limit_bytes" => 20 * 1024 * 1024 } } # lower the default to avoid OOM errors in tests
122
123
  let(:maximum_payload) { "a" * subject.decode_size_limit_bytes }
123
124
 
124
125
  it "should not raise an error if the number of bytes is not exceeded" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-codec-json_lines
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-29 00:00:00.000000000 Z
11
+ date: 2024-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement