parse config: toml: type mismatch for teams.Config: expected table but found []map[string]interface {}

637 views Asked by At

I'm trying to add multiple teams configuration on kapacitor to send alerts to different teams channles. I have the following structure for a kapacitor.conf TOML file:

[[serverset]]
  enabled = false
  id = "myserverset"
  timeout = "10s"

[[teams]]
  enabled = true
  default = true
  channel-url = "--webhook url1--"
  global = false
  state-changes-only = true

[[teams]]
  enabled = true
  default = false
  channel-url = "--webhook url2--"
  global = false
  state-changes-only = true

It is giving the following error when I'm trying to restart the capacitor after changing the file

lvl=error msg="encountered error" service=run err="parse config: toml: type mismatch for teams.Config: expected table but found []map[string]interface {}"

The kapacitor isn't giving any error for below config

[[a]]
  enable = true
  
[[a]]
  enable = false

But when I replace a with teams it is giving the same error

[[teams]]
  enable = true
  
[[teams]]
  enable = false

I am able to set single teams configuration but multiple teams configuration is giving error.

0

There are 0 answers