# How to select a target in upstream

**URL:** <https://discuss.konghq.com/t/how-to-select-a-target-in-upstream/10052>\
**Category:** General\
**Created:** [April 14, 2022, 4:12pm UTC](https://discuss.konghq.com/t/how-to-select-a-target-in-upstream/10052 "2022-04-14T16:12:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yves](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/yves/32/1860_2.png) [@Yves](https://discuss.konghq.com/u/Yves)\
**Post date:** [April 14, 2022, 4:12pm UTC](https://discuss.konghq.com/t/how-to-select-a-target-in-upstream/10052/1 "2022-04-14T16:12:55Z")

</div>

Hi all  
I expose an API which has 2 targets @IP : 1 for production and 1 for prod

Is it possible to create 1 upstream with this 2 targets and instead of making a load balancing, having a way to select prod or preprod

upstream ==\> target 1 ==\> production  
==\> target 2 ==\> preproduction

I read the doc with all hash\_on parameters but I not sure that it could make the job

I just ask the question to avoid to create 2 services with 2 upstreams

Thank you for your feedback

---

<div class="post-metadata">

**Author:** ![Yves](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/yves/32/1860_2.png) [@Yves](https://discuss.konghq.com/u/Yves)\
**Post date:** [April 20, 2022, 7:21am UTC](https://discuss.konghq.com/t/how-to-select-a-target-in-upstream/10052/2 "2022-04-20T07:21:45Z")

</div>

I think a have my solution : [Set Dynamic Upstream Host plugin | Kong Docs](https://docs.konghq.com/hub/flash/set-dynamic-upstream-host/)
