logstash-plugins / logstash-output-influxdb

Apache License 2.0
58 stars 79 forks source link

db => "%{var_name}" doesn't work #79

Open ghost opened 6 years ago

ghost commented 6 years ago

Hi there!

I'm trying to insert diferent measurements into diferent databases, but, in spite of I have a field "db_name" that takes correct databases names, Logstash tells me that "%{db_name} is not a valid database", and it doesn't take the value of [db_name].

This is my code:

influxdb {
    host => "localhost"
    db => "%{db_name}"
    measurement => "%{ms_name}"
    data_points => { 'val' => '%{[value]}' }
    coerce_values => { 'val' => 'integer' }
    send_as_tags => []
}
TheVastyDeep commented 2 years ago

Issue #82 explains the problem better. PR #87 shows the one line fix that is needed. The bug was introduced when the output was modified to use the gem instead of doing an HTTP POST.