# Is it possible to read config from DB?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-read-config-from-db/235169>\
**Category:** Logstash\
**Created:** [June 1, 2020, 12:53pm UTC](https://discuss.elastic.co/t/is-it-possible-to-read-config-from-db/235169 "2020-06-01T12:53:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ullas7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ullas7/32/68349_2.png) [@Ullas7](https://discuss.elastic.co/u/Ullas7)\
**Post date:** [June 1, 2020, 12:53pm UTC](https://discuss.elastic.co/t/is-it-possible-to-read-config-from-db/235169/1 "2020-06-01T12:53:16Z")

</div>

I want to have configurable filters, basically to compare value from an input data field. I want to have configurable values, which should come from the database(preferred) or file (otherwise): for example

```auto
 if([url][IP]== ValuefromDB or fromFile){
    // Do something
  }

```

Is it possible to achieve this?  
Adding to this, I would like to load config without restarting logstash, is it possible?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 1, 2020, 1:14pm UTC](https://discuss.elastic.co/t/is-it-possible-to-read-config-from-db/235169/2 "2020-06-01T13:14:35Z")

</div>

You might be able to implement this using a jdbc\_streaming or jdbc\_static filter, or a translate filter in the case of a file. Or if it is really a single value then transfer the value to an environment variable and use a $reference.

If you enable --config.reload.automatic then logstash polls the input file every few seconds to see if it has changed and reloads it when it has changed.

---

<div class="post-metadata">

**Author:** ![Ullas7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ullas7/32/68349_2.png) [@Ullas7](https://discuss.elastic.co/u/Ullas7)\
**Post date:** [June 1, 2020, 1:31pm UTC](https://discuss.elastic.co/t/is-it-possible-to-read-config-from-db/235169/3 "2020-06-01T13:31:37Z")

</div>

@Badger Thanks for the quick reply I have multiple values and this maybe increase. Idealy the condition should be

```auto
if (ListOfvaluesfromDB).contains([url[IP])

```

I hope with jdbc\_streaming or jdbc\_static filter I can connect any kind of Database ( CouchDB ,MySQL etc)

Meanwhile, I will try dynamic loading by changing --config.reload.automatic

---

<div class="post-metadata">

**Author:** ![Ullas7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ullas7/32/68349_2.png) [@Ullas7](https://discuss.elastic.co/u/Ullas7)\
**Post date:** [June 2, 2020, 7:30am UTC](https://discuss.elastic.co/t/is-it-possible-to-read-config-from-db/235169/4 "2020-06-02T07:30:13Z")

</div>

@Badger, Is it possible to read data from Couch DB? Please share some helpful links .Thanks

---

<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:** [June 30, 2020, 7:30am UTC](https://discuss.elastic.co/t/is-it-possible-to-read-config-from-db/235169/5 "2020-06-30T07:30:14Z")

</div>

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