Just instaled telegraf and im having some trouble with the config file

2022/11/14 10:11:03 I! Using config file: /etc/telegraf/telegraf.conf
2022/11/14 10:11:03 E! Could not parse [agent] config
2022/11/14 10:11:03 E! Error parsing /etc/telegraf/telegraf.conf, line 127: field corresponding to urls' is not defined in *config.AgentConfig’

Im using telegraf 1.8 on unraid

Can you show the [agent] section of your config (in a formatted code block please)? There seems to be an urls setting, and that is indeed not something that is supposed to be in there…

do you mean this?

urls = ["http://192.168.0.220:8086"]

Hi @Gerard_Du_Pre,
It would be really great if you could post your entire config :slight_smile: .

As @Hipska said I am not sure why this is within your agent config. If you would like some example configs you can check out this repo: GitHub - InfluxCommunity/Telegraf-Community-Configs: The purpose of this repository is to promote the creation, sharing, and reuse of configs among the Telegraf community. Anybody can submit new configs or improvements upon existing configs and use these configs in their own architectures.

Yes, that should not be in your [agent] section, but probably in the section for your InfluxDB output.

Yes here is the config file

If you want to enable a plugin, you need to uncomment its complete section, like this:

# Configuration for sending metrics to InfluxDB 2.0
[[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://192.168.0.220:8086"]

  ## Token for authentication.
  token = ""

  ## Organization is the name of the organization you wish to write to.
  organization = ""

  ## Destination bucket to write into.
  bucket = ""

  ## The value of this tag will be used to determine the bucket.  If this
  ## tag is not set the 'bucket' option is used as the default.
  # bucket_tag = ""

  ## If true, the bucket tag will not be added to the metric.
  # exclude_bucket_tag = false

  ## Timeout for HTTP messages.
  # timeout = "5s"

  ## Additional HTTP headers
  # http_headers = {"X-Special-Header" = "Special-Value"}

  ## HTTP Proxy override, if unset values the standard proxy environment
  ## variables are consulted to determine which proxy, if any, should be used.
  # http_proxy = "http://corporate.proxy:3128"

  ## HTTP User-Agent
  # user_agent = "telegraf"

  ## Content-Encoding for write request body, can be set to "gzip" to
  ## compress body or "identity" to apply no encoding.
  # content_encoding = "gzip"

  ## Enable or disable uint support for writing uints influxdb 2.0.
  # influx_uint_support = false

  ## Optional TLS Config for use on HTTP connections.
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = false
1 Like

Im not seeing any difference. Sorry it first time with telegraf

Hi @Gerard_Du_Pre,
We cannot access that link. Can you just copy and paste your full config in a code block here please.

It says its too large to paste.
here is another link

Hi @Gerard_Du_Pre,

# # Configuration for sending metrics to InfluxDB 2.0
  y[[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://192.168.0.220:8086"]
#

You have a “y” for some reason in front of your InfluxDB output plugin. Also you have not completed the config. Please check out the community configs I sent you as this will help teach you how to build a config: GitHub - InfluxCommunity/Telegraf-Community-Configs: The purpose of this repository is to promote the creation, sharing, and reuse of configs among the Telegraf community. Anybody can submit new configs or improvements upon existing configs and use these configs in their own architectures.

1 Like