lib/fluent/plugin/out_kubernetes.rb in fluent-plugin-kubernetes-0.2.1 vs lib/fluent/plugin/out_kubernetes.rb in fluent-plugin-kubernetes-0.2.2
- old
+ new
@@ -17,11 +17,13 @@
require 'docker'
end
def emit(tag, es, chain)
es.each do |time,record|
- Fluent::Engine.emit('kubernetes', time, enrich_record(tag, record))
+ Fluent::Engine.emit('kubernetes',
+ time,
+ enrich_record(tag, record))
end
chain.next
end
@@ -35,10 +37,9 @@
def enrich_record(tag, record)
if @container_id
id = interpolate(tag, @container_id)
record['container_id'] = id
- puts id
container = Docker::Container.get(id)
if container
container_name = container.json['Name']
if container_name
record["container_name"] = container_name