Class: LogStash::Outputs::MonascaLogApi

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

Overview

This Logstash Output plugin, sends events to monasca-api. It authenticates against keystone and gets a token. The token is used to authenticate against the monasca-api and send log events.

Constant Summary collapse

JSON_LOGS =
'logs'
JSON_DIMS =
'dimensions'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#logsObject

Returns the value of attribute logs.



57
58
59
# File 'lib/logstash/outputs/monasca_log_api.rb', line 57

def logs
  @logs
end

#start_timeObject

Returns the value of attribute start_time.



57
58
59
# File 'lib/logstash/outputs/monasca_log_api.rb', line 57

def start_time
  @start_time
end

#time_threadObject

Returns the value of attribute time_thread.



57
58
59
# File 'lib/logstash/outputs/monasca_log_api.rb', line 57

def time_thread
  @time_thread
end

Instance Method Details

#closeObject



86
87
88
# File 'lib/logstash/outputs/monasca_log_api.rb', line 86

def close
  stop_time_check
end

#multi_receive(events) ⇒ Object



79
80
81
82
83
84
# File 'lib/logstash/outputs/monasca_log_api.rb', line 79

def multi_receive(events)
  @logger.debug("Retrieving #{events.size} events")
  events.each do |event|
    encode(event)
  end
end

#registerObject



65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/logstash/outputs/monasca_log_api.rb', line 65

def register
  check_config
  @mutex = Mutex.new
  @logger.info('Registering keystone user',
    :username => username, :project_name => project_name)
  @monasca_log_api_client = LogStash::Outputs::Monasca::MonascaLogApiClient
    .new monasca_log_api_url, monasca_log_api_insecure
  @logs = Hash.new
  @start_time = nil
  init_token
  initialize_logs_object
  start_time_check
end