# Multiple file setting in input in logstash conf

**URL:** <https://discuss.elastic.co/t/multiple-file-setting-in-input-in-logstash-conf/176084>\
**Category:** Logstash\
**Created:** [April 9, 2019, 6:32pm UTC](https://discuss.elastic.co/t/multiple-file-setting-in-input-in-logstash-conf/176084 "2019-04-09T18:32:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![inandi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inandi/32/40801_2.png) [@inandi](https://discuss.elastic.co/u/inandi)\
**Post date:** [April 9, 2019, 6:32pm UTC](https://discuss.elastic.co/t/multiple-file-setting-in-input-in-logstash-conf/176084/1 "2019-04-09T18:32:48Z")

</div>

my ELK version 6.7. i want to add multiple files in logstash conf file and use it conditinally. i have this conf file but it is not working.

```
input {
  file {
    type => "back"
    path => "E:/xampp/htdocs/project/hq/log/logs_dev.json"
    start_position => "beginning"
    sincedb_path => "NUL"
    codec => "json"
  }
  file {
    type => "api"
    path => "E:/xampp/htdocs/project/api/log/logs_dev.json"
    start_position => "beginning"
    sincedb_path => "NUL"
    codec => "json"
  }
}

filter
{ 

}

output {
  stdout { codec => rubydebug }
  if [type] == "back" {
    elasticsearch {
      hosts => ["http://127.0.0.1:9200/"] 
      index => "project_back_18"
    }
  }
  if [type] == "api" {
    elasticsearch {
      hosts => ["http://127.0.0.1:9200/"] 
      index => "project_api_18"
    }
  }
}
```

---

<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 9, 2019, 6:52pm UTC](https://discuss.elastic.co/t/multiple-file-setting-in-input-in-logstash-conf/176084/2 "2019-04-09T18:52:38Z")

</div>

I would expect that to work. Does the rubydebug output look right? What do you get in elasticsearch.

---

<div class="post-metadata">

**Author:** ![ipv6ok](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@ipv6ok](https://discuss.elastic.co/u/ipv6ok)\
**Post date:** [April 10, 2019, 1:17am UTC](https://discuss.elastic.co/t/multiple-file-setting-in-input-in-logstash-conf/176084/3 "2019-04-10T01:17:02Z")

</div>

thank you! if use rubydebug output look right ,yea,rubydebug output is ok, but output elasticsearch only read first line.

---

<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 8, 2019, 1:19am UTC](https://discuss.elastic.co/t/multiple-file-setting-in-input-in-logstash-conf/176084/4 "2019-05-08T01:19:30Z")

</div>

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