Skip to content

Instantly share code, notes, and snippets.

@djdunc
Last active September 24, 2026 18:19
Show Gist options
  • Select an option

  • Save djdunc/98cfd9f3d4c13ee5c45171f6078dfcf0 to your computer and use it in GitHub Desktop.

Select an option

Save djdunc/98cfd9f3d4c13ee5c45171f6078dfcf0 to your computer and use it in GitHub Desktop.
sample telegraf file for L7 PiCloud workshop
# Telegraf Configuration
###############################################################################
# Global settings - you don't need to edit these #
###############################################################################
# Global tags can be specified here in key="value" format.
[global_tags]
# Configuration for telegraf agent
[agent]
## Default data collection interval for all inputs
## For the L7 PiCloud demo you dont need to change any these settings
interval = "10s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
precision = ""
debug = false
quiet = false
logfile = ""
## Override default hostname, if empty use os.Hostname()
hostname = ""
## If set to true, do no set the "host" tag in the telegraf agent.
omit_hostname = false
###############################################################################
# OUTPUT PLUGINS #
###############################################################################
[[outputs.influxdb_v2]]
urls = ["http://127.0.0.1:8086"]
## Token for authentication.
token = "uA4qhE38xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxXSxW8uGn4ozeOmNx4HZQ=="
## Organization is the name of the organization you wish to write to; must exist.
organization = "casa0014"
## Destination bucket to write into.
bucket = "mqtt-data"
###############################################################################
# SERVICE INPUT PLUGINS #
###############################################################################
# ----- Weather Stations -----------------------------------
[[inputs.mqtt_consumer]]
servers = ["tcp://mqtt.cetools.org:1883"]
topics = [
"UCL/OPS/Garden/WST/dvp2/loop"
]
client_id = ""
topic_tag = "weather-topics"
data_format = "json"
# Tell Telegraf to treat these quoted strings as fields instead of dropping them
json_string_fields = [
"outTemp_C", "inTemp_C", "pressure_mbar", "barometer_mbar",
"altimeter_mbar", "windSpeed_kph", "windDir", "outHumidity",
"inHumidity", "rainRate_cm_per_hour", "radiation_Wpm2", "UV",
"windGust_kph", "dewpoint_C", "heatindex_C", "appTemp_C"
]
# Convert the stringified numbers into real numeric floats for InfluxDB and Grafana
[[processors.converter]]
[processors.converter.fields]
float = [
"outTemp_C", "inTemp_C", "pressure_mbar", "barometer_mbar",
"altimeter_mbar", "windSpeed_kph", "windDir", "outHumidity",
"inHumidity", "rainRate_cm_per_hour", "radiation_Wpm2", "UV",
"windGust_kph", "dewpoint_C", "heatindex_C", "appTemp_C"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment