fix(inputs.gnmi): Normalize path for inline origin handling (#14838)
This commit is contained in:
parent
e490983fe1
commit
8a838634c7
|
|
@ -141,6 +141,7 @@ func (pi *pathInfo) append(paths ...*gnmiLib.Path) *pathInfo {
|
|||
path.keyValues = append(path.keyValues, keyInfo)
|
||||
}
|
||||
}
|
||||
path.normalize()
|
||||
|
||||
return path
|
||||
}
|
||||
|
|
@ -172,6 +173,7 @@ func (pi *pathInfo) appendSegments(segments ...string) *pathInfo {
|
|||
}
|
||||
path.segments = append(path.segments, s)
|
||||
}
|
||||
path.normalize()
|
||||
|
||||
return path
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
interfaces-counter,name=AppGigabitEthernet1/0/1,source=127.0.0.1 discontinuity_time="2023-11-15T05:50:40+00:00" 1708069483623763000
|
||||
interfaces-counter,name=FortyGigabitEthernet1/1/1,source=127.0.0.1 discontinuity_time="2023-11-15T05:50:40+00:00" 1708069483623763000
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
[
|
||||
{
|
||||
"update": {
|
||||
"timestamp": "1708069483623763000",
|
||||
"update": [
|
||||
{
|
||||
"path": {
|
||||
"elem": [
|
||||
{
|
||||
"name": "Cisco-IOS-XE-interfaces-oper:interfaces"
|
||||
},
|
||||
{
|
||||
"name": "interface",
|
||||
"key": {
|
||||
"name": "AppGigabitEthernet1/0/1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "statistics"
|
||||
}
|
||||
]
|
||||
},
|
||||
"val": {
|
||||
"jsonIetfVal": "eyJkaXNjb250aW51aXR5LXRpbWUiOiIyMDIzLTExLTE1VDA1OjUwOjQwKzAwOjAwIn0K"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": {
|
||||
"elem": [
|
||||
{
|
||||
"name": "Cisco-IOS-XE-interfaces-oper:interfaces"
|
||||
},
|
||||
{
|
||||
"name": "interface",
|
||||
"key": {
|
||||
"name": "FortyGigabitEthernet1/1/1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "statistics"
|
||||
}
|
||||
]
|
||||
},
|
||||
"val": {
|
||||
"jsonIetfVal": "eyJkaXNjb250aW51aXR5LXRpbWUiOiIyMDIzLTExLTE1VDA1OjUwOjQwKzAwOjAwIn0K"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
[[inputs.gnmi]]
|
||||
addresses = ["dummy"]
|
||||
|
||||
[[inputs.gnmi.subscription]]
|
||||
name = "interfaces-counter"
|
||||
origin = "rfc7951"
|
||||
path = "/Cisco-IOS-XE-interfaces-oper:interfaces/interface/statistics"
|
||||
subscription_mode = "sample"
|
||||
sample_interval = "5s"
|
||||
Loading…
Reference in New Issue