Class: LogStash::Api::Commands::DefaultMetadata
- Inherits:
-
Base
- Object
- Base
- LogStash::Api::Commands::DefaultMetadata
show all
- Defined in:
- lib/logstash/api/commands/default_metadata.rb
Instance Attribute Summary
Attributes inherited from Base
#service
Instance Method Summary
collapse
Methods inherited from Base
#extract_metrics, #initialize, #started_at, #uptime
Instance Method Details
#all ⇒ Object
9
10
11
12
|
# File 'lib/logstash/api/commands/default_metadata.rb', line 9
def all
{:host => host, :version => version, :http_address => http_address,
:id => service.agent.id, :name => service.agent.name}
end
|
#host ⇒ Object
14
15
16
|
# File 'lib/logstash/api/commands/default_metadata.rb', line 14
def host
@@host ||= Socket.gethostname
end
|
#http_address ⇒ Object
22
23
24
25
26
|
# File 'lib/logstash/api/commands/default_metadata.rb', line 22
def http_address
@http_address ||= service.get_shallow(:http_address).value
rescue ::LogStash::Instrument::MetricStore::MetricNotFound, NoMethodError => e
nil
end
|
#version ⇒ Object
18
19
20
|
# File 'lib/logstash/api/commands/default_metadata.rb', line 18
def version
LOGSTASH_CORE_VERSION
end
|