I want to know if the jdbc input plugin allows me to query multiple tables where the second table runs only for a key value from the first. I presume the config would look something like...
input {
jdbc {
jdbc_driver_library => "c:\path\to\logstash\logstash-core\lib\jars\sqljdbc42.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://localhost:1433;databaseName=databaseName"
jdbc_user => "username"
jdbc_password => "password"
statement => "select * from table1"
type => "table1"
}
jdbc {
jdbc_driver_library => "c:\path\to\logstash\logstash-core\lib\jars\sqljdbc42.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://localhost:1433;databaseName=databaseName"
jdbc_user => "username"
jdbc_password => "password"
statement => "select * from table2 where parentid=" <<<table1.id>>>
type => "table2"
}
}
output {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "firstindex"
#user => "elastic"
#password => "changeme"
}
}
Is this possible? If not, is there a good alternative?