Class: LogStash::Outputs::Logentries

Inherits:
Base
  • Object
show all
Defined in:
lib/logstash/outputs/logentries.rb

Overview

www.logentries.com

Write events over TCP socket. Each event json is separated by a newline.

You will read this token from your config file. Just put the following lines to your .config file:

output{

logentries{
token => "LOGENTRIES_TOKEN"
reconnect_interval => 10
ssl_enable => true
host => "data.logentries.com"
port => 443
          }
  }

Instance Method Summary collapse

Instance Method Details

#receive(event) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/logstash/outputs/logentries.rb', line 42

def receive(event)
  message = event.to_json

  begin
    @client_socket ||= connect
    @client_socket.puts("#{@token}" + message)
  rescue => e
    @logger.warn("Socket output exception: closing and resending event", :host => @host, :port => @port, :exception => e, :backtrace => e.backtrace, :event => event)
    @client_socket.close rescue nil
    @client_socket = nil
    sleep(@reconnect_interval)
    retry
  end
end

#registerObject



34
35
36
37
38
39
40
# File 'lib/logstash/outputs/logentries.rb', line 34

def register
  @client_socket = nil

  if ssl?
    @ssl_context = setup_ssl
  end
end