Logstash Pipeline for Sql Server Varbinary Column

Hello Sir I am facing issue with Logstash Pipline WIth JDBC plug in
I have a task to insert data into elasticsearch with varbinary input.

This is my Conf file

input {
#columns_charset => { "column0" => "UTF8" }
jdbc {
jdbc_driver_library => "C:\Program Files\sqljdbc_10.2\enu\mssql-jdbc-10.2.1.jre11.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://localhost;DatabaseName=TestDB;user=sa;password=abcd@123;encrypt=true;trustServerCertificate=true;"
jdbc_user => "sa"
jdbc_password => "abcd@123"
columns_charset => { "photo" => "UTF-8"
#"photo" => "BINARY"
}
#*****************
#schedule => "*/5 * * * * *"
#use_column_value => true
#tracking_column => "pid_no"
clean_run => true
statement => "select top 1 * from PrisonerPicture"
}
}

output {
stdout { codec => "rubydebug"}
}

and the Output is this.

{
"photo" => "<Sequel::SQL::Blob:0x800 bytes=72041 start="\xFF\xD8\xFF\xE0\u0000\u0010JFIF" end="?J\xA8\u001C\xAB[\xF0\xAF\xFF\xD9"",
"downloaded" => "N",
"photo1" => nil,
"photo_date" => 2022-11-08T18:35:00Z,
"pid_no" => 987,
"@timestamp" => 2022-11-15T09:13:17.463030Z,
"@version" => "1"
}
[2022-11-15T14:43:17,717][INFO ][logstash.javapipeline ][main] Pipeline terminated {"pipeline.id"=>"main"}
[2022-11-15T14:43:17,888][INFO ][logstash.pipelinesregistry] Removed pipeline from registry successfully {:pipeline_id=>:main}
[2022-11-15T14:43:17,923][INFO ][logstash.runner ] Logstash shut down.

Column Photo is not producing the correct format.
Please help someone to resolve me this issue.

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