I added a jdbc input to my config files:
input {
jdbc {
jdbc_driver_library => "/usr/share/java/postgresql94-jdbc.jar"
jdbc_driver_class => "org.postgresql.Driver"
jdbc_connection_string => "jdbc:postgresql://psqlhost:5432/mydb"
jdbc_user => "myuser"
jdbc_password => "mypass"
jdbc_validate_connection => "true"
# schedule => "* 6 * * *"
statement => "select stuff from table"
add_field => {
"index" => "jdbc"
"type" => "RequestCreated"
}
}
}
And the following ES output config:
output {
if [type] == "RequestCreated" {
elasticsearch {
hosts => [ "localhost" ]
index => "%{index}-%{+YYYY.MM.dd}"
document_type => "%{type}"
document_id => "%{requestid}"
}
}
}
I also created an index using a field from my DB table that gets updated every time a record gets updated.
As far as I can understand, this SELECT should only run once, but I keep seeing new data in Kibana. Where is it coming from? Is there a default schedule? Documentation says when no schedule is specified, SELECT will only run on logstash restart.
Thanks.