Blame | Last modification | View Log | Download
# Configuration file for telegraf# Parse MQTT# Store in influxdb v1[[inputs.mqtt_consumer]]# use underscoresalias = "dsmr"name_override = "dsmr"servers = ["tcp://mqtt:1883"]username = "username" # CHANGEpassword = "password" # CHANGEqos = 0persistent_session = falsetopics = [ "dsmr/el", "dsmr/gas" ]client_id = "telegraf-dsmr-d"data_format = "json_v2"[[inputs.mqtt_consumer.json_v2]]# A string that will become the new measurement namemeasurement_name = "dsmr"# A string with valid GJSON path syntax to a valid timestamp (single value)timestamp_path = "@this.timestamp"timestamp_format = "unix"[[inputs.mqtt_consumer.json_v2.object]]# A string with valid GJSON path syntax, can include array's and object'spath = "@this"### Configuration to define what JSON keys should be included and how (field/tag) #### List of JSON keys (for a nested key, prepend the parent keys with underscores) to be a tag instead of a field,# when adding a JSON key in this list you don't have to define it in the included_keys list# database tag to determine which influxdb to be usedtags = ["serial"]# List of JSON keys (for a nested key, prepend the parent keys with underscores) that shouldn't be included in result# Exclude the mqtt/json key "timestamp" from influxdbexcluded_keys = ["timestamp"]# A map of JSON keys (for a nested key, prepend the parent keys with underscores) with a type (int,uint,float,string,bool)[inputs.mqtt_consumer.json_v2.object.fields]V1 = "uint"V2 = "uint"V3 = "uint"V1_sags = "uint"V2_sags = "uint"V3_sags = "uint"V1_swells = "uint"V2_swells = "uint"V3_swells = "uint"el_consumed = "uint"el_returned = "uint"p_consumed = "uint"p_generated = "uint"# P1_consumed = "uint"# P1_generated = "uint"# P2_consumed = "uint"# P2_generated = "uint"# P3_consumed = "uint"# P3_generated = "uint"long_power_failures = "uint"power_failures = "uint"timestamp = "uint"gas_consumed = "uint"# Influx DB v1[[outputs.influxdb]]urls = ["http://influxdb:8086"]# database = "dsmr" # requireddatabase = "dsmr"namepass = ["dsmr"]## Retention policy to write to. Empty string writes to the default rp.retention_policy = ""## Write consistency (clusters only), can be: "any", "one", "quorum", "all"write_consistency = "any"## Write timeout (for the InfluxDB client), formatted as a string.## If not provided, will default to 5s. 0s means no timeout (not recommended).timeout = "5s"# Prepare for transition to InfluxDB v2[[outputs.influxdb_v2]]## The URLs of the InfluxDB cluster nodes.#### Multiple URLs can be specified for a single cluster, only ONE of the## urls will be written to each interval.## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]urls = ["http://influxdb2:8086"]## API token for authentication/write access to bucket.token = "my secrete token=="## Organization is the name of the organization you wish to write to; must exist.## Created at initialization of InfluxDB2 instanceorganization = "Home"## Make sure that bucket does existbucket = "dsmr"namepass = ["dsmr"]