# Multiple logstash indexes to be created from multiple application log files

**URL:** https://discuss.elastic.co/t/multiple-logstash-indexes-to-be-created-from-multiple-application-log-files/302399
**Category:** Logstash
**Created:** [April 14, 2022, 7:46am UTC](https://discuss.elastic.co/t/multiple-logstash-indexes-to-be-created-from-multiple-application-log-files/302399 "2022-04-14T07:46:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ashiqab](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashiqab/32/103144_2.png) [@ashiqab](https://discuss.elastic.co/u/ashiqab)
#### Post date: [April 14, 2022, 7:46am UTC](https://discuss.elastic.co/t/multiple-logstash-indexes-to-be-created-from-multiple-application-log-files/302399/1 "2022-04-14T07:46:07Z")

</div>

Hello,

Still considerably new to ELK, I have successfully set up Logstash index for one of my application log files as below conf file:

```auto
server1:/etc/logstash/conf.d # cat /etc/logstash/conf.d/accessinfologs.conf
input {
  file {
    path => "/path/accessinfologs"
    start_position => "beginning"
    sincedb_path => "/dev/null"
  }
}
filter {
  csv {
    separator => ","
    columns => ["accessinfologs_input_timestamp","accessinfologs_script","accessinfologs_invoked_by","accessinfologs_server"]
  }
  date {
        match => ["accessinfologs_input_timestamp", "yyyy-MM-dd-HH:mm:ss"]
  }
}
output {
  elasticsearch {
    hosts => "http://localhost:9200"
    index => "accessinfolog"
    user => elastic
    password => passwd
  }
  stdout {}
}
server1:/etc/logstash/conf.d #

```

Now, I am planning to add a new index for another application log file by adding a new conf file:

```auto
server1:/etc/logstash/conf.d # cat /etc/logstash/conf.d/upgradeaccess.conf
input {
  file {
    path => "/path/upgradeaccess"
    start_position => "beginning"
    sincedb_path => "/dev/null"
  }
}
filter {
  csv {
    separator => ","
    columns => ["upgradeaccess_server","upgradeaccess_SID","upgradeaccess_path","upgradeaccess_invoker","upgradeaccess_input_timestamp","upgradeaccess_DB_TYPE","upgradeaccess_UPGRADETYPE"]
  }
  date {
        match => ["upgradeaccess_input_timestamp", "yyyyMMddHHmm"]
  }
}
output {
  elasticsearch {
    hosts => "http://localhost:9200"
    index => "upgradeaccess"
    user => elastic
    password => passwd
  }
  stdout {}
}
server1:/etc/logstash/conf.d #

```

Although the index "upgradeaccess" got created, I could see that the data is corrupted in the indexes. There are some "upgradeaccess" data in "accessinfolog" index and vice versa.

Could you please point me to the right direction as to how to configure multiple unrelated log files to multiple indexes in Logstash?

Any additional details can be shared if needed.

Thanks in advance,  
Ashiq Aboo Backer

---

<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: [April 14, 2022, 4:04pm UTC](https://discuss.elastic.co/t/multiple-logstash-indexes-to-be-created-from-multiple-application-log-files/302399/2 "2022-04-14T16:04:52Z")

</div>

> [@ashiqab](#):
>
> Could you please point me to the right direction as to how to configure multiple unrelated log files to multiple indexes in Logstash?

Do not use path.config (or -f) use [pipelines.yml](https://www.elastic.co/guide/en/logstash/current/multiple-pipelines.html). See [this](https://discuss.elastic.co/t/conf-files-getting-mixed-when-uploading/195803/2) thread.

---

<div class="post-metadata">

### Author: ![ashiqab](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashiqab/32/103144_2.png) [@ashiqab](https://discuss.elastic.co/u/ashiqab)
#### Post date: [April 18, 2022, 4:01am UTC](https://discuss.elastic.co/t/multiple-logstash-indexes-to-be-created-from-multiple-application-log-files/302399/3 "2022-04-18T04:01:13Z")

</div>

Thank you so much for the inputs regarding pipelines.  
I was able to make a solution using [How to handle Multiple Config files in logstash](https://discuss.elastic.co/t/how-to-handle-multiple-config-files-in-logstash/107520) this conditional processing. I will also try out pipelines.yml and use the easier one for our deployment.

Thanks and regards,  
Ashiq

---

<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: [May 16, 2022, 4:01am UTC](https://discuss.elastic.co/t/multiple-logstash-indexes-to-be-created-from-multiple-application-log-files/302399/4 "2022-05-16T04:01:56Z")

</div>

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