Telegraf SNMP select OIDs

Hi,
how can I can collect only specific OIDs from an ifTable?
ie. I only want ifHCInOctets and ifHCOutOctets

Thanks.

If you don’t provide an OID for the table then only the specified fields will be gathered:

[[inputs.snmp]]
  agents = [ "127.0.0.1" ]
  version = 2
  community = "public"

  [[inputs.snmp.table]]
    name = "interface"

    [[inputs.snmp.table.field]]
    oid = "IF-MIB::ifHCInOctets"

    [[inputs.snmp.table.field]]
    oid = "IF-MIB::ifHCOutOctets"