Telegraf Won't Insert Measurement into InfluxDB

Hey! So I followed this guide https://docs.particle.io/tutorials/integrations/influxdata/ but telegraf won’t insert the collected example measurements into the telegraf database. The webhook is working fine, HTTP returns a positive response. This is the webhook code:

{
    "event": "mydb",
    "deviceID": "e00fce68f0c030a18e540c79",
    "responseTopic": "ok",
    "errorResponseTopic": "not ok",
    "url": "http://*********:1619/particle",
    "requestType": "POST",
    "noDefaults": true,
    "rejectUnauthorized": false,
    "responseTemplate": "",
    "json": "{\r\n  \"name\": \"{{{PARTICLE_EVENT_NAME}}}\",\r\n  \"data\": {{{PARTICLE_EVENT_VALUE}}},\r\n  \"coreid\": \"{{{PARTICLE_DEVICE_ID}}}\",\r\n  \"published_at\": \"{{{PARTICLE_PUBLISHED_AT}}}\",\r\n  \"userid\": \"{{{PRODUCT_USER_ID}}}\",\r\n  \"fw_version\": \"{{{PRODUCT_VERSION}}}\",\r\n  \"public\": \"{{{PARTICLE_EVENT_PUBLIC}}}\",\r\n  \"measurement\": \"mydataaa\"\r\n}",
}

Another weird thing is that telegraf --config telegraf.conf --test crashes after half a second of running, without outputting anything related to webhooks.

Any ideas on whats wrong?

Hey @geotsak, thanks for posting. Odd to hear that the telegraf instance itself is crashing, that would suggest there’s a config issue on the AWS side.

If you’re not tied to using AWS directly, another option is to use InfluxDB cloud. The Influx team just released an update to their docs for that integration a few weeks ago: https://www.influxdata.com/blog/integrating-particle-io-with-influxdb-cloud/

Thanks for the reply,
I am not using AWS, but a Virtual Private server. I am pretty sure my firewall settings are correct set, allowing the telegraf port, so I am not certain what the issue is.

1 Like

Hey @geotsak, sorry I didn’t think of this earlier, but there was another person that had a similar issue and fixed it by adding the “infux_db” field to his event JSON payload. See here: Influxdb Webhooks. Can you add that if you haven’t already?

1 Like

Thanks, that solved it!

1 Like

glad to hear it!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.