Logstash is not indexing data to elasticsearch

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.

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

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.

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

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 :).

1 Like

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