# Logstash is not indexing data to elasticsearch

**URL:** <https://discuss.elastic.co/t/logstash-is-not-indexing-data-to-elasticsearch/257470>\
**Category:** Elasticsearch\
**Created:** [December 3, 2020, 8:44am UTC](https://discuss.elastic.co/t/logstash-is-not-indexing-data-to-elasticsearch/257470 "2020-12-03T08:44:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aryaman\_Gupta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aryaman_gupta/32/79927_2.png) [@Aryaman\_Gupta](https://discuss.elastic.co/u/Aryaman_Gupta)\
**Post date:** [December 3, 2020, 8:44am UTC](https://discuss.elastic.co/t/logstash-is-not-indexing-data-to-elasticsearch/257470/1 "2020-12-03T08:44:15Z")

</div>

I am not able index data from logstash to elasticsearch, hence I am not able to view the data index at the kibana UI.

This issue I saw only when, running the logstash command from the php file, I guess it's www-data user not sure, I am using nginx web server.

While this works for me when I running the command form the terminal being root user.

Please let me know what other information should I provide to further narrow down the issue.

---

<div class="post-metadata">

**Author:** ![Mikel\_U](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikel_u/32/79306_2.png) [@Mikel\_U](https://discuss.elastic.co/u/Mikel_U)\
**Post date:** [December 3, 2020, 8:53am UTC](https://discuss.elastic.co/t/logstash-is-not-indexing-data-to-elasticsearch/257470/2 "2020-12-03T08:53:38Z")

</div>

What is your logstash pipeline configuration?  
You can check if logstash is processing the data viewing the output on console.  
On your pipeline file:

```auto
output {
  stdout {

  }
}

```

If you don't visualize the data on the terminal, the problem is only in logstash. When you visualize data, then you can put the plugin to send data to elasticsearch.

```auto
output {
     elasticsearch {
              hosts => "localhost:9200"
              index => "%{type}-%{+YYYY.MM.dd}"
              user => "elastic"
              password => "xxxxxxxx"
      }
}

```

---

<div class="post-metadata">

**Author:** ![Aryaman\_Gupta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aryaman_gupta/32/79927_2.png) [@Aryaman\_Gupta](https://discuss.elastic.co/u/Aryaman_Gupta)\
**Post date:** [December 3, 2020, 9:52am UTC](https://discuss.elastic.co/t/logstash-is-not-indexing-data-to-elasticsearch/257470/3 "2020-12-03T09:52:58Z")

</div>

Turn out that www-data doesn't have permission to write to /var/log/logstash and to other /etc/elasticsearch and logstash.

After giving permission to this user everything seem to be working fine :).

---

<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:** [December 31, 2020, 9:52am UTC](https://discuss.elastic.co/t/logstash-is-not-indexing-data-to-elasticsearch/257470/4 "2020-12-31T09:52:59Z")

</div>

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