# Logstash is not creating index in Elasticsearch

**URL:** <https://discuss.elastic.co/t/logstash-is-not-creating-index-in-elasticsearch/305675>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [May 26, 2022, 7:24am UTC](https://discuss.elastic.co/t/logstash-is-not-creating-index-in-elasticsearch/305675 "2022-05-26T07:24:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravis85](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@ravis85](https://discuss.elastic.co/u/ravis85)\
**Post date:** [May 26, 2022, 7:24am UTC](https://discuss.elastic.co/t/logstash-is-not-creating-index-in-elasticsearch/305675/1 "2022-05-26T07:24:51Z")

</div>

Hello,

I am running ELK stack in docker container. Everything is working fine.

However I am having an issue with Logstash, that whenever I use a input type file and provide a path to my logfile, the Logstash is not creating an index in the Kibana UI.  
But when I use input type as stdin, it creates the index, only issue is with input type as file.

I checked that logstash is having permissions to access the logfile.

My pipeline example is as below.

````nohighlight
  file {
    type => log
    path => ["/data/logstash/nginx-error.log"]
    start_position => "beginning"
    sincedb_path => "/dev/null"
# ignore_older => 0
  }
}

output {
    elasticsearch{
      hosts => ["https://elasticsearch-node1:9200"]
      user => "admin"
      password => "admin"
      action => "create"
      index => "index_nginx-test-%{+YYYY.MM.dd}"
      ssl => false
      ssl_certificate_verification => false
    }
}```

Please suggest if I am missing anything or the configuration is not correct.
````

---

<div class="post-metadata">

**Author:** ![grfneto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grfneto/32/125776_2.png) [@grfneto](https://discuss.elastic.co/u/grfneto)\
**Post date:** [May 26, 2022, 2:23pm UTC](https://discuss.elastic.co/t/logstash-is-not-creating-index-in-elasticsearch/305675/2 "2022-05-26T14:23:45Z")

</div>

Hi @ravis85

Welcome to the community!

Did you check if the logs are being captured correctly on stdout? maybe it is not creating the index because the logs are not being captured.

you can test by including in the output:

```auto
    output {
       stdout { codec => json }
     }

```

if everything is OK, check the logstash logs if there is any problem communicating with Elasticsearch.

---

<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:** [June 23, 2022, 2:24pm UTC](https://discuss.elastic.co/t/logstash-is-not-creating-index-in-elasticsearch/305675/3 "2022-06-23T14:24:05Z")

</div>

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