Module: Fluent::EC2Metadata
Defined Under Namespace
Classes: PlaceholderExpander
Instance Method Summary
collapse
Instance Method Details
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/fluent/plugin/ec2_metadata.rb', line 11
def configure(conf)
super
@map = {}
conf.elements.select { |element| element.name == 'record' }.each { |element|
element.each_pair { |k, v|
element.has_key?(k) @map[k] = v
}
}
@placeholder_expander = PlaceholderExpander.new(log)
@ec2_metadata = get_metadata_and_tags
@refresh_thread = Thread.new {
while true
sleep @metadata_refresh_seconds
@ec2_metadata = get_metadata_and_tags
end
}
end
|
#initialize ⇒ Object
4
5
6
7
8
9
|
# File 'lib/fluent/plugin/ec2_metadata.rb', line 4
def initialize
super
require 'net/http'
require 'aws-sdk-ec2'
require 'oj'
end
|