telegraf icon indicating copy to clipboard operation
telegraf copied to clipboard

input.file with tags errors on start

Open UnoSD opened this issue 7 months ago • 0 comments

Relevant telegraf.conf

[[inputs.file]]
  files = ["/data/*.Food.csv"]
  data_format = "csv"
  csv_header_row_count = 1
  csv_timestamp_column = "Date & Time"
  csv_timezone = "Europe/Rome"
  csv_timestamp_format = "2025/01/20 19:01:01"
  csv_tag_columns = ["Meal","Name","Amount"]
  csv_field_columns = ["Calories, cals","Food Grade,","Food Grade Keto,","Food Grade Low-Carb,","Total Fat, g","Monounsaturated Fat, g","Polyunsaturated Fat, g","Total Carbs, g","Net Carbs, g","Diabetes Carb Count, g","Dietary Fiber, g","Total Sugars, g","Added Sugars, g","Protein, g","Cholesterol, mg","Sodium, mg","Vitamin A, iu","Vitamin C, mg","Calcium, mg","Iron, mg","Potassium, mg","Alcohol, g","Caffeine, mg","Soluble Fiber, g","Fiber insoluble, g","Sugar Alcohols, g","Starch, g","Sucrose, g","Glucose (Dextrose), g","Fructose, g","Lactose, g","Maltose, g","Allulose, g","Galactose, g","Retinol, mcg","Alpha-carotene, mcg","Beta-carotene, mcg","Lutein, mcg","Zeaxanthin, mcg","Beta-cryptoxanthin, mcg","Lutein + Zeaxanthin, mcg","Lycopene, mcg","Vitamin D, iu","Beta-tocopherol, mcg","Delta-tocopherol, mcg","Gamma-tocopherol, mcg","Vitamin E, mg","Vitamin K, mcg","Thiamin, mg","Riboflavin, mg","Niacin, mg","Vitamin B-6, mg","Folate, mcg","Folic Acid, mcg","Folate DFE, mcg","Vitamin B-12, mcg","Pantothenic Acid, mg","Biotin, mcg","Choline, mg","Phosphorus, mg","Magnesium, mg","Zinc, mg","Selenium, mcg","Copper, mg","Manganese, mg","Chromium, mcg","Iodine, mcg","Molybdenum, mcg","Boron, mcg","Sulfur, mg","Chloride, mg","Cobalt, mcg","Alanine, mg","Arginine, mg","Aspartic Acid, mg","Cysteine, mg","Cystine, mg","Glutamic Acid, mg","Glutamine, mg","Glycine, mg","Histidine, mg","Hydroxyproline, mg","Isoleucine, mg","Leucine, mg","Lysine, mg","Methionine, mg","Phenylalanine, mg","Proline, mg","Serine, mg","Threonine, mg","Tryptophan, mg","Tyrosine, mg","Valine, mg","Taurine, mg","Water, g","Omega-3s, mg","Omega-3 ALA, mg","Omega-3 EPA, mg","Omega-3 DHA, mg","Omega-6s, mg","Omega-6 LA, mg","Omega-9 EA, mg","MCTs, g","Caproic Acid, g","Caprylic Acid, g","Capric Acid, g","Lauric Acid, g","Coenzyme Q10, mg","Oxalate, mg","Phytosterols, mg","Fluoride, mcg"]

  [inputs.file.tags]
    bucket = ["mynetdiary"]

[[outputs.influxdb_v2]]
  urls = ["http://localhost:8086"]
  organization = "unompc"
  bucket = "mynetdiary"
  token = "$INFLUX_TOKEN"
  [outputs.influxdb_v2.tagpass]
    bucket = ["mynetdiary"]

Logs from Telegraf

2025-06-03T07:49:18Z I! Loading config: /etc/telegraf/telegraf.d/mynetdiary.food.conf
2025-06-03T07:49:18Z E! loading config file /etc/telegraf/telegraf.d/mynetdiary.food.conf failed: error parsing file, could not parse tags for input file

System info

Telegraf latest container (1.34.4 (git: HEAD@e7ce1e1e)), running on Debian 12

Docker

No response

Steps to reproduce

  1. Add the file above to telegraf.d
  2. Restart the Telegraf container
  3. Look at the logs

Expected behavior

Tags added and used for filtering data to a bucket

Actual behavior

Telegraf does not start

Additional info

Only other /etc/telegraf.conf

[agent]
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  hostname = ""
  omit_hostname = false
 
[[inputs.docker]]
  endpoint = "unix:///var/run/docker.sock"
  gather_services = false
  source_tag = false
  container_name_include = []
  container_name_exclude = []
  timeout = "5s"
  perdevice = true
  total = false
  docker_label_include = []
  docker_label_exclude = []
  tag_env = ["JAVA_HOME", "HEAP_SIZE"]
  [inputs.docker.tags]
    bucket = "unompc"

[[outputs.influxdb_v2]]
  urls = ["http://influxdb:8086"]
  token = "$INFLUX_TOKEN"
  organization = "unompc"
  bucket = "unompc"
  [outputs.influxdb_v2.tagpass]
    bucket = ["unompc"]

UnoSD avatar Jun 03 '25 08:06 UnoSD