fix(inputs.gnmi): Do not provide empty prefix for subscription request. (#12275)
This commit is contained in:
parent
c6dbc3f689
commit
54f4a3a38b
|
|
@ -255,6 +255,12 @@ func (c *GNMI) newSubscribeRequest() (*gnmiLib.SubscribeRequest, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// Do not provide an empty prefix. Required for Huawei NE40 router v8.21
|
||||
// (and possibly others). See https://github.com/influxdata/telegraf/issues/12273.
|
||||
if gnmiPath.Origin == "" && gnmiPath.Target == "" && len(gnmiPath.Elem) == 0 {
|
||||
gnmiPath = nil
|
||||
}
|
||||
|
||||
if c.Encoding != "proto" && c.Encoding != "json" && c.Encoding != "json_ietf" && c.Encoding != "bytes" {
|
||||
return nil, fmt.Errorf("unsupported encoding %s", c.Encoding)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue