InfluxDB output plugin - configuration for collectd metrics


(Marcin) #1

Hi guys, I'm using standard input collecd plugin for logstash to collect CPU, memory and network interface bandwidth usage and I'm trying to understand how to properly put these metrics in InfluxDB and how to configure community based InfluxDB plugin.

Official documentation is quite poor for that plugin and I cant find anything deeper for mine set up.
Here is my logstash conf:

input {
  udp {
    port => 25826         
    buffer_size => 1452  
    codec => collectd { }
    type => collectd
  }
}
output {
  influxdb {
        host => localhost
        user => ####
        password => ####
        db => collectd_metrics
        data_points => ?????
  }
}

What should be placed in 'data_points'? Can you provide example?

Here are my data sets directed to file:

{"host":"myhostname1.com","@timestamp":"2015-08-28T14:37:16.457Z","plugin":"interface","plugin_instance":"lo","collectd_type":"if_octets","rx":294944277,"tx":294944277,"@version":"1","type":"collectd"}
{"host":"myhostname1.com","@timestamp":"2015-08-28T14:37:16.457Z","plugin":"interface","plugin_instance":"lo","collectd_type":"if_packets","rx":194208,"tx":194208,"@version":"1","type":"collectd"}
{"host":"myhostname1.com","@timestamp":"2015-08-28T14:37:16.457Z","plugin":"load","collectd_type":"load","shortterm":0.03,"midterm":0.11,"longterm":0.06,"@version":"1","type":"collectd"}
{"host":"myhostname1.com","@timestamp":"2015-08-28T14:37:16.457Z","plugin":"memory","collectd_type":"memory","type_instance":"used","value":2.86130176E8,"@version":"1","type":"collectd"}
{"host":"myhostname1.com","@timestamp":"2015-08-28T14:37:16.457Z","plugin":"memory","collectd_type":"memory","type_instance":"buffered","value":2.43314688E8,"@version":"1","type":"collectd"}
{"host":"myhostname1.com","@timestamp":"2015-08-28T14:37:16.457Z","plugin":"memory","collectd_type":"memory","type_instance":"cached","value":1.845006336E9,"@version":"1","type":"collectd"}
{"host":"myhostname1.com","@timestamp":"2015-08-28T14:37:16.457Z","plugin":"memory","collectd_type":"memory","type_instance":"free","value":1.111437312E9,"@version":"1","type":"collectd"}
{"host":"myhostname1.com","@timestamp":"2015-08-28T14:37:16.457Z","plugin":"memory","collectd_type":"memory","type_instance":"slab_unrecl","value":2.6955776E7,"@version":"1","type":"collectd"}
{"host":"myhostname1.com","@timestamp":"2015-08-28T14:37:16.457Z","plugin":"memory","collectd_type":"memory","type_instance":"slab_recl","value":5.02104064E8,"@version":"1","type":"collectd"}
{"host":"myhostname1.com","@timestamp":"2015-08-28T14:37:16.457Z","plugin":"interface","plugin_instance":"lo","collectd_type":"if_errors","rx":0,"tx":0,"@version":"1","type":"collectd"}
{"host":"myhostname1.com","@timestamp":"2015-08-28T14:37:16.457Z","plugin":"interface","plugin_instance":"eth2","collectd_type":"if_octets","rx":260696446519,"tx":189650332,"@version":"1","type":"collectd"}
{"host":"myhostname1.com","@timestamp":"2015-08-28T14:37:16.457Z","plugin":"interface","plugin_instance":"eth2","collectd_type":"if_packets","rx":228205903,"tx":1406623,"@version":"1","type":"collectd"}
{"host":"myhostname1.com","@timestamp":"2015-08-28T14:37:16.457Z","plugin":"interface","plugin_instance":"eth2","collectd_type":"if_errors","rx":0,"tx":0,"@version":"1","type":"collectd"}

I would like to graph below data in grafana in next step.


(system) #2