JDBC plugin - issue getting binary data

I use the JDBC plugin to get data from a MSSQL database. Generally this is working but my query output includes MD5 hashes saved as binary, and then the output looks something like this in stdout (and even more gibberish in a file output, further resulting in an error sending the data to Elasticsearch)

"md5" => #<Sequel::SQL::Blob:0x120c bytes=16 content="\x04\xB7\xA42j3\x9Dv&\x1Fh\xE3L8\xC5\xEA">

I tried setting various columns_charset, but without success. What do I have to do to here?

Finally ChatGPT helped me to solve this with this function:

  ruby {
    code => '
      require "sequel"
      event.set("unpacked", event.get("md5").unpack("H*").first.force_encoding("UTF-8"))
    '
  }
1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.