# How to define input based on variables from another input

**URL:** <https://discuss.elastic.co/t/how-to-define-input-based-on-variables-from-another-input/57399>\
**Category:** Logstash\
**Created:** [August 6, 2016, 11:43am UTC](https://discuss.elastic.co/t/how-to-define-input-based-on-variables-from-another-input/57399 "2016-08-06T11:43:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![billzy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/billzy/32/9967_2.png) [@billzy](https://discuss.elastic.co/u/billzy)\
**Post date:** [August 6, 2016, 11:43am UTC](https://discuss.elastic.co/t/how-to-define-input-based-on-variables-from-another-input/57399/1 "2016-08-06T11:43:02Z")

</div>

here's a case that I need to finish following steps

1. call a rest service end point to fetch a returned id
2. call another rest end point using the returned id in step 1 as parameter

for step 1 , I defined a http\_poller to get the returned id which is simple  
for step 2, how can i config ?

Any advice is appreciated , thanks !

---

<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:** [August 7, 2016, 1:34am UTC](https://discuss.elastic.co/t/how-to-define-input-based-on-variables-from-another-input/57399/2 "2016-08-07T01:34:55Z")

</div>

You can't unfortunately, though I admit it'd be useful.

Maybe make a feature request against the plugin repo?

---

<div class="post-metadata">

**Author:** ![billzy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/billzy/32/9967_2.png) [@billzy](https://discuss.elastic.co/u/billzy)\
**Post date:** [August 7, 2016, 4:44am UTC](https://discuss.elastic.co/t/how-to-define-input-based-on-variables-from-another-input/57399/3 "2016-08-07T04:44:27Z")

</div>

Thanks for the reply.

I guessed so. A possible workaround would be using ruby plugin to write rest request in filter stage ? yet I haven't tried.

---

<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:** [August 7, 2016, 4:45am UTC](https://discuss.elastic.co/t/how-to-define-input-based-on-variables-from-another-input/57399/4 "2016-08-07T04:45:53Z")

</div>

That'd probably work.

---

<div class="post-metadata">

**Author:** ![billzy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/billzy/32/9967_2.png) [@billzy](https://discuss.elastic.co/u/billzy)\
**Post date:** [May 13, 2017, 5:37am UTC](https://discuss.elastic.co/t/how-to-define-input-based-on-variables-from-another-input/57399/5 "2017-05-13T05:37:34Z")

</div>

hi Mark, I'm wondering is there any chance this feature supported in 5.x version ? I made a research but no luck, still want to confirm it here.

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [May 13, 2017, 1:44pm UTC](https://discuss.elastic.co/t/how-to-define-input-based-on-variables-from-another-input/57399/6 "2017-05-13T13:44:58Z")

</div>

There is still no way to do conditionals in an input block.

---

<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:26am UTC](https://discuss.elastic.co/t/how-to-define-input-based-on-variables-from-another-input/57399/7 "2017-07-06T04:26:37Z")

</div>


