Multiples inputs and outputs jdbc

Hello, i'm trying to create a pipeline to fetch information from one table and insert / update into two other tables with only insert / update conditional on the second table if I successfully insert / update on the first table. In the sample code below I show what this pipeline would look like.

input {

jdbc {
    jdbc_connection_string => "databaseone"
    statement => "select values from tableone"
}

jdbc {
    jdbc_connection_string => "databasetwo"
    statement => "select tabletwo_flag from tabletwo"
}

}

output {

jdbc {
    connection_string => 'databasetwo'
    statement => [ "update/insert tabletwo values = ?, tabletwo_flag = ? where id = ?", "values", true, "id" ]    
}

if "tabletwo_flag" == true {
    jdbc {
        connection_string => 'databasetwo'
        statement => [ "update/insert tablethree values = ? where id = ?", "values", "id" ]    
    }
}

}

I want to know if it is possible to make this pipeline considering how logstash works.

You cannot make sending events to one output conditional upon the success of sending events to another output.

Understood! So in case can I create different pipelines to execute the pipeline mentioned above?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.