# Multiples inputs and outputs jdbc

**URL:** https://discuss.elastic.co/t/multiples-inputs-and-outputs-jdbc/205687
**Category:** Logstash
**Created:** [October 29, 2019, 2:14pm UTC](https://discuss.elastic.co/t/multiples-inputs-and-outputs-jdbc/205687 "2019-10-29T14:14:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Rafael\_Almeida1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafael_almeida1/32/56779_2.png) [@Rafael\_Almeida1](https://discuss.elastic.co/u/Rafael_Almeida1)
#### Post date: [October 29, 2019, 2:14pm UTC](https://discuss.elastic.co/t/multiples-inputs-and-outputs-jdbc/205687/1 "2019-10-29T14:14:42Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [October 29, 2019, 3:52pm UTC](https://discuss.elastic.co/t/multiples-inputs-and-outputs-jdbc/205687/2 "2019-10-29T15:52:57Z")

</div>

> [@Rafael\_Almeida1](#):
>
> 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.

---

<div class="post-metadata">

### Author: ![Rafael\_Almeida1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafael_almeida1/32/56779_2.png) [@Rafael\_Almeida1](https://discuss.elastic.co/u/Rafael_Almeida1)
#### Post date: [October 29, 2019, 4:35pm UTC](https://discuss.elastic.co/t/multiples-inputs-and-outputs-jdbc/205687/3 "2019-10-29T16:35:37Z")

</div>

> [@Badger](#):
>
> 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?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [November 26, 2019, 4:35pm UTC](https://discuss.elastic.co/t/multiples-inputs-and-outputs-jdbc/205687/4 "2019-11-26T16:35:49Z")

</div>

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