Skip to content

Commit

Permalink
fix: subscription options for gnmi (#1080)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongfei605 authored Oct 23, 2024
1 parent fd3d2b1 commit d063371
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions inputs/gnmi/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,16 @@ func (h *handler) handleSubscribeResponseUpdate(slist *types.SampleList, respons
}
value := field.value
disableConcatenating := false
base := field.path.String()
for _, sub := range h.subs {
base, _ := field.path.split()
if strings.HasSuffix(base, sub.Path) {
subPath := sub.Path
if len(strings.Split(base, ":")) >= 2 {
// origin is not null
if sub.Origin != "" {
subPath = sub.Origin + ":" + sub.Path
}
}
if strings.HasPrefix(base, subPath) {
// field.path => origin:path
// sub.path => path
disableConcatenating = sub.DisableConcatenation
Expand Down

0 comments on commit d063371

Please sign in to comment.