How to copy SQL Server data to Elasticsearch using LogStash

As a developer working with SQL Server there is a need to import data from the database to Elasticsearch and analyze data in Kibana


The JDBC input plugin is your best bet, to do this with Logstash. This input plugin even has built-in support to set the import schedule.

If this isn't flexible enough, another option is to build a small script using one of the Elasticsearch client libraries.

here is example

input {
    jdbc {
        jdbc_validate_connection => false
        jdbc_driver_class => ""
        jdbc_connection_string => "jdbc:sqlserver://server_name;databaseName=db_name;user=username;password=password;"
        jdbc_user => "username"
        jdbc_password => "password"
        statement => "select * from db_name.table_view_name"
        schedule => "00 06 * * *"

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