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?
You might try https://github.com/tsaikd/gogstash
Or if you want to use logrus try this: https://github.com/interactive-solutions/go-logrus-elasticsearch
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:
you might want to try this one, https://github.com/telkomdev/go-stash,
this is example with logrus https://github.com/telkomdev/go-stash/blob/master/_example/logrus/main.go
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.
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.