graylog-labs / gelf-rb

Ruby GELF library (Graylog Extended Log Format)

Home Page:https://rubygems.org/gems/gelf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot get GELF::Notifier to send data

landovsky opened this issue · comments

Hi.

I have a Graylog server configuration in place that was able to receive data submitted via this curl:
curl -XPOST http://graylog.domain.com:12201/gelf -p0 -d '{"short_message":"Hello there", "facility":"test", "tenant":"joseph", "report":"turnovers","speed":"1288"}'

Other info:

  • the Graylog input is configured without any authentication.
  • I have a test stream to which I'm forwarding messages when facility==test

I'm trying to to the same via the Ruby library, but without success:

n = GELF::Notifier.new('graylog.domain.com', 12201, 'LAN', { protocol: GELF::Protocol::TCP })
n.notify!(short_message: 'this is short message', message: 'hello', facility: 'test')

What do I need to do for this to work?

Many thanks.

Tomas