# Logstash Pipeline for Sql Server Varbinary Column

**URL:** <https://discuss.elastic.co/t/logstash-pipeline-for-sql-server-varbinary-column/318944>\
**Category:** Logstash\
**Tags:** jdbc\
**Created:** [November 15, 2022, 9:25am UTC](https://discuss.elastic.co/t/logstash-pipeline-for-sql-server-varbinary-column/318944 "2022-11-15T09:25:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArvindSarkania](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@ArvindSarkania](https://discuss.elastic.co/u/ArvindSarkania)\
**Post date:** [November 15, 2022, 9:25am UTC](https://discuss.elastic.co/t/logstash-pipeline-for-sql-server-varbinary-column/318944/1 "2022-11-15T09:25:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 13, 2022, 9:26am UTC](https://discuss.elastic.co/t/logstash-pipeline-for-sql-server-varbinary-column/318944/2 "2022-12-13T09:26:00Z")

</div>

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