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
13
14
15
16
17
18
19
20
21
22
23
24
|
# 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,
:ephemeral_id => service.agent.ephemeral_id,
:status => "green", :snapshot => ::BUILD_INFO["build_snapshot"],
:pipeline => {
:workers => LogStash::SETTINGS.get("pipeline.workers"),
:batch_size => LogStash::SETTINGS.get("pipeline.batch.size"),
:batch_delay => LogStash::SETTINGS.get("pipeline.batch.delay"),
}
}
end
|
#host ⇒ Object
26
27
28
|
# File 'lib/logstash/api/commands/default_metadata.rb', line 26
def host
@@host ||= Socket.gethostname
end
|
#http_address ⇒ Object
34
35
36
37
38
|
# File 'lib/logstash/api/commands/default_metadata.rb', line 34
def http_address
@http_address ||= service.get_shallow(:http_address).value
rescue ::LogStash::Instrument::MetricStore::MetricNotFound, NoMethodError => e
nil
end
|
#version ⇒ Object
30
31
32
|
# File 'lib/logstash/api/commands/default_metadata.rb', line 30
def version
LOGSTASH_CORE_VERSION
end
|