# Indexing varbinary column in SQL Server

**URL:** <https://discuss.elastic.co/t/indexing-varbinary-column-in-sql-server/189545>\
**Category:** Elasticsearch\
**Created:** [July 9, 2019, 12:30pm UTC](https://discuss.elastic.co/t/indexing-varbinary-column-in-sql-server/189545 "2019-07-09T12:30:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhetland](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@bhetland](https://discuss.elastic.co/u/bhetland)\
**Post date:** [July 9, 2019, 12:30pm UTC](https://discuss.elastic.co/t/indexing-varbinary-column-in-sql-server/189545/1 "2019-07-09T12:30:43Z")

</div>

Hi,

I have installed Elasticsearch, Logstash, Kibana, and the SQL JDBC driver.

All of these things run and I have created an index and have used Logstash to index a SQL Server table. I've then used Kibana to query the index. All of this works perfectly for a table that does NOT have a varbinary column.

**PROBLEM**  
If I create a new index and try to populate it from a SQL Server table that has a varbinary column, logstash reports the error below. Note, if I populate my index from all fields in that table EXCEPT the varbinary column, it works as expected.

```
[2019-07-09T07:55:01,869][ERROR][logstash.outputs.elasticsearch] An unknown error occurred sending a bulk request to Elasticsearch. We will retry indefinitely 
{:error_message=>"\"\\xE4\" from ASCII-8BIT to UTF-8", 
:error_class=>"LogStash::Json::GeneratorError", 
:backtrace=>["C:/Cabinet/Downloads/ElasticSearch/logstash-7.2.0/logstash-core/lib/logstash/json.rb:27:in `jruby_dump'",
 "C:/Cabinet/Downloads/ElasticSearch/logstash-7.2.0/vendor/bundle/jruby/2.5.0/gems/logstash-output-elasticsearch-10.1.0-java/lib/logstash/outputs/elasticsearch/http_client.rb:119:in `block in bulk'",
 "org/jruby/RubyArray.java:2577:in `map'", "C:/Cabinet/Downloads/ElasticSearch/logstash-7.2.0/vendor/bundle/jruby/2.5.0/gems/logstash-output-elasticsearch-10.1.0-java/lib/logstash/outputs/elasticsearch/http_client.rb:119:in `block in bulk'", "org/jruby/RubyArray.java:1792:in `each'",
 "C:/Cabinet/Downloads/ElasticSearch/logstash-7.2.0/vendor/bundle/jruby/2.5.0/gems/logstash-output-elasticsearch-10.1.0-java/lib/logstash/outputs/elasticsearch/http_client.rb:117:in `bulk'",
 "C:/Cabinet/Downloads/ElasticSearch/logstash-7.2.0/vendor/bundle/jruby/2.5.0/gems/logstash-output-elasticsearch-10.1.0-java/lib/logstash/outputs/elasticsearch/common.rb:296:in `safe_bulk'",
 "C:/Cabinet/Downloads/ElasticSearch/logstash-7.2.0/vendor/bundle/jruby/2.5.0/gems/logstash-output-elasticsearch-10.1.0-java/lib/logstash/outputs/elasticsearch/common.rb:201:in `submit'",
 "C:/Cabinet/Downloads/ElasticSearch/logstash-7.2.0/vendor/bundle/jruby/2.5.0/gems/logstash-output-elasticsearch-10.1.0-java/lib/logstash/outputs/elasticsearch/common.rb:169:in `retrying_submit'",
 "C:/Cabinet/Downloads/ElasticSearch/logstash-7.2.0/vendor/bundle/jruby/2.5.0/gems/logstash-output-elasticsearch-10.1.0-java/lib/logstash/outputs/elasticsearch/common.rb:38:in `multi_receive'",
 "org/logstash/config/ir/compiler/OutputStrategyExt.java:118:in `multi_receive'", "org/logstash/config/ir/compiler/AbstractOutputDelegatorExt.java:101:in `multi_receive'",
 "C:/Cabinet/Downloads/ElasticSearch/logstash-7.2.0/logstash-core/lib/logstash/java_pipeline.rb:239:in `block in start_workers'"]}

```

**QUESTION**  
Is it possible to populate an Elasticsearch index with varbinary data in a SQL Server table? The binary data is from MS Office documents, PDF's, etc.  
Or, do those files need to reside on the file system (as actual .docx, xlsx, pdf) files?

**Miscellaneous Info**  
Thinking it would somehow be useful, I've created an attachment processor pipeline, following these instructions:

[Attachment Processing Pipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/current/using-ingest-attachment.html)

But I guess I don't know how to use that pipeline. So if using that pipeline is the key to solving my problem, I could use instructions on how to use that pipeline.

I'm a total novice at this, so take that into consideration when replying (in other words, the more info you give, the better).

Thanks, Brent

---

<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:** [August 6, 2019, 12:30pm UTC](https://discuss.elastic.co/t/indexing-varbinary-column-in-sql-server/189545/2 "2019-08-06T12:30:57Z")

</div>

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