# Can I pass data between 2 input plugin of logstash

**URL:** <https://discuss.elastic.co/t/can-i-pass-data-between-2-input-plugin-of-logstash/154851>\
**Category:** Logstash\
**Created:** [October 31, 2018, 1:26pm UTC](https://discuss.elastic.co/t/can-i-pass-data-between-2-input-plugin-of-logstash/154851 "2018-10-31T13:26:59Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick007](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@patrick007](https://discuss.elastic.co/u/patrick007)\
**Post date:** [October 31, 2018, 1:27pm UTC](https://discuss.elastic.co/t/can-i-pass-data-between-2-input-plugin-of-logstash/154851/1 "2018-10-31T13:27:00Z")

</div>

input {

kafka {

// Pass a value from kafka to jdbc input plugin  
}

jdbc {

}

}

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 31, 2018, 1:51pm UTC](https://discuss.elastic.co/t/can-i-pass-data-between-2-input-plugin-of-logstash/154851/2 "2018-10-31T13:51:54Z")

</div>

No, that is not possible. What is it you are looking to achieve?

---

<div class="post-metadata">

**Author:** ![patrick007](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@patrick007](https://discuss.elastic.co/u/patrick007)\
**Post date:** [October 31, 2018, 1:54pm UTC](https://discuss.elastic.co/t/can-i-pass-data-between-2-input-plugin-of-logstash/154851/3 "2018-10-31T13:54:39Z")

</div>

I want fetch a message (and index value (primary\_key of a table )) from Kafka Queue and pass this jdbc input so that i can query it and send the data to Elasticsearch

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 31, 2018, 1:58pm UTC](https://discuss.elastic.co/t/can-i-pass-data-between-2-input-plugin-of-logstash/154851/4 "2018-10-31T13:58:08Z")

</div>

How many records/documents would each query return? If you are simply looking up a value based on the key coming from Kafka, you may be able to use the [jdbc\_streaming](https://www.elastic.co/guide/en/logstash/current/plugins-filters-jdbc_streaming.html) plugin for this.

---

<div class="post-metadata">

**Author:** ![patrick007](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@patrick007](https://discuss.elastic.co/u/patrick007)\
**Post date:** [October 31, 2018, 2:05pm UTC](https://discuss.elastic.co/t/can-i-pass-data-between-2-input-plugin-of-logstash/154851/5 "2018-10-31T14:05:42Z")

</div>

Only One key at a time,  
You mean I can use Kafka in the Input plugin and then use the Jdbc stream plugin to take input value from kafka and then run a query in the filter section and then in ouput section use elasticsearch right ?

input{  
kakfa {}  
}

filter {  
jdbcstreaming  
}

output {  
elasticsearch {}  
}

Is this right ? Can you share example if you have any ?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 31, 2018, 2:16pm UTC](https://discuss.elastic.co/t/can-i-pass-data-between-2-input-plugin-of-logstash/154851/6 "2018-10-31T14:16:49Z")

</div>

Something like that. Do not have any example though.

---

<div class="post-metadata">

**Author:** ![patrick007](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@patrick007](https://discuss.elastic.co/u/patrick007)\
**Post date:** [October 31, 2018, 2:18pm UTC](https://discuss.elastic.co/t/can-i-pass-data-between-2-input-plugin-of-logstash/154851/7 "2018-10-31T14:18:48Z")

</div>

But this is possible if implemented ?

---

<div class="post-metadata">

**Author:** ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)\
**Post date:** [October 31, 2018, 2:20pm UTC](https://discuss.elastic.co/t/can-i-pass-data-between-2-input-plugin-of-logstash/154851/8 "2018-10-31T14:20:59Z")

</div>

@Christian_Dahlqvist, is it not possible to configure a TCP output for the first 'stage' and then a TCP input for the second 'stage'?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 31, 2018, 2:26pm UTC](https://discuss.elastic.co/t/can-i-pass-data-between-2-input-plugin-of-logstash/154851/9 "2018-10-31T14:26:39Z")

</div>

@patrick007 I think it should be possible, but I do not know anything about your data or queries.

@wwalker I am not sure I understand what you are suggesting. Could you please add some more details on why TCP inputs would be useful here?

---

<div class="post-metadata">

**Author:** ![patrick007](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@patrick007](https://discuss.elastic.co/u/patrick007)\
**Post date:** [October 31, 2018, 2:31pm UTC](https://discuss.elastic.co/t/can-i-pass-data-between-2-input-plugin-of-logstash/154851/11 "2018-10-31T14:31:04Z")

</div>

@Christian_Dahlqvist  
Thanks for you input 👍  
Used a wrong emoticon first 😅😅

---

<div class="post-metadata">

**Author:** ![sm00thindian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sm00thindian/32/27376_2.png) [@sm00thindian](https://discuss.elastic.co/u/sm00thindian)\
**Post date:** [November 1, 2018, 6:52pm UTC](https://discuss.elastic.co/t/can-i-pass-data-between-2-input-plugin-of-logstash/154851/12 "2018-11-01T18:52:53Z")

</div>

Input from Kafka topic, enrich, output to another Kafka topic.... rinse lather repeat

---

<div class="post-metadata">

**Author:** ![patrick007](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@patrick007](https://discuss.elastic.co/u/patrick007)\
**Post date:** [November 2, 2018, 5:18am UTC](https://discuss.elastic.co/t/can-i-pass-data-between-2-input-plugin-of-logstash/154851/13 "2018-11-02T05:18:34Z")

</div>

@sm00thindian Did not follow, Can you explain more please

---

<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 30, 2018, 5:18am UTC](https://discuss.elastic.co/t/can-i-pass-data-between-2-input-plugin-of-logstash/154851/14 "2018-11-30T05:18:34Z")

</div>

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