# Logstash jdbc pluging reconnecting attempts

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-pluging-reconnecting-attempts/172897>\
**Category:** Logstash\
**Created:** [March 19, 2019, 5:19am UTC](https://discuss.elastic.co/t/logstash-jdbc-pluging-reconnecting-attempts/172897 "2019-03-19T05:19:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahere37](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sahere37](https://discuss.elastic.co/u/sahere37)\
**Post date:** [March 19, 2019, 5:19am UTC](https://discuss.elastic.co/t/logstash-jdbc-pluging-reconnecting-attempts/172897/1 "2019-03-19T05:19:35Z")

</div>

hi all,  
I am using jdbc pluging, my scheduling of logstash conf file is as following:

input {  
jdbc {  
jdbc\_driver\_library =\> "sqljdbc42.jar"  
jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
jdbc\_connection\_string =\> "jdbc:sqlserver://localhost:3333;databaseName=Total"  
jdbc\_user =\> "**"  
jdbc\_password =\> "**"  
schedule =\> "30 9-23/1 \* \* \*"  
last\_run\_metadata\_path =\> "E:\logstashlog.my\_last\_run"  
statement =\> "  
DECLARE @DDate1 CHAR(10)  
select @DDate1=REPLACE(MAXpDate),'/','') from Total.dbo.Total\_Control  
select [BaseDate\_Accept\_Setel]  
from dbo.vw\_Total where (BaseDate\_Accept\_Setel \<= @DDate1) and (BaseDate\_Accept\_Setel \> :sql\_last\_value)  
"  
use\_column\_value =\> "true"  
tracking\_column =\> "basedate\_accept\_setel"  
}

after some times the connection failed and following error has been found.

```
[2019-03-14T17:17:05,619][ERROR][logstash.inputs.jdbc] Unable 
 to connect to database. Tried 1 times{:error_message=>"Java::ComMicrosoftSqlserverJdbc::SQLServerException: The TCP/IP connection to the host localhost, port 3333 has failed. Error: \"Connection timed out: no further information. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.\"."}

```

actually i want to logstash attempts to reconnect, it seems there are two parameters to handle this issue which are "connection\_retry\_attempts" and "connection\_retry\_attempts\_wait\_time". what is the best value for these parameters so that always attempts to reconnect to database?

---

<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:** [April 16, 2019, 5:19am UTC](https://discuss.elastic.co/t/logstash-jdbc-pluging-reconnecting-attempts/172897/2 "2019-04-16T05:19:48Z")

</div>

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