logstashlogstash-configurationlogstash-jdbc

Deploy Logstash in production environment


Hi all i have created a logstash config file scheduled every 5 minutes which transport data from MSSql sever to Elasticsearch and i run my logstash application using the windows powershell with the following command .\logstash-7.2.0\bin\logstash -f logstash.conf.txt

Logstash Config

input {
jdbc {
jdbc_driver_library => ""
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://xxxxxx\SQLEXPRESS:1433;databaseName=xxxx;"
jdbc_user => "xxxxx"
jdbc_password => "xxxx"
jdbc_paging_enabled => true
tracking_column => modified_date
use_column_value => true
clean_run => true
tracking_column_type => "timestamp"
schedule => "*/5 * * * * *"
statement => "SELECT * from [xxxxxxxx] where modified_date >:sql_last_value"
}
}

filter {
 mutate {
   remove_field => ["@version","@timestamp"]
 }
}

output {
elasticsearch {
hosts => "http://localhost:9200"
index => "employee"
document_type => "_doc"
document_id => "%{id}"

}
stdout { codec => rubydebug }
}

How to deploy the same thing in production environment? because in local machine i am using windows powershell to execute my commands how to achieve this in production environment?

Could anyone please guide how to deploy this as a service in production env?


Solution

  • Not sure I understand the question... Are you trying to deploy the same configuration in Linux server in production?

    If so, you should change jdbc_driver_class, and possibly also the jdbc_connection_string and hosts parameters, to match the production server.

    Check out also the following question: Set vm.max_map_count on cluster nodes It may be of help to you, though as I said I'm not sure.

    Good luck! :-)