0

Currently trying to populate the employee index with the below settings:

CONF

input {
  jdbc {
    jdbc_driver_library => "~/sqljdbc_6.2/enu/mssql-jdbc-6.2.1.jre8.jar"
    jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
    jdbc_connection_string => "jdbc:sqlserver://SERVER;user=USER;password=PASSWORD"
    jdbc_user => "DB_USER"
    jdbc_password => "DB_PASSWORD"
    jdbc_validate_connection => true
    jdbc_validation_timeout => -1
    statement => "SELECT * FROM [dbo].Employee ORDER BY ID"
    type => "employee"
  }
}
filter {
}
output {
}

NOTE: filter and output sections of the conf file is purposely blank

LINUX COMMAND

sudo /usr/share/logstash/bin/logstash -f /home/ubuntu/Employee-pipeline.conf --path.settings /etc/logstash/ --path.data /var/lib/logstash_new

RESULT enter image description here Looks like logstash does not know or don't have access to ~/sqljdbc...*.jar

I also confirmed that the mssql-jdbc-6.2.1.jre8.jar exists enter image description here

However, when I changed the path to /home/ubuntu/sqljdbc_6.2/enu/mssql-jdbc-6.2.1.jre8.jar, it runs successfully.

So ~/ is the same as /home/ubuntu

This started to occur after upgrading our Elastic Stack from v5.5 to v5.6. Also, note that this does not occur if we run the same conf file with the logstash service.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
lionheart
  • 423
  • 2
  • 4
  • 17
  • remove the quotes around the tilde: ~"/sqljdbc_6.2/enu/mssql-jdbc-6.2.1.jre8.jar". See the difference between `sudo echo ~` and `sudo echo "~"` –  Nov 07 '19 at 14:28
  • @Roadowl `sudo echo ~/sqljdbc...` results to `/home/ubuntu/sqljdbc...` while `sudo echo "~/sqljdbc..."` results to `~/sqljdbc...`. The .conf file contains JSON format so I think having quotes there is fine. – lionheart Nov 07 '19 at 15:38

0 Answers0