# Is there a way to evaluate an expression and get the result?

**URL:** <https://discuss.elastic.co/t/is-there-a-way-to-evaluate-an-expression-and-get-the-result/260986>\
**Category:** Elasticsearch\
**Created:** [January 13, 2021, 11:31am UTC](https://discuss.elastic.co/t/is-there-a-way-to-evaluate-an-expression-and-get-the-result/260986 "2021-01-13T11:31:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AgrPriyank](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@AgrPriyank](https://discuss.elastic.co/u/AgrPriyank)\
**Post date:** [January 13, 2021, 11:31am UTC](https://discuss.elastic.co/t/is-there-a-way-to-evaluate-an-expression-and-get-the-result/260986/1 "2021-01-13T11:31:06Z")

</div>

I have multiple nodes scattered around different regions. My application is deployed region wise, i.e. the application present in region A will only talk to resources in region A.

However, in order to provide high availability if resources in region A are not available for some reason, the request should go to region B.  
I'm trying to see if I can evaluate the health of a node in a particular region and then the return the resource Id that the application will have to use.

**Is there any way to evaluate an expression and the return a static value?**  
**For ex-**  
**resource: region A? resource A : resource B**

---

<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:** [February 10, 2021, 11:31am UTC](https://discuss.elastic.co/t/is-there-a-way-to-evaluate-an-expression-and-get-the-result/260986/2 "2021-02-10T11:31:13Z")

</div>

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