Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge processor issue #585

Open
bondar-aleksandr opened this issue Jan 21, 2025 · 1 comment
Open

Merge processor issue #585

bondar-aleksandr opened this issue Jan 21, 2025 · 1 comment

Comments

@bondar-aleksandr
Copy link

Hi team,

gnmic configured as below:

subscriptions:
  intf-config:
    prefix: "rfc7951:/Cisco-IOS-XE-interfaces-oper:interfaces/interface"
    stream-mode: sample
    sample-interval: 1m
    paths:
      - "oper-status"
      - "phys-address"
      - "speed"
      - "description"
      - "mtu"
      - "vrf"
      - "ipv4"
      - "ipv4-subnet-mask"
  
processors:
  trim-prefix-intf:
    event-strings:
      value-names:
        - ".*"
      transforms:
        - trim-prefix:
            apply-on: "name"
            prefix: "/rfc7951:/Cisco-IOS-XE-interfaces-oper:interfaces/interface/"
  merge-values:
    event-merge:
      always: true
      debug: true

outputs:
  file01:
    type: file
    filename: /outputs/output.txt
    format: event
    event-processors:
      - trim-prefix-intf
      - merge-values

However, output file is populated by some wierd data:

[{"name":"intf-config","timestamp":1737474240998661000,"tags":{"interface_name":"Vlan99","source":"172.18.59.1:9339","subscription-name":"intf-config"},"values":{"oper-status":"if-oper-state-ready"}}]
[{"name":"intf-config","timestamp":1737474241025068000,"tags":{"interface_name":"Vlan99","source":"172.18.59.1:9339","subscription-name":"intf-config"},"values":{"phys-address":"a0:b4:39:0d:e9:5d"}}]
[{"name":"intf-config","timestamp":1737474241045733000,"tags":{"interface_name":"Vlan99","source":"172.18.59.1:9339","subscription-name":"intf-config"},"values":{"speed":"1000000000"}}]
[{"name":"intf-config","timestamp":1737474241062160000,"tags":{"interface_name":"Vlan99","source":"172.18.59.1:9339","subscription-name":"intf-config"},"values":{"description":"Lab_Crime2"}}]
[{"name":"intf-config","timestamp":1737474241077825000,"tags":{"interface_name":"Vlan99","source":"172.18.59.1:9339","subscription-name":"intf-config"},"values":{"vrf":""}}]
[{"name":"intf-config","timestamp":1737474241092730000,"tags":{"interface_name":"Vlan99","source":"172.18.59.1:9339","subscription-name":"intf-config"},"values":{"mtu":9198}}]
[{"name":"intf-config","timestamp":1737474241107748000,"tags":{"interface_name":"Vlan99","source":"172.18.59.1:9339","subscription-name":"intf-config"},"values":{"ipv4":"10.19.15.1"}}]
[{"name":"intf-config","timestamp":1737474241123203000,"tags":{"interface_name":"Vlan99","source":"172.18.59.1:9339","subscription-name":"intf-config"},"values":{"ipv4-subnet-mask":"255.255.255.0"}}]

Only one interface is there, and values are not merged. The file is populated really slowly.

@karimra
Copy link
Collaborator

karimra commented Jan 25, 2025

The merge processor works on events received as part of the same gNMI Subscribe Response.
In your case each one of those values is received in a separate gNMI Subscribe Response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants