# Multiline codec and JDBC

**URL:** <https://discuss.elastic.co/t/multiline-codec-and-jdbc/49727>\
**Category:** Logstash\
**Created:** [May 11, 2016, 6:57am UTC](https://discuss.elastic.co/t/multiline-codec-and-jdbc/49727 "2016-05-11T06:57:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![berguiz1](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@berguiz1](https://discuss.elastic.co/u/berguiz1)\
**Post date:** [May 11, 2016, 6:57am UTC](https://discuss.elastic.co/t/multiline-codec-and-jdbc/49727/1 "2016-05-11T06:57:53Z")

</div>

Hello everybody,  
I'm trying to use the multiline codec with the ids of rows from a table (Database).  
i've an input plugin with JDBC which give me some rows with same id (because of the SQL query).  
I would like to process these rows by block which have the same id because i want to create a document in ElasticSearch not for each row but for each id.  
Thanks in advance for yours answers.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 12, 2016, 12:08am UTC](https://discuss.elastic.co/t/multiline-codec-and-jdbc/49727/2 "2016-05-12T00:08:44Z")

</div>

Maybe if you can provide an example of your config and data we can help.

---

<div class="post-metadata">

**Author:** ![berguiz1](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@berguiz1](https://discuss.elastic.co/u/berguiz1)\
**Post date:** [May 12, 2016, 7:03am UTC](https://discuss.elastic.co/t/multiline-codec-and-jdbc/49727/3 "2016-05-12T07:03:46Z")

</div>

Hello warkolm,  
Yes I can give more details about my problem. So, here is an exemple of my .conf file with Logstash :

```
input {
	jdbc {
            jdbc_connection_string => "jdbc:oracle:thin:@..."
            jdbc_user => "..."
    	    jdbc_password => "..."
            jdbc_driver_library => "ojdbc7.jar"
            jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
            statement_filepath => "query.sql"
	}
}

filter {
...
}

output {
    elasticsearch {
        index => "..."
        hosts => "..."
        action => "..."
        document_type => "..."
        document_id => "%{id}"
    }
}

```

Because of relations in my database, the query give me some rows with the same identifiant (it's an exemple):  
id1, data1, data2  
id1, data1', data2'  
id1, data1'', data2''  
id2, data1, data2  
id2, data1', data2'

Each row is an event but I would like process the rows with the same identifiant together (by block). In my mind, I can't use a pattern because I look for an exact value.

---

<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:** [July 6, 2017, 4:57am UTC](https://discuss.elastic.co/t/multiline-codec-and-jdbc/49727/4 "2017-07-06T04:57:56Z")

</div>


