logstash-plugins / logstash-output-influxdb

Apache License 2.0
58 stars 77 forks source link

Add sprintf formatting for column names in coerce_values. #10

Closed Wilfred closed 8 years ago

Wilfred commented 9 years ago

Fixes https://github.com/logstash-plugins/logstash-output-influxdb/issues/9 .

brupm commented 9 years ago

@Wilfred please add more details and a test case otherwise @jordansissel close it?

Wilfred commented 9 years ago

I often find myself writing:

input {
    udp {
        port => 25800
        buffer_size => 1452
        codec => collectd { }
    }
}

output {
    if [collectd_type] == "memory" or [collectd_type] == "cpu" or [collectd_type] == "swap" or [collectd_type] == "if_octets" or [collectd_type] == "df_complex" {
        influxdb {
            host => "example.com"
            db => "metrics"
            user => "foo"
            password => "bar"
            series => "%{host}"
            data_points => {"%{collectd_type}.%{type_instance}" => "%{value}"}
            coerce_values => {"%{collectd_type}.%{type_instance}" => "float"}
        }
    }
}

Without supporting sprintf_formatting for coerce_values, I'm forced to duplicate my influxdb section.

Does that seem reasonable? I'm happy to add some tests.

brupm commented 9 years ago

Tests would be awesome!

elasticsearch-release commented 9 years ago

Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'.

suyograo commented 8 years ago

@Wilfred can you rebase, add tests and reopen a new PR?. I am going to close this PR since master has deviated with #29 and #30. Thanks much