# Is it possible to set a specific variable when starting the logstash?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-set-a-specific-variable-when-starting-the-logstash/205804>\
**Category:** Logstash\
**Created:** [October 30, 2019, 7:46am UTC](https://discuss.elastic.co/t/is-it-possible-to-set-a-specific-variable-when-starting-the-logstash/205804 "2019-10-30T07:46:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yungyoung\_Ok](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yungyoung_ok/32/43465_2.png) [@Yungyoung\_Ok](https://discuss.elastic.co/u/Yungyoung_Ok)\
**Post date:** [October 30, 2019, 7:46am UTC](https://discuss.elastic.co/t/is-it-possible-to-set-a-specific-variable-when-starting-the-logstash/205804/1 "2019-10-30T07:46:55Z")

</div>

question:

1. Is it possible to set a specific variable when starting the logstash?
2. If 1 is possible, Can I run above function on conditional?

problem:

I am putting data into Elasticsearch through a logstash.  
In the logstash, i need to add fields according to certain conditions, which are stored in oracle.  
I'm worried that if I get the data through jdbc from input every time, it will be overloaded.

So I want to get the information from oracle once when executing the logstash and  
set the value to a variable to use in the filter.  
Is it possible?

If I add a variable to $LS\_HOME/config/start.options, can it be used in a conf file?

If possible, can I enable the ability to retrieve information from oracle according to conf?  
For example, i want to enable the condition when i run a.conf and disable it when i run b.conf.  
Is it possible?

---

<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 27, 2019, 7:46am UTC](https://discuss.elastic.co/t/is-it-possible-to-set-a-specific-variable-when-starting-the-logstash/205804/2 "2019-11-27T07:46:55Z")

</div>

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