代码之家  ›  专栏  ›  技术社区  ›  user316114

Telegraf:多个HTTP输入行

  •  0
  • user316114  · 技术社区  · 5 年前

    运行代理时出错:分析时出错电话会议,toml:第333行: 表“headers”与第311行中的普通表冲突

    [[inputs.http]]
      headers = {"Content-Type" = "application/json", "X-M2EE-Authentication" = "fooBar", "action" = "action1", "params" = "{}"}
    
    
      urls = [
        "http://localhost:8090"
      ]
    
      method = "POST"
      data_format = "json"
    
    
    
    [[inputs.http]]
      headers = {"Content-Type" = "application/json", "X-M2EE-
    Authentication" = "fooBar", "action" = "action2", "params" = "{}"}
    
      urls = [
        "http://localhost:8090"
      ]
    
      method = "POST"
      data_format = "json"
    

    github here

    goroutine 1 [running]:
    reflect.MakeSlice(0x2905820, 0x1edf720, 0x0, 0x1, 0x1edf720, 0xc0001fa870, 0x23)
            /usr/local/go/src/reflect/value.go:2192 +0x1e9
    github.com/influxdata/telegraf/vendor/github.com/influxdata/toml.setArray(0x1edf720, 0xc000099b80, 0x198, 0xc0000a9b80, 0x20, 0x0)
            /Users/gangadhar/go/src/github.com/influxdata/telegraf/vendor/github.com/influxdata/toml/decode.go:347 +0x218
    github.com/influxdata/telegraf/vendor/github.com/influxdata/toml.setValue(0x1edf720, 0xc000099b80, 0x198, 0x28bfb20, 0xc0000a9b80, 0x1edf720, 0xc000099b80)
            /Users/gangadhar/go/src/github.com/influxdata/telegraf/vendor/github.com/influxdata/toml/decode.go:266 +0x4b1
    github.com/influxdata/telegraf/vendor/github.com/influxdata/toml.UnmarshalTable(0xc00048a3c0, 0x1f8a640, 0xc00047ad80, 0x1f8a601, 0x1f8a640)
            /Users/gangadhar/go/src/github.com/influxdata/telegraf/vendor/github.com/influxdata/toml/decode.go:127 +0x1068
    github.com/influxdata/telegraf/vendor/github.com/influxdata/toml.UnmarshalTable(0xc0000de280, 0x21a38c0, 0xc0001e0300, 0xc0004b8600, 0x0)
            /Users/gangadhar/go/src/github.com/influxdata/telegraf/vendor/github.com/influxdata/toml/decode.go:161 +0xa85
    github.com/influxdata/telegraf/internal/config.(*Config).addInput(0xc000404000, 0xc00014b110, 0x4, 0xc0000de280, 0x0, 0x0)
            /Users/gangadhar/go/src/github.com/influxdata/telegraf/internal/config/config.go:926 +0x181
    github.com/influxdata/telegraf/internal/config.(*Config).LoadConfig(0xc000404000, 0xc0000ac0a0, 0xd, 0x42f7db0, 0x1)
            /Users/gangadhar/go/src/github.com/influxdata/telegraf/internal/config/config.go:681 +0x661
    main.runAgent(0x28d0de0, 0xc0000a8940, 0x42f7db0, 0x0, 0x0, 0x42f7db0, 0x0, 0x0, 0x0, 0x0)
            /Users/gangadhar/go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:122 +0x2c5
    main.reloadLoop(0xc000174000, 0x42f7db0, 0x0, 0x0, 0x42f7db0, 0x0, 0x0, 0x42f7db0, 0x0, 0x0, ...)
            /Users/gangadhar/go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:102 +0x26c
    main.main()
            /Users/gangadhar/go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:386 +0x56d
    

    在telegraf中有没有已知的方法可以使用多个HTTP输入配置?

    0 回复  |  直到 5 年前