balena-labs-projects / connector

Auto-configured data connector block based on Telegraf
15 stars 8 forks source link

Add ability to specify where ExternalHTTPListener data goes #21

Open chrisys opened 3 years ago

chrisys commented 3 years ago

Currently, when using the External HTTP Listener plugin, data posted to this endpoint from multiple sources ends up in the same place within InfluxDB. This works if you have two different data sources, but if you had two sources the same (two identical sensors in different locations, for example), that post the same data structure, it won't be possible to differentiate between the two.

phil-d-wilson commented 3 years ago

From: https://github.com/influxdata/telegraf/blob/release-1.15/plugins/inputs/http_listener_v2/README.md

there is a section for turning HTTP headers into tags:

  ## Optional setting to map http headers into tags
  ## If the http header is not present on the request, no corresponding tag will be added
  ## If multiple instances of the http header are present, only the first value will be used
  # http_header_tags = {"HTTP_HEADER" = "TAG_NAME"}

I need some samples to test with.

Flo3561 commented 3 years ago

I have the same issue. I am using the ExternalHTTPListener with TheThingsNetwork as described in the balena blog article: https://www.balena.io/blog/receive-and-store-lora-sensor-data-from-ttn-using-a-raspberry-pi/ Would be great to have an easy solution to be able to clearly log multiple same sensors.