1

Someone please show me an example of log4r configuration for sending logs to logstash. My rails application lies in a remote server.

Also logstash configuration for recieving log4r logs.

Thanks in Advance

Babeesh
  • 107
  • 1
  • 1
  • 10

1 Answers1

0

I'd suggest you to use filebeat. A tool by the creators of logstash that allow you to send logs from one server to another with logstash or elasticsearch. The application is very lightweight and simple to configure.

Here is an example configuration that sends the content of /path/to/your/logfile.log to a logstash server name logstashserver:

filebeat:
  prospectors:
    -
      paths:
        - /path/to/your/logfile.log
      input_type: log
  registry_file: /var/lib/filebeat/registry

output:
  logstash:
    hosts: ["logstashserver:5043"]

shipper:
logging:
  files:
    rotateeverybytes: 10485760 # = 10MB

If you need a more comprehensive guide check this link

Greetings,

alfredocambera
  • 3,155
  • 34
  • 29
  • 1
    I tried with filebeat. Since my rails application is in a remote ubuntu machine, I gave my public IP address for logstash hosts. – Babeesh Feb 03 '16 at 12:05
  • 1
    In my router I forwarded my logstash ip and port with public ip and port. But still logs are not found in logserver. – Babeesh Feb 03 '16 at 12:14
  • Have you checked your logstash listening port? Please, post your logstash configuration – alfredocambera Feb 03 '16 at 14:03
  • 1
    Finally I got it. my logstash config file is almost same as your recommended link. The only difference is I used tcp plugin instead of beats. Thnk u so much – Babeesh Feb 04 '16 at 17:55
  • That's great news Babeesh. Would you mind to check my answer as correct? – alfredocambera Feb 04 '16 at 22:43