Logrus: How to send logs to elasticsearch?

Created on 13 Jun 2018  路  9Comments  路  Source: sirupsen/logrus

I want to send logs to elasticsearch. I have attempted to use sohlich/elogrus,but it do not work really.Is there a way to send logs to elasticsearch?

question

Most helpful comment

Another approach is to log to stdout or a file and use a standalone log collector to forward the logs on.

Logstash is commonly used with ElasticSearch, or you could use https://github.com/agnivade/funnel or many other tools.

All 9 comments

You can find a list of hooks which are usable with logrus. There is one to send data to ElasticSearch.
https://github.com/sirupsen/logrus/wiki/Hooks

Another approach is to log to stdout or a file and use a standalone log collector to forward the logs on.

Logstash is commonly used with ElasticSearch, or you could use https://github.com/agnivade/funnel or many other tools.

Another approach is to log to stdout or a file and use a standalone log collector to forward the logs on.

Logstash is commonly used with ElasticSearch, or you could use https://github.com/agnivade/funnel or many other tools.

I am logging to a file and use fluentd to send msg to Logstash, but I think this is a bad method.

@wjzhangcsu did you try the logstash hook mentioned in the hooks page ?

There are a few ways of doing this depending on your setup:

Hi,

You can refer this article https://ashish.one/blogs/shipping-golang-logs-with-elkb-stack/

Write your logs in JSON format and then ship your logs on Elasticsearch with the help of Filebeat.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Integralist picture Integralist  路  3Comments

kubistika picture kubistika  路  3Comments

piotrkowalczuk picture piotrkowalczuk  路  4Comments

penhauer-xiao picture penhauer-xiao  路  4Comments

drewwells picture drewwells  路  3Comments