# Logstash conf file is not creating an index in ES

**URL:** <https://discuss.elastic.co/t/logstash-conf-file-is-not-creating-an-index-in-es/301243>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [March 31, 2022, 6:15pm UTC](https://discuss.elastic.co/t/logstash-conf-file-is-not-creating-an-index-in-es/301243 "2022-03-31T18:15:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yash\_196](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yash_196/32/99273_2.png) [@yash\_196](https://discuss.elastic.co/u/yash_196)\
**Post date:** [March 31, 2022, 6:15pm UTC](https://discuss.elastic.co/t/logstash-conf-file-is-not-creating-an-index-in-es/301243/1 "2022-03-31T18:15:56Z")

</div>

Logstash conf file is not creating an index in ES when using docker-compose. This is my logstash.conf code, can anyone help me figure out the solution?

```auto
input{
    elasticsearch {
    		hosts => "elasticsearch:9200"
    		user => "elastic"
    		password => "changeme"
    	}
    file {
        path => "<path of logFile on local desktop>/logFile.txt"
        start_position => "beginning"
    }
}

output{
    elasticsearch{
    hosts => "elasticsearch:9200"
    user => "elastic"
    password => "changeme"
    index => "sample" 
}

```

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [March 31, 2022, 6:42pm UTC](https://discuss.elastic.co/t/logstash-conf-file-is-not-creating-an-index-in-es/301243/2 "2022-03-31T18:42:31Z")

</div>

input section looks weird. it has Elasticsearch and file both as input. is that correct?

---

<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 28, 2022, 6:43pm UTC](https://discuss.elastic.co/t/logstash-conf-file-is-not-creating-an-index-in-es/301243/3 "2022-04-28T18:43:15Z")

</div>

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