logstash-codec-es_bulk 3.0.2 → 3.0.3

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
  SHA1:
3
- metadata.gz: e54e383cc62a1254a145410b0da60b8e8961ffbc
4
- data.tar.gz: cbf7a8a5f2bcea1eb3c2d31c5133122a07221ef9
3
+ metadata.gz: 72a098a373cb83cf18c229661c69753ed7a4311b
4
+ data.tar.gz: 3aa8450510fbc6d956eaf51cb0b6f8ed24bf3d22
5
5
  SHA512:
6
- metadata.gz: 9de5248b83a5fab4febf51f94b629d8c5f1d9dc02a3dc914523f1406aba9cfa1ed04ed17fdb79f030386594bf466ce175ad977b089c3ada95a78e16699f7e505
7
- data.tar.gz: 49907ea930d51d72a2bacc8a47715556170425de8b8126a6f67638b4a8724372596f6c3d5ee7dfc6e63d2f9928e0fc9bfc04091c1da58ba909a44ff63e7d069f
6
+ metadata.gz: 201e15ca1ca99f84c44ef0069db7f7b0b19fc009cc2f783713e9679c1a5e7236b8a36d71071022edb0ff7754b1ebd837efb397ca799dbd038c60299b7689b795
7
+ data.tar.gz: 1f8e14e0650b248816e74c5855c4b51405d4d60d535e5817e748b1785bc656f98ab2878aeb568cd07edfc08b9a894479696b699a6ae66b9c6811f6f85550f104
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.0.3
2
+ - Fixed issue with large bulk requests that were split into multiple chunks, which caused it to lose it's place in the decoding
3
+
1
4
  ## 3.0.2
2
5
  - Relax constraint on logstash-core-plugin-api to >= 1.60 <= 2.99
3
6
 
@@ -16,30 +16,30 @@ class LogStash::Codecs::ESBulk < LogStash::Codecs::Base
16
16
  super(params)
17
17
  @lines = LogStash::Codecs::Line.new
18
18
  @lines.charset = "UTF-8"
19
+ @state = :initial
20
+ @metadata = Hash.new
19
21
  end
20
22
 
21
23
  public
22
24
  def decode(data)
23
- state = :initial
24
- metadata = Hash.new
25
25
  @lines.decode(data) do |bulk|
26
26
  begin
27
27
  line = LogStash::Json.load(bulk.get("message"))
28
- case state
28
+ case @state
29
29
  when :metadata
30
30
  event = LogStash::Event.new(line)
31
- event.set("@metadata", metadata)
31
+ event.set("@metadata", @metadata)
32
32
  yield event
33
- state = :initial
33
+ @state = :initial
34
34
  when :initial
35
- metadata = line[line.keys[0]]
36
- metadata["action"] = line.keys[0].to_s
37
- state = :metadata
35
+ @metadata = line[line.keys[0]]
36
+ @metadata["action"] = line.keys[0].to_s
37
+ @state = :metadata
38
38
  if line.keys[0] == 'delete'
39
39
  event = LogStash::Event.new()
40
- event.set("@metadata", metadata)
40
+ event.set("@metadata", @metadata)
41
41
  yield event
42
- state = :initial
42
+ @state = :initial
43
43
  end
44
44
  end
45
45
  rescue LogStash::Json::ParserError => e
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-codec-es_bulk'
4
- s.version = '3.0.2'
4
+ s.version = '3.0.3'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "This codec decodes messages received in the Elasticsearch bulk format"
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-es_bulk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-14 00:00:00.000000000 Z
11
+ date: 2016-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  requirements: []
97
97
  rubyforge_project:
98
- rubygems_version: 2.6.3
98
+ rubygems_version: 2.4.8
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: This codec decodes messages received in the Elasticsearch bulk format