logstash-codec-bulk_es 0.1.0 → 0.1.1

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: 4bf843e99d1cd0f40e0bc5f9cbf5d431a6a0a90a
4
- data.tar.gz: b16327622ae87d902bb6339e5fa2524d6804fec8
3
+ metadata.gz: 44cdb572191ef2068b39fff37f87d1eaf4717645
4
+ data.tar.gz: 84cc6646da86bb301b4b75d776217104be74d1a0
5
5
  SHA512:
6
- metadata.gz: 095a998c780e1549c6627365d78d7b1d873aa3627f9d081e0646f5759ecf70be8697580e9fe488e845e655655a88f76d5125290d13f37e1ee216d2804372c574
7
- data.tar.gz: 21b4f9161515b24610e2d0db25e0a1fddb588b5a04a1cd46a990027ccf30f9cc4de95677b073228900672cb44abedd32decab32a3922b88f7da6ddbd61539981
6
+ metadata.gz: fde5ab13408ff4e8f0124fb047bda9a564ee121c39899b29143f8e6f222721614a31c341de950bbd89af9b5ea61985ba17373ca2321e14b59172e99850565e42
7
+ data.tar.gz: 732dce625eb78d10ea236783a0471f2fbd1d9dcf52bf06c7727b1eb5f7d80c95fca1bb99317949e50832b857eb6cbddaf04898706b1616a10b527065af14d7e5
@@ -24,7 +24,15 @@ class LogStash::Codecs::BulkEs < LogStash::Codecs::Base
24
24
  line = LogStash::Json.load(bulk_message.get("message"))
25
25
  case @state
26
26
  when :metadata
27
- event = LogStash::Event.new(line)
27
+ if @metadata["action"] == 'update'
28
+ if line.has_key?("doc")
29
+ event = LogStash::Event.new(line["doc"])
30
+ elsif
31
+ event = LogStash::Event.new(line)
32
+ end
33
+ elsif
34
+ event = LogStash::Event.new(line)
35
+ end
28
36
  event.set("@metadata", @metadata)
29
37
  yield event
30
38
  @state = :start
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-codec-bulk_es'
3
- s.version = '0.1.0'
3
+ s.version = '0.1.1'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = 'This codec decodes messages received in the Elasticsearch bulk format'
6
6
  s.description = ''
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-codec-bulk_es
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''