# Elastic Search My SQL Integration via LogStash

**URL:** <https://discuss.elastic.co/t/elastic-search-my-sql-integration-via-logstash/112644>\
**Category:** Logstash\
**Created:** [December 20, 2017, 1:51pm UTC](https://discuss.elastic.co/t/elastic-search-my-sql-integration-via-logstash/112644 "2017-12-20T13:51:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sg850r](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@sg850r](https://discuss.elastic.co/u/sg850r)\
**Post date:** [December 20, 2017, 1:51pm UTC](https://discuss.elastic.co/t/elastic-search-my-sql-integration-via-logstash/112644/1 "2017-12-20T13:51:23Z")

</div>

We are trying to use Elastic Search for search capabilities for our site. All data in in MySQL and we need this data copied to elastic search via LogStash.copied here is the conf file and log file . But when I run the logstash command I get a error saying : SSLConnectionSocketFactory not found in packages  
We have a hit a roadblock here and need pointers to overcome this error.  
Thanks  
Suman

config file:

# file: simple-out.conf

input {  
jdbc {  
# MySQL jdbc connection string to our database, mydb  
jdbc\_connection\_string =\> "jdbc:mysql://myip/mydatabase?useSSL=false"  
# The user we wish to execute our statement as  
jdbc\_user =\> "my user"  
jdbc\_password =\> "my pwd"  
# The path to our downloaded jdbc driver  
jdbc\_driver\_library =\> "C:\JavaDevelopment\TomcatServer\apache-tomcat-8.5.20\lib\mysql-connector-java-5.1.45-bin.jar"  
# The name of the driver class for Postgresql  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
# our query  
statement =\> "SELECT \* from testtable"  
jdbc\_paging\_enabled =\> "true"  
jdbc\_page\_size =\> "50000"  
}  
}  
output {  
stdout { codec =\> json\_lines }  
elasticsearch {   
hosts =\> "[http://localhost:9200](http://localhost:9200)"  
index =\> "test-migrate"  
document\_type =\> "data"   
ssl =\> "false"  
}

}

Log file:  
[2017-12-20T08:52:50,719][ERROR][logstash.pipeline] Pipeline aborted due to error {:pipeline\_id=\>"main", :exception=\>#\<NameError: SSLConnectionSocketFactory not found in packages org.apache.http.client.methods, org.apache.http.client.entity, org.apache.http.client.config, org.apache.http.config, org.apache.http.conn.socket, org.apache.http.impl, org.apache.http.impl.client, org.apache.http.impl.conn, org.apache.http.impl.auth, org.apache.http.entity, org.apache.http.message, org.apache.http.params, org.apache.http.protocol, org.apache.http.auth, java.util.concurrent, org.apache.http.client.protocol, org.apache.http.conn.ssl, java.security.cert, java.security.spec, java.security, org.apache.http.client.utils; last error: cannot load Java class org.apache.http.client.utils.SSLConnectionSocketFactory\>, :backtrace=\>["uri:classloader:/jruby/java/core\_ext/module.rb:45:in `const_missing'", "C:/JavaDevelopment/logstash-6.1.0/vendor/bundle/jruby/2.3.0/gems/manticore-0.6.1-java/lib/manticore/client.rb:603:in`ssl\_socket\_factory\_from\_options'", "C:/JavaDevelopment/logstash-6.1.0/vendor/bundle/jruby/2.3.0/gems/manticore-0.6.1-java/lib/manticore/client.rb:394:in `pool_builder'", "C:/JavaDevelopment/logstash-6.1.0/vendor/bundle/jruby/2.3.0/gems/manticore-0.6.1-java/lib/manticore/client.rb:402:in`pool'", "C:/JavaDevelopment/logstash-6.1.0/vendor/bundle/jruby/2.3.0/gems/manticore-0.6.1-java/lib/manticore/client.rb:208:in `initialize'", "C:/JavaDevelopment/logstash-6.1.0/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/http_client/manticore_adapter.rb:26:in`initialize'", "C:/JavaDevelopment/logstash-6.1.0/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/http\_client.rb:273:in `build_adapter'", "C:/JavaDevelopment/logstash-6.1.0/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/http_client.rb:277:in`build\_pool'", "C:/JavaDevelopment/logstash-6.1.0/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/http\_client.rb:60:in `initialize'", "C:/JavaDevelopment/logstash-6.1.0/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/http_client_builder.rb:101:in`create\_http\_client'", "C:/JavaDevelopment/logstash-6.1.0/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/http\_client\_builder.rb:97:in `build'", "C:/JavaDevelopment/logstash-6.1.0/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch.rb:230:in`build\_client'", "C:/JavaDevelopment/logstash-6.1.0/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/common.rb:24:in `register'", "C:/JavaDevelopment/logstash-6.1.0/logstash-core/lib/logstash/output_delegator_strategies/shared.rb:9:in`register'", "C:/JavaDevelopment/logstash-6.1.0/logstash-core/lib/logstash/output\_delegator.rb:43:in `register'", "C:/JavaDevelopment/logstash-6.1.0/logstash-core/lib/logstash/pipeline.rb:343:in`register\_plugin'", "C:/JavaDevelopment/logstash-6.1.0/logstash-core/lib/logstash/pipeline.rb:354:in `block in register_plugins'", "org/jruby/RubyArray.java:1734:in`each'", "C:/JavaDevelopment/logstash-6.1.0/logstash-core/lib/logstash/pipeline.rb:354:in `register_plugins'", "C:/JavaDevelopment/logstash-6.1.0/logstash-core/lib/logstash/pipeline.rb:743:in`maybe\_setup\_out\_plugins'", "C:/JavaDevelopment/logstash-6.1.0/logstash-core/lib/logstash/pipeline.rb:364:in `start_workers'", "C:/JavaDevelopment/logstash-6.1.0/logstash-core/lib/logstash/pipeline.rb:288:in`run'", "C:/JavaDevelopment/logstash-6.1.0/logstash-core/lib/logstash/pipeline.rb:248:in `block in start'"], :thread=\>"#\<Thread:0x1b103fad run\>"}  
[2017-12-20T08:52:50,777][ERROR][logstash.agent] Failed to execute action {:id=\>:main, :action\_type=\>LogStash::ConvergeResult::FailedAction, :message=\>"Could not execute action: LogStash::PipelineAction::Create/pipeline\_id:main, action\_result: false", :backtrace=\>nil}

---

<div class="post-metadata">

**Author:** ![arisbanach](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@arisbanach](https://discuss.elastic.co/u/arisbanach)\
**Post date:** [December 20, 2017, 3:26pm UTC](https://discuss.elastic.co/t/elastic-search-my-sql-integration-via-logstash/112644/2 "2017-12-20T15:26:01Z")

</div>

Might be a stupid question, but did you install the logstash-input-jdbc plugin?

---

<div class="post-metadata">

**Author:** ![sg850r](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@sg850r](https://discuss.elastic.co/u/sg850r)\
**Post date:** [December 20, 2017, 6:56pm UTC](https://discuss.elastic.co/t/elastic-search-my-sql-integration-via-logstash/112644/3 "2017-12-20T18:56:30Z")

</div>

the JDBC plugin that reads data from MySQL works perfectly. When I run logstash with the simple conf file to read data from MySQL and write to standard out it works. It doesnt work when using the elastic search plugin. It gives this cannot load Java class org.apache.http.client.utils.SSLConnectionSocketFactory ERROR.

---

<div class="post-metadata">

**Author:** ![arisbanach](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@arisbanach](https://discuss.elastic.co/u/arisbanach)\
**Post date:** [December 20, 2017, 7:11pm UTC](https://discuss.elastic.co/t/elastic-search-my-sql-integration-via-logstash/112644/4 "2017-12-20T19:11:26Z")

</div>

ah you mean it doesn't work when using the logstash-output-elasticsearch plugin? and that is installed too, right? can you try putting the "hosts" value in square brackets like `hosts => ["http://localhost:9200"]`?

---

<div class="post-metadata">

**Author:** ![sg850r](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@sg850r](https://discuss.elastic.co/u/sg850r)\
**Post date:** [December 20, 2017, 7:30pm UTC](https://discuss.elastic.co/t/elastic-search-my-sql-integration-via-logstash/112644/5 "2017-12-20T19:30:07Z")

</div>

Yes I tried using hosts =\> ["[http://localhost:9200](http://localhost:9200)"] ...but get same error . The logstash elastic search output plugin exists because it is able to read the parameters provided in elasticsearch {} output. I see the following error in log file:

[2017-12-20T14:25:08,269][ERROR][logstash.pipeline] Error registering plugin {:plugin=\>"#\<LogStash::OutputDelegator:0x4ad9024e @namespaced\_metric=#\<LogStash::Instrument::NamespacedMetric:0x173af7bf @metric=#\<LogStash::Instrument::Metric:0x7c8cb53d @collector=#\<LogStash::Instrument::Collector:0x2ab0d75d @agent=nil, @metric\_store=#\<LogStash::Instrument::MetricStore:0x28797b37 @store=#\<Concurrent:🗺0x00000000064380 entries=2 default\_proc=nil\>, @structured\_lookup\_mutex=#Mutex:0x68bee688, @fast\_lookup=#\<Concurrent:🗺0x00000000064384 entries=52 default\_proc=nil\>\>\>\>, @namespace\_name=[:stats, :pipelines, :main, :plugins, :outputs, :"18be2952e4128a38734de3ec0ab20ca289c76aa0-2"]\>, @metric=#\<LogStash::Instrument::NamespacedMetric:0x5d24b8bd @metric=#\<LogStash::Instrument::Metric:0x7c8cb53d @collector=#\<LogStash::Instrument::Collector:0x2ab0d75d @agent=nil, @metric\_store=#\<LogStash::Instrument::MetricStore:0x28797b37 @store=#\<Concurrent:🗺0x00000000064380 entries=2 default\_proc=nil\>, @structured\_lookup\_mutex=#Mutex:0x68bee688, @fast\_lookup=#\<Concurrent:🗺0x00000000064384 entries=52 default\_proc=nil\>\>\>\>, @namespace\_name=[:stats, :pipelines, :main, :plugins, :outputs]\>, @logger=#\<LogStash::Logging::Logger:0x2172fb1f @logger=#Java::OrgApacheLoggingLog4jCore::Logger:0x6cebd103\>, @out\_counter=LogStash::Instrument::MetricType::Counter - namespaces: [:stats, :pipelines, :main, :plugins, :outputs, :"18be2952e4128a38734de3ec0ab20ca289c76aa0-2", :events] key: out value: 0, @in\_counter=LogStash::Instrument::MetricType::Counter - namespaces: [:stats, :pipelines, :main, :plugins, :outputs, :"18be2952e4128a38734de3ec0ab20ca289c76aa0-2", :events] key: in value: 0, @strategy=#\<LogStash::OutputDelegatorStrategies::Shared:0x3cf3ff1e @output=\<LogStash::Outputs::ElasticSearch action=\>"index", index=\>"test-migrate", document\_type=\>"data", ssl=\>false, id=\>"18be2952e4128a38734de3ec0ab20ca289c76aa0-2", enable\_metric=\>true, codec=\>\<LogStash::Codecs::Plain id=\>"plain\_b0cdad17-e950-40cc-aad8-06117ef32f6d", enable\_metric=\>true, charset=\>"UTF-8"\>, workers=\>1, manage\_template=\>true, template\_name=\>"logstash", template\_overwrite=\>false, hosts=\>[[//127.0.0.1](https://127.0.0.1)], idle\_flush\_time=\>1, doc\_as\_upsert=\>false, script\_type=\>"inline", script\_lang=\>"painless", script\_var\_name=\>"event", scripted\_upsert=\>false, retry\_initial\_interval=\>2, retry\_max\_interval=\>64, retry\_on\_conflict=\>1, ssl\_certificate\_verification=\>true, sniffing=\>false, sniffing\_delay=\>5, timeout=\>60, pool\_max=\>1000, pool\_max\_per\_route=\>100, resurrect\_delay=\>5, validate\_after\_inactivity=\>10000, http\_compression=\>false\>\>, @id="18be2952e4128a38734de3ec0ab20ca289c76aa0-2", @time\_metric=LogStash::Instrument::MetricType::Counter - namespaces: [:stats, :pipelines, :main, :plugins, :outputs, :"18be2952e4128a38734de3ec0ab20ca289c76aa0-2", :events] key: duration\_in\_millis value: 0, @metric\_events=#\<LogStash::Instrument::NamespacedMetric:0xaef519c @metric=#\<LogStash::Instrument::Metric:0x7c8cb53d @collector=#\<LogStash::Instrument::Collector:0x2ab0d75d @agent=nil, @metric\_store=#\<LogStash::Instrument::MetricStore:0x28797b37 @store=#\<Concurrent:🗺0x00000000064380 entries=2 default\_proc=nil\>, @structured\_lookup\_mutex=#Mutex:0x68bee688, @fast\_lookup=#\<Concurrent:🗺0x00000000064384 entries=52 default\_proc=nil\>\>\>\>, @namespace\_name=[:stats, :pipelines, :main, :plugins, :outputs, :"18be2952e4128a38734de3ec0ab20ca289c76aa0-2", :events]\>, @output\_class=LogStash::Outputs::ElasticSearch\>", :error=\>"SSLConnectionSocketFactory not found in packages org.apache.http.client.methods, org.apache.http.client.entity, org.apache.http.client.config, org.apache.http.config, org.apache.http.conn.socket, org.apache.http.impl, org.apache.http.impl.client, org.apache.http.impl.conn, org.apache.http.impl.auth, org.apache.http.entity, org.apache.http.message, org.apache.http.params, org.apache.http.protocol, org.apache.http.auth, java.util.concurrent, org.apache.http.client.protocol, org.apache.http.conn.ssl, java.security.cert, java.security.spec, java.security, org.apache.http.client.utils; last error: cannot load Java class org.apache.http.client.utils.SSLConnectionSocketFactory"}  
[2017-12-20T14:25:08,278][ERROR][logstash.agent] Pipeline aborted due to error {:exception=\>#\<NameError: SSLConnectionSocketFactory not found in packages org.apache.http.client.methods, org.apache.http.client.entity, org.apache.http.client.config, org.apache.http.config, org.apache.http.conn.socket, org.apache.http.impl, org.apache.http.impl.client, org.apache.http.impl.conn, org.apache.http.impl.auth, org.apache.http.entity, org.apache.http.message, org.apache.http.params, org.apache.http.protocol, org.apache.http.auth, java.util.concurrent, org.apache.http.client.protocol, org.apache.http.conn.ssl, java.security.cert, java.security.spec, java.security, org.apache.http.client.utils; last error: cannot load Java class org.apache.http.client.utils.SSLConnectionSocketFactory\>, :backtrace=\>["file:/C:/JavaDevelopment/logstash-5.6.0/vendor/jruby/lib/jruby.jar!/jruby/java/core\_ext/module.rb:45:in `const_missing'", "C:/JavaDevelopment/logstash-5.6.0/vendor/bundle/jruby/1.9/gems/manticore-0.6.1-java/lib/manticore/client.rb:603:in`ssl\_socket\_factory\_from\_options'", "C:/JavaDevelopment/logstash-5.6.0/vendor/bundle/jruby/1.9/gems/manticore-0.6.1-java/lib/manticore/client.rb:394:in `pool_builder'", "C:/JavaDevelopment/logstash-5.6.0/vendor/bundle/jruby/1.9/gems/manticore-0.6.1-java/lib/manticore/client.rb:402:in`pool'", "C:/JavaDevelopment/logstash-5.6.0/vendor/bundle/jruby/1.9/gems/manticore-0.6.1-java/lib/manticore/client.rb:208:in `initialize'", "C:/JavaDevelopment/logstash-5.6.0/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.0-java/lib/logstash/outputs/elasticsearch/http_client/manticore_adapter.rb:26:in`initialize'", "C:/JavaDevelopment/logstash-5.6.0/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.0-java/lib/logstash/outputs/elasticsearch/http\_client.rb:272:in `build\_adapter'", "C:/JavaDevelopment/logstash-5.6.0/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.0-java/lib/logstash/outputs/elasticsearch]-

---

<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:** [January 17, 2018, 7:30pm UTC](https://discuss.elastic.co/t/elastic-search-my-sql-integration-via-logstash/112644/6 "2018-01-17T19:30:21Z")

</div>

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