I have used this config file to perform joins on two tables. I used jdbc static filter plug in .When i run logstash it terminates.
input {
}
filter {
jdbc_static {
loaders => [
{
id => "tbl_farmer"
query => "select farmerid from tbl_farmer"
local_table => "localfarmer"
},
{
id => "tbl_cultivation"
query => "select cultivationid,farmerid from tbl_cultivation"
local_table => "localcultivation"
}
]
local_db_objects => [
{
name => "localfarmer"
index_columns => ["farmerid"]
columns => [
["farmerid", "int"]
]
},
{
name => "localcultivation"
index_columns => ["cultivationid"]
columns => [
["cultivationid", "int"],
["farmerid", "int"]
]
}
]
local_lookups => [
{
query => "select localfarmer.farmerid as fname,localcultivation.cultivationid as culname from localfarmer inner join localcultivation on localfarmer.farmerid=localcultivation.farmerid"
target => "server"
}
]
add_field => { farmmnme => "%{[server][0][fname]}" }
add_field => { farmname => "%{[server][1][culname]}" }
jdbc_connection_string => "jdbc:sqlserver://L-MANJURG4067;databaseName=Cultivation;integratedSecurity=true;"
jdbc_driver_library => "C:\Users\manjur.gani\Desktop\ElasticSearch\sqljdbc_6.4\enu\mssql-jdbc-6.4.0.jre8.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
}
}
output{
stdout { codec => rubydebug { metadata => true } }
elasticsearch {
hosts => ["localhost:9200"]
index => "demopoc1"
}
}