shadabahmed / logstasher

Awesome rails logs
MIT License
817 stars 136 forks source link

How to push logs in elasticsearch #147

Open RajGanguly opened 5 years ago

RajGanguly commented 5 years ago

I included logstash in my Gemfile. I added all the configuration in my development.rb.

However, when I restart my app server, I can only see a logstasher_development.log being created but no logs are getting indexed in the running elasticsearch server.

What am I missing here?

Using ruby-2.3.3 and rails 4.2

AnrichVS commented 5 years ago

Hi,

This gem does not provide any integration to Elasticsearch out of the box. It simply writes logs entries in JSON format, thus making it easier to use with Logstash.

I recommend using Filebeat to ingest your log file on your instance, and send that off to either Logstash or directly to Elasticsearch. See this guide for more info: https://journal.missiondata.com/devops-notes-experimenting-with-elk-stack-da53b1873430

Some of the info there is out dated, you'll have to google to find chunks of more up to date info, such as consulting the Filebeat documentation, Logstash documentation, etc. Your goal is to transfer your log data from the log file on your application instance (Filebeat) to Logstash (if your data requires further manipulation) or directly to Elasticsearch (if no transformation is required, or you're happy using Elasticsearch ingest nodes). Once the data is in Elasticsearch, you can use Kibana to visualize the data.