Skip to content

inputs.http cookie_auth_headers cannot unmarshal TOML string into map[string]string #11134

@antitbone

Description

@antitbone

Relevant telegraf.conf

# isilon

[[inputs.http]]
  urls = [
    "https://isilon:8080/platform/1/snapshot/snapshots-summary"
  ]

  cookie_auth_url = "https://isilon:8080/session/1/session"
  cookie_auth_method = "POST"
  cookie_auth_headers = '{"Content-Type": "application/json"}'
  cookie_auth_body = '{"username": "XXX", "password": "XXX, "services": ["platform"]}'
  cookie_auth_renewal = "6h"

  name_override = "snapshots"
  insecure_skip_verify = true
  data_format = "json"
  [inputs.http.tags]
    isilon_host = "isilon"


[[outputs.influxdb]]
  urls = ["http://influx:8086"]
  database = "XXX"
  username = "XXX"
  password = "XXX"
  skip_database_creation = true
  [outputs.influxdb.tagpass]
    isilon_host  = ["isilon"]

Logs from Telegraf

2022-05-18T15:11:18Z E! [telegraf] Error running agent: Error loading config file /etc/telegraf/telegraf.d/isilon-dna.conf: error parsing http, line 10: (http.HTTP.Headers) cannot unmarshal TOML string into map[string]string

System info

telegraf-1.22.4

the "cookie_auth_headers" parameter does not seem to work

The error also occurs with the default parameter:

cookie_auth_headers = '{"Content-Type": "application/json", "X-MY-HEADER":"hello"}'
curl -ik https://isilonr:8080/session/1/session -X POST -H 'Content-Type: application/json' -d '{ "username": "XXX", "password": "XXX", "services": ["platform"] }'

HTTP/1.1 201 Created
Date: Wed, 18 May 2022 15:15:16 GMT
Server: Apache
X-Frame-Options: sameorigin
Strict-Transport-Security: max-age=31536000;
Set-Cookie: isisessid=17a4416e-52ee-4dc3-b33c-c6cf1cf91e69; path=/; HttpOnly; Secure; SameSite=strict
Set-Cookie: isicsrf=bb8b666a-acd5-4294-b30f-fff134529e29; path=/; Secure
Content-Length: 92
Content-Type: application/json

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/influxdbbugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions