Hi
I am using the amqp_consumer to collect data from rabbitmq, which is receiving data from pmacct, in json format.
However no data is getting into InfluxDb, and the telegraf log is showing the following error’s
eg
2017-08-15T08:39:31Z E! metric parsing error, reason: [invalid field format], buffer: [{“event_type”: “purge”, “ip_src”: “192.168.0.3”, “ip_dst”: “192.168.0.1”, “port_src”: 44962, “port_dst”: 161, “ip_proto”: “udp”, “tos”: 0, “stamp_inserted”: “2017-08-15 09:35:00”, “stamp_updated”: “2017-08-15 09:39:31”, “packets”: 2, “bytes”: 146, “writer_id”: “default_amqp/2616”}], index: [23]: error parsing metric - {“event_type”: “purge”, “ip_src”: “192.168.0.3”, “ip_dst”: “192.168.0.1”, “port_src”: 44962, “port_dst”: 161, “ip_proto”: “udp”, “tos”: 0, “stamp_inserted”: “2017-08-15 09:35:00”, “stamp_updated”: “2017-08-15 09:39:31”, “packets”: 2, “bytes”: 146, “writer_id”: “default_amqp/2616”}
To answer own question, missed the fact that telegraf requires a topic exhange, while pmacct only supports a direct exchange. Back to the drawing board
Hi
the topic issue is now resolved, but still getting the same error.
Is there any way to pre-process (cleanup) the data in telegraf, or will it need a specific plugin?
This is an option on the amqp_consumer input in your Telegraf configuration:
[[inputs.amqp_consumer]]
## Data format to output.
## Each data format has it's own unique set of configuration options, read
## more about them here:
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
data_format = "json"