Class: Fluent::Plugin::FestivalInput
- Inherits:
-
Input
- Object
- Input
- Fluent::Plugin::FestivalInput
show all
- Includes:
- FestivalProxy
- Defined in:
- lib/fluent/plugin/in_festival.rb
Instance Method Summary
collapse
#add_location, #create_session, #create_session_request, #delete_session, #delete_session_request, #error_handler, #get_data, #get_data_header, #get_data_request, #get_historical_data, #resource_path, #resource_type, #shutdown_proxy, #start_proxy, #valid_session?
Instance Method Details
65
66
67
|
# File 'lib/fluent/plugin/in_festival.rb', line 65
def configure(conf)
super
end
|
#emit(record) ⇒ Object
Sample data from FESTIVAL IoT Gateway (sensinact) time_key must be set to “date” “1017.57”, “date”: “2017-03-29T16:19:15Z”
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
# File 'lib/fluent/plugin/in_festival.rb', line 87
def emit(record)
begin
time = Fluent::EventTime.now
if record.is_a?(Array) mes = Fluent::MultiEventStream.new
record.each do |single_record|
mes.add(time, single_record)
end
router.emit_stream(@tag, mes)
else router.emit(@tag, time, record)
end
rescue Exception => e
log.error error: e.to_s
log.debug_backtrace(e.backtrace)
end
end
|
#shutdown ⇒ Object
107
108
109
110
|
# File 'lib/fluent/plugin/in_festival.rb', line 107
def shutdown
shutdown_proxy
super
end
|
#start ⇒ Object
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
# File 'lib/fluent/plugin/in_festival.rb', line 69
def start
super
start_proxy
timer_execute(:in_festival, @polling_interval) do
begin
data = get_data
emit(data) if !(data.nil? || data.empty?)
rescue Exception => e
log.error error: e.to_s
log.debug_backtrace(e.backtrace)
end
end
end
|