# What's better, multi config or one config(multi input)

**URL:** https://discuss.elastic.co/t/whats-better-multi-config-or-one-config-multi-input/71925
**Category:** Logstash
**Created:** [January 18, 2017, 1:35am UTC](https://discuss.elastic.co/t/whats-better-multi-config-or-one-config-multi-input/71925 "2017-01-18T01:35:50Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![leewig](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@leewig](https://discuss.elastic.co/u/leewig)
#### Post date: [January 18, 2017, 1:35am UTC](https://discuss.elastic.co/t/whats-better-multi-config-or-one-config-multi-input/71925/1 "2017-01-18T01:35:50Z")

</div>

hi, everybody.

i have used logstash for collecting the data of mysql.

the data of mysql have several tables, and i created config files like below.

## tb\_a.config

input {  
jdbc {  
jdbc\_driver\_library =\> "lib/mysql-connector-java-5.1.33.jar"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:mysql://127.0.0.1:59000/DB"  
jdbc\_user =\> "user"  
jdbc\_password =\> "pass"  
statement =\> " SELECT \* FROM TABLE\_A "  
schedule =\> "\* \* \* \* \*"  
}  
}

## output { elasticsearch { hosts =\> ["127.0.0.1:9200"] index =\> "table\_a" document\_type =\> "a" document\_id =\> "%{a\_seq}" } }

## tb\_b.config

input {  
jdbc {  
jdbc\_driver\_library =\> "lib/mysql-connector-java-5.1.33.jar"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:mysql://127.0.0.1:59000/DB"  
jdbc\_user =\> "user"  
jdbc\_password =\> "pass"  
statement =\> " SELECT \* FROM TABLE\_B "  
schedule =\> "\* \* \* \* \*"  
}  
}

## output { elasticsearch { hosts =\> ["127.0.0.1:9200"] index =\> "table\_b" document\_type =\> "b" document\_id =\> "%{b\_seq}" } }

and i runned logstash by below command.

logstash -f ../conf/tb\_a.config &  
logstash -f ../conf/tb\_b.config &

but it was not good. if i need more collecting other table data, i will add config file.

recently, i saw this reply - [http://stackoverflow.com/questions/37613611/multiple-inputs-on-logstash-jdbc](http://stackoverflow.com/questions/37613611/multiple-inputs-on-logstash-jdbc)

there was multi input. i look good that than mine.

**My question, what's better multi config file or multi input. in my case, the table collected by logstash may be added.**

sorry, low english.

thanks a lot.

---

<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: [January 18, 2017, 6:41am UTC](https://discuss.elastic.co/t/whats-better-multi-config-or-one-config-multi-input/71925/2 "2017-01-18T06:41:16Z")

</div>

If you have more than just a few configuration files or if you want to run Logstash as a service and not just from a terminal I suggest you run Logstash with multiple inputs.

---

<div class="post-metadata">

### Author: ![leewig](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@leewig](https://discuss.elastic.co/u/leewig)
#### Post date: [January 19, 2017, 4:55am UTC](https://discuss.elastic.co/t/whats-better-multi-config-or-one-config-multi-input/71925/3 "2017-01-19T04:55:33Z")

</div>

thank you! i think there is the advantage of maintenance. but Can I get other advantage by using multi input for service?

---

<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: [January 19, 2017, 6:26am UTC](https://discuss.elastic.co/t/whats-better-multi-config-or-one-config-multi-input/71925/4 "2017-01-19T06:26:25Z")

</div>

Well, you obviously reduce the resource usage by not running multiple JVMs.

---

<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 16, 2017, 6:26am UTC](https://discuss.elastic.co/t/whats-better-multi-config-or-one-config-multi-input/71925/5 "2017-02-16T06:26:35Z")

</div>

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