# How to parse NX-API with telegraf

**URL:** <https://community.influxdata.com/t/how-to-parse-nx-api-with-telegraf/18096>\
**Category:** Systems\
**Created:** [January 30, 2021, 9:29am UTC](https://community.influxdata.com/t/how-to-parse-nx-api-with-telegraf/18096 "2021-01-30T09:29:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefanoromanello](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/stefanoromanello/32/6552_2.png) [@stefanoromanello](https://community.influxdata.com/u/stefanoromanello)\
**Post date:** [January 30, 2021, 9:29am UTC](https://community.influxdata.com/t/how-to-parse-nx-api-with-telegraf/18096/1 "2021-01-30T09:29:32Z")

</div>

Hi, I’m doing research on the best telemetry system. Currently, I’m starting from this guide [https://chapeter-sbx.readthedocs.io/en/latest/labs/metrics-grafana/](https://chapeter-sbx.readthedocs.io/en/latest/labs/metrics-grafana/) and I would like to replace pipeline with telegraph for more input compatibility. I’ve found this [https://ultraconfig.com.au/blog/cisco-telemetry-tutorial-with-telegraf-influxdb-and-grafana/](https://ultraconfig.com.au/blog/cisco-telemetry-tutorial-with-telegraf-influxdb-and-grafana/) which uses telegraf but its using the yang encoding in the switches instead of nx-api (as in the first guide).  
The question is: how can I parse the data in telegfraf from nx-api format before sending them to influxdb like pipeline which is using metrics.json?  
Ps: I’m not an expert and this is all new for me (edited)

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [February 1, 2021, 8:20pm UTC](https://community.influxdata.com/t/how-to-parse-nx-api-with-telegraf/18096/2 "2021-02-01T20:20:09Z")

</div>

Hello @stefanoromanello,  
Welcome!  
Have you had a chance to take a look at the execd processor plugin?  
I think that might be helpful to you.

> **[telegraf/plugins/processors/execd at master · influxdata/telegraf](https://github.com/influxdata/telegraf/tree/master/plugins/processors/execd)**
>
> master/plugins/processors/execd

---

<div class="post-metadata">

**Author:** ![stefanoromanello](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/stefanoromanello/32/6552_2.png) [@stefanoromanello](https://community.influxdata.com/u/stefanoromanello)\
**Post date:** [February 1, 2021, 10:14pm UTC](https://community.influxdata.com/t/how-to-parse-nx-api-with-telegraf/18096/3 "2021-02-01T22:14:05Z")

</div>

Hi thanks for the answer! Another user in slack suggests me to use telegraf\_gnmi and use it also for parsing the data like this:

```auto
[[inputs.cisco_telemetry_gnmi]]
    addresses = ["dallas.create2020.ntc.cloud.tesuto.com:50000"]
    username = <redacted>
    password = <redacted>

    ## redial in case of failures after
    redial = "10s"
    tagexclude = ["openconfig-network-instance:/network-instances/network-instance/protocols/protocol/name"]

    [[inputs.cisco_telemetry_gnmi.subscription]]
        origin = "openconfig-interfaces"
        path = "/interfaces/interface"

        subscription_mode = "sample"
        sample_interval = "10s"

    [[inputs.cisco_telemetry_gnmi.subscription]]
        name = "bgp_neighbor"
        origin = "openconfig-network-instance"
        path = "/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/state"

        subscription_mode = "sample"
        sample_interval = "10s"

```

Full guide at [Monitor Your Network With gNMI, SNMP, and Grafana | The NTC Mag](https://blog.networktocode.com/post/monitor_your_network_with_gnmi_snmp_and_grafana/)  
What do you think?

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [February 2, 2021, 4:30pm UTC](https://community.influxdata.com/t/how-to-parse-nx-api-with-telegraf/18096/4 "2021-02-02T16:30:41Z")

</div>

Hello @stefanoromanello,  
looks good to me!
