openconfig / gnmic

gNMIc is a gNMI CLI client and collector
https://gnmic.openconfig.net
Apache License 2.0
166 stars 52 forks source link

Question: How to add common output file for set commands in config file? #455

Closed viinay closed 1 month ago

viinay commented 1 month ago

I am running this cli command to update device config. gnmic set --config config.yaml --update-path "/interfaces/interface[name=ge-0/0/1]/config/mtu" --update-value "256" --update-path "/interfaces/interface[name=ge-0/0/1]/config/type" --update-value "iana-if-type:ethernetCsmacd"

I want the output of this command to be pushed to kafka. I want to use config file to defined the output, similar to how to defined output for subscriptions.

Here is my config file:


timeout: 35s
insecure: true
encoding: JSON_IETF
log-file: /var/log/gnmic.log
debug: true
username: user
password: 'pass'

outputs:
  output1:
    type: kafka
    address: 10.2.0.13:9092
    topic: device-config-response```
karimra commented 1 month ago

Set responses cannot be written to outputs. If you want to do that, you can pipe the output to a kafka client.