Cisco Telemetry Interface Data

I am sending telemetry data to telegraf and inserting it into influxdb. The data is being sent via NX-API. telegraf/Influx does not enter the data for each individual interface. I only receive data for a single interface.

How do I tell telegraf to index the data by the interface.

Any help or examples is appreciated.

Thanks, Mike

Hi Mike welcome !

Could it be that all the interfaces write the same datapoints ?
Can you give an example of a datapoint that is written in the database ?
Marc

Yes I believe that is the issue. For the given time period, all of the interfaces have the same data points. See the select statement below.

The JSON outfile has the same issue. One entry is also included.

There should be a way to index on “TABLE_interface//ROW_interface//interface” ???

{“fields”:{“TABLE_interface//ROW_interface//eth_inb1024_1518”:1,“TABLE_interface//ROW_interface//eth_inb128_255”:45441,“TABLE_interface//ROW_interface//eth_inb256_511”:6,“TABLE_interface//ROW_interface//eth_inb512_1023”:3,“TABLE_interface//ROW_interface//eth_inb64”:2730,“TABLE_interface//ROW_interface//eth_inb65_127”:1080393,“TABLE_interface//ROW_interface//eth_inbcast”:2,“TABLE_interface//ROW_interface//eth_inbytes”:96963270,“TABLE_interface//ROW_interface//eth_inmcast”:45302,“TABLE_interface//ROW_interface//eth_inpkts”:1128568,“TABLE_interface//ROW_interface//eth_inucast”:1119496,“TABLE_interface//ROW_interface//eth_l3avg1_inbytes”:1547757261,“TABLE_interface//ROW_interface//eth_l3avg1_inpkts”:19445478,“TABLE_interface//ROW_interface//eth_l3in_routed_bytes”:2147483647,“TABLE_interface//ROW_interface//eth_l3in_routed_pkts”:2147483647,“TABLE_interface//ROW_interface//eth_l3in_ucastbytes”:85987760,“TABLE_interface//ROW_interface//eth_l3in_ucastpkts”:1080320,“TABLE_interface//ROW_interface//eth_outb1024_1518”:1,“TABLE_interface//ROW_interface//eth_outb128_255”:100537,“TABLE_interface//ROW_interface//eth_outb256_511”:675126,“TABLE_interface//ROW_interface//eth_outb512_1023”:8925613,“TABLE_interface//ROW_interface//eth_outb64”:30166,“TABLE_interface//ROW_interface//eth_outb65_127”:2123685,“TABLE_interface//ROW_interface//eth_outbcast”:3,“TABLE_interface//ROW_interface//eth_outbytes”:2147483647,“TABLE_interface//ROW_interface//eth_outmcast”:588662,“TABLE_interface//ROW_interface//eth_outpkts”:11855128,“TABLE_interface//ROW_interface//eth_outucast”:11302707,“TABLE_interface//ROW_interface//interface”:“loopback0”,“TABLE_interface//ROW_interface//loop_in_bytes”:391853844,“TABLE_interface//ROW_interface//loop_in_pkts”:7165171,“TABLE_interface//ROW_interface//mgmt_in_bytes”:504923435,“TABLE_interface//ROW_interface//mgmt_in_mcast”:2631207,“TABLE_interface//ROW_interface//mgmt_in_overrun”:620825,“TABLE_interface//ROW_interface//mgmt_in_pkts”:5791674,“TABLE_interface//ROW_interface//mgmt_out_bytes”:270656361,“TABLE_interface//ROW_interface//mgmt_out_pkts”:780825},“name”:“show interface counter detailed”,“tags”:{“host”:“ubuntu-3”,“show interface counter detailed”:“show interface counter detailed”,“source”:“POD6-P3-7706”,“subscription”:“200”},“timestamp”:1561678804}

SELECT * FROM “show interface counter detailed” limit 2
name: show interface counter detailed
time TABLE_interface//ROW_interface//eth_inb1024_1518 TABLE_interface//ROW_interface//eth_inb128_255 TABLE_interface//ROW_interface//eth_inb256_511 TABLE_interface//ROW_interface//eth_inb512_1023 TABLE_interface//ROW_interface//eth_inb64 TABLE_interface//ROW_interface//eth_inb65_127 TABLE_interface//ROW_interface//eth_inbcast TABLE_interface//ROW_interface//eth_inbytes TABLE_interface//ROW_interface//eth_inmcast TABLE_interface//ROW_interface//eth_inpkts TABLE_interface//ROW_interface//eth_inucast TABLE_interface//ROW_interface//eth_l3avg1_inbytes TABLE_interface//ROW_interface//eth_l3avg1_inpkts TABLE_interface//ROW_interface//eth_l3in_routed_bytes TABLE_interface//ROW_interface//eth_l3in_routed_pkts TABLE_interface//ROW_interface//eth_l3in_ucastbytes TABLE_interface//ROW_interface//eth_l3in_ucastpkts TABLE_interface//ROW_interface//eth_outb1024_1518 TABLE_interface//ROW_interface//eth_outb128_255 TABLE_interface//ROW_interface//eth_outb256_511 TABLE_interface//ROW_interface//eth_outb512_1023 TABLE_interface//ROW_interface//eth_outb64 TABLE_interface//ROW_interface//eth_outb65_127 TABLE_interface//ROW_interface//eth_outbcast TABLE_interface//ROW_interface//eth_outbytes TABLE_interface//ROW_interface//eth_outmcast TABLE_interface//ROW_interface//eth_outpkts TABLE_interface//ROW_interface//eth_outucast TABLE_interface//ROW_interface//interface TABLE_interface//ROW_interface//loop_in_bytes TABLE_interface//ROW_interface//loop_in_pkts TABLE_interface//ROW_interface//mgmt_in_bytes TABLE_interface//ROW_interface//mgmt_in_mcast TABLE_interface//ROW_interface//mgmt_in_overrun TABLE_interface//ROW_interface//mgmt_in_pkts TABLE_interface//ROW_interface//mgmt_out_bytes TABLE_interface//ROW_interface//mgmt_out_pkts host show interface counter detailed source subscription

1561646723667000000 1 44905 6 3 2696 1067652 2 95820207 44767 1115257 1106292 339894072 4270281 2147483647 2147483647 84974025 1067576 1 100002 668713 8925613 30132 2110972 3 2147483647 581714 11835433 11289532 loopback0 385233367 7045627 500753800 2623554 617069 5743040 268738570 772248 ubuntu-3 show interface counter detailed POD6-P3-7706 200
1561646764009000000 1 44906 6 3 2696 1067668 2 95821717 44768 1115274 1106312 424873699 5337924 2147483647 2147483647 84975475 1067594 1 100003 668721 8925613 30132 2110988 3 2147483647 581723 11835458 11289552 loopback0 385239903 7045746 500758094 2623561 617069 5743094 268740734 772258 ubuntu-3 show interface counter detailed POD6-P3-7706 200

Thanks

Source is defined as a tag in the json output , is Source also a tag key in the database?
( example POD6-P3-7706)

Yes, the host is a tag in the outout and in the database. Is there a way to tag another field?

Thanks,
Mike

The host is a tag ( I guess ubuntu-3 ) , is the source also a tag ?

Yes source is also a tag. Is there a way to configure additional tags? Interface needs to be a tag.

If you can modify the data stream sent to telegraf , you have to place the interface field in the tags list following the line protocol …

measurement,tag1=x,tag2=y,tag3=z field1=1,field2=2 …

there must be a space between the last tag and the first field.

If you cannot modify the data sent , you can convert a field to a tag using the processor convertor …

@mdrons I’ve never used NX-API, but I looked over some documentation and it looks like it provides a HTTP server that responds with JSON? Are you then using the http input plugin to collect the data?

If this is how it works, then I believe it comes down to configuring the JSON parser, and in particular the tag_keys option. This parser does have its limits, but if you could paste the JSON being collected by Telegraf we might be able to provide some configuration tips.