Skip to content
This repository has been archived by the owner on Jan 30, 2021. It is now read-only.

logstash 7.4.0 empty http body #21

Open
abogothy opened this issue Nov 25, 2019 · 2 comments
Open

logstash 7.4.0 empty http body #21

abogothy opened this issue Nov 25, 2019 · 2 comments

Comments

@abogothy
Copy link

abogothy commented Nov 25, 2019

Using logstash 7.4, output plugin sends an empty json doc only to clickhouse.

@GhOsTMZ
Copy link

GhOsTMZ commented Nov 29, 2019

Problem in mutate() function when you don't using mutations:

  def mutate( src )
    res = {}
    @mutations.each_pair do |dstkey, source|
      case source
        when String then
          scrkey = source
          next unless src.key?(scrkey)

          res[dstkey] = src[scrkey]
        when Array then
          scrkey = source[0]
          next unless src.key?(scrkey)
          pattern = source[1]
          replace = source[2]
          res[dstkey] = src[scrkey].sub( Regexp.new(pattern), replace )
      end
    end
    res
  end

I fixed it by adding line:

--- clickhouse.rb.old   2019-11-29 14:14:08.206871867 +0300
+++ clickhouse.rb       2019-11-29 14:12:30.039874141 +0300
@@ -127,6 +127,7 @@
   end
 
   def mutate( src )
+    return src if @mutations.empty?
     res = {}
     @mutations.each_pair do |dstkey, source|
       case source

@funcmike
Copy link
Owner

thx fix applied

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants