-
Couldn't load subscription status.
- Fork 73
Open
Labels
Description
First db variable gets sprintf-ed in line 179.
logstash-output-influxdb/lib/logstash/outputs/influxdb.rb
Lines 179 to 186 in 288a3b5
| buffer_receive(event_hash, event.sprintf(@db)) | |
| end # def receive | |
| def flush(events, database, teardown = false) | |
| @logger.debug? and @logger.debug("Flushing #{events.size} events to #{database} - Teardown? #{teardown}") | |
| dowrite(events, database) | |
| end # def flush |
But then original "@db", rather than sprintf-ed "database" variable is used in line 190.
logstash-output-influxdb/lib/logstash/outputs/influxdb.rb
Lines 188 to 198 in 288a3b5
| def dowrite(events, database) | |
| begin | |
| @influxdbClient.write_points(events, @time_precision, @retention_policy, @db ) | |
| rescue InfluxDB::AuthenticationError => ae | |
| @logger.warn("Authentication Error while writing to InfluxDB", :exception => ae) | |
| rescue InfluxDB::ConnectionError => ce | |
| @logger.warn("Connection Error while writing to InfluxDB", :exception => ce) | |
| rescue Exception => e | |
| @logger.warn("Non recoverable exception while writing to InfluxDB", :exception => e) | |
| end | |
| end |
Correct code should look like this.
def dowrite(events, database)
begin
@influxdbClient.write_points(events, @time_precision, @retention_policy, database )
rescue InfluxDB::AuthenticationError => ae
@logger.warn("Authentication Error while writing to InfluxDB", :exception => ae)
rescue InfluxDB::ConnectionError => ce
@logger.warn("Connection Error while writing to InfluxDB", :exception => ce)
rescue Exception => e
@logger.warn("Non recoverable exception while writing to InfluxDB", :exception => e)
end
end
mlaradji, lai323 and cshimegi