# Load more than 1 million row from SQL Server to ES with Logstash JDBC

**URL:** <https://discuss.elastic.co/t/load-more-than-1-million-row-from-sql-server-to-es-with-logstash-jdbc/273563>\
**Category:** Logstash\
**Created:** [May 20, 2021, 4:16pm UTC](https://discuss.elastic.co/t/load-more-than-1-million-row-from-sql-server-to-es-with-logstash-jdbc/273563 "2021-05-20T16:16:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dai\_Thai\_Hoa\_Vo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dai_thai_hoa_vo/32/78486_2.png) [@Dai\_Thai\_Hoa\_Vo](https://discuss.elastic.co/u/Dai_Thai_Hoa_Vo)\
**Post date:** [May 20, 2021, 4:16pm UTC](https://discuss.elastic.co/t/load-more-than-1-million-row-from-sql-server-to-es-with-logstash-jdbc/273563/1 "2021-05-20T16:16:34Z")

</div>

Hi every one.  
I have one case that my table has more 1 million rows in SQL Server and I used logstash JDBC to load them to Elastic Search. It work fine but run very slow.  
This is my file config.

input {  
jdbc {  
jdbc\_driver\_library =\> "C:\ELK\elasticsearch-7.12.0-windows-x86\_64\elasticsearch-7.12.0\lib\sqljdbc\_9.2\enu\mssql-jdbc-9.2.1.jre8.jar"  
jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
jdbc\_connection\_string =\>"jdbc:sqlserver://BPHHP13:1433;databaseName=WRIPMS;"  
jdbc\_user =\> "test"  
jdbc\_password =\> "TuanTu2017@)!&"  
jdbc\_paging\_enabled =\> true  
clean\_run =\> true  
schedule =\> "\*/5 \* \* \* \* \*"  
statement =\> "select [countyId], [countyName], [modifiedDate] from Counties where [modifiedDate] \> :sql\_last\_value"  
use\_column\_value =\> true  
tracking\_column =\> "modifiedDate"  
lowercase\_column\_names =\> false  
}  
}  
output {  
elasticsearch{  
hosts =\> "[http://localhost:9200/](http://localhost:9200/)"  
index =\> "counties\_index"  
action =\> "update"  
doc\_as\_upsert =\> true  
document\_id =\> "%{countyId}"  
}  
stdout {  
codec =\> rubydebug  
}  
}

Please any one help me.  
Thank you.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 20, 2021, 6:30pm UTC](https://discuss.elastic.co/t/load-more-than-1-million-row-from-sql-server-to-es-with-logstash-jdbc/273563/2 "2021-05-20T18:30:56Z")

</div>

First of all, remove the stdout `output` plugin.  
Then you need to check what is actually slow. It could be reading the database.

I moved the question to #elastic-stack:logstash .

Finally please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

This is the icon to use if you are not using markdown format:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.  
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.  
Please update your post.

---

<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:** [June 17, 2021, 6:31pm UTC](https://discuss.elastic.co/t/load-more-than-1-million-row-from-sql-server-to-es-with-logstash-jdbc/273563/3 "2021-06-17T18:31:49Z")

</div>

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