# How to setup multiple config file in logstash

**URL:** https://discuss.elastic.co/t/how-to-setup-multiple-config-file-in-logstash/223059
**Category:** Logstash
**Created:** [March 11, 2020, 7:05am UTC](https://discuss.elastic.co/t/how-to-setup-multiple-config-file-in-logstash/223059 "2020-03-11T07:05:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![malleshrp](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@malleshrp](https://discuss.elastic.co/u/malleshrp)
#### Post date: [March 11, 2020, 7:05am UTC](https://discuss.elastic.co/t/how-to-setup-multiple-config-file-in-logstash/223059/1 "2020-03-11T07:05:22Z")

</div>

I want to setup multiple config files in logstash..  
currently running individual .conf files which will transfer data from mysql to elasticsearch.  
I am having 90 files how do I setup in one config file for production server.

Please provide suggestions.

---

<div class="post-metadata">

### Author: ![ITIC](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@ITIC](https://discuss.elastic.co/u/ITIC)
#### Post date: [March 11, 2020, 10:13am UTC](https://discuss.elastic.co/t/how-to-setup-multiple-config-file-in-logstash/223059/2 "2020-03-11T10:13:42Z")

</div>

Hi

If I understand correctly, you want to have multiple `.conf` files in a single logstash pipeliine, each with its own `input{}`, `filter{}` and `output{}` sections.

To do that, you can put all your `.conf` files in the pipeline directory (as defined in your `pipelines.yml`) and use unique `tags` in each and every one of them, like this:

```auto
input {
  jdbc {
    tags => "Unique tag for .conf file #n"
    id => "jdbc_Unique ID for .conf file #n"
    
    jdbc_driver_class => [...]
    
  } # End jdbc {}
} # End input {}

filter {
  if "Unique tag for .conf file #n" in [tags] {
    
	<your filters here>
    
  } # End Unique tag for .conf file #n
} # End filter {}

output {
  if "Unique tag for .conf file #n" in [tags] {
    
	stdout {
    }
    
	<your outputs here>
	
  } # End Unique tag for .conf file #n
} # End output {}

```

In your case `#n` goes from 1 to 90. So yes, you'll have to edit all of them, sorry.

Hope this helps

---

<div class="post-metadata">

### Author: ![Fabio-sama](https://avatars.discourse-cdn.com/v4/letter/f/b9e5f3/32.png) [@Fabio-sama](https://discuss.elastic.co/u/Fabio-sama)
#### Post date: [March 11, 2020, 11:09am UTC](https://discuss.elastic.co/t/how-to-setup-multiple-config-file-in-logstash/223059/3 "2020-03-11T11:09:13Z")

</div>

You either want something similar to what @ITIC suggested, or you simply want to run the logstash instance once and have all your conf files be run.

If that's the case, simply specify various pipelines in the `config/pipelines.yml` file like the following:

```
- pipeline.id: my_first_pipeline
  path.config: "/path_to_first_pipeline.conf"
- pipeline.id: my_second_pipeline
  path.config: "/path_to_second_pipeline.conf"

```

And then simply run logstash without any additional option (like `bin/logstash` from the logstash directory). It'll run all the pipelines specified in the pipelines.yml file.

Obviously, you can add specific options for each individual pipeline in the `pipelines.yml` file (e.g. number of workers, batch\_size, etc..).

---

<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: [April 8, 2020, 11:09am UTC](https://discuss.elastic.co/t/how-to-setup-multiple-config-file-in-logstash/223059/4 "2020-04-08T11:09:14Z")

</div>

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