# Configure logstash input from database values?

**URL:** https://discuss.elastic.co/t/configure-logstash-input-from-database-values/32763
**Category:** Logstash
**Created:** [October 22, 2015, 10:18am UTC](https://discuss.elastic.co/t/configure-logstash-input-from-database-values/32763 "2015-10-22T10:18:30Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jsps](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsps/32/5411_2.png) [@jsps](https://discuss.elastic.co/u/jsps)
#### Post date: [October 22, 2015, 10:18am UTC](https://discuss.elastic.co/t/configure-logstash-input-from-database-values/32763/1 "2015-10-22T10:18:30Z")

</div>

I've got a dynamic number of sites. There is a RESTful api on each site that is used to consume their logs. The RESTful endpoint for each site is stored in a single DB on server x. I want to create a logstash input plugin to consume the logs from each of these sites on server x, filter them and output to elasticsearch.  
I cant have a logstash forwarder on the sites.

Is it possible for an input plugin to read the endpoint data from a db or service or whatever, and then consume all of the logs for the sites.

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [October 22, 2015, 11:13am UTC](https://discuss.elastic.co/t/configure-logstash-input-from-database-values/32763/2 "2015-10-22T11:13:03Z")

</div>

Sure, a custom input plugin can read its configuration from any source. However, you can't pass that information to other input plugins. What you can do is wrap/subclass the input plugin(s) you want to use and thereby pass the dynamic configuration to the underlying code. How easy this actually is depends on the input plugin.

---

<div class="post-metadata">

### Author: ![jsps](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsps/32/5411_2.png) [@jsps](https://discuss.elastic.co/u/jsps)
#### Post date: [October 22, 2015, 11:19am UTC](https://discuss.elastic.co/t/configure-logstash-input-from-database-values/32763/3 "2015-10-22T11:19:17Z")

</div>

Thanks Magnus. So for example a single instance of logstash can have a single custom input plugin that reads its configuration from a DB, and then consume 20 logs from 20 different endpoints? I don't think I'd need to use any other input plugins although I'm new to logstash so maybe I don't understand enough.

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [October 22, 2015, 11:28am UTC](https://discuss.elastic.co/t/configure-logstash-input-from-database-values/32763/4 "2015-10-22T11:28:42Z")

</div>

You're on the right track.

---

<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, 5:25am UTC](https://discuss.elastic.co/t/configure-logstash-input-from-database-values/32763/5 "2017-07-06T05:25:46Z")

</div>


