influxdata / influxdata/telegraf

[processors.snmp_lookup] Add support for non-indexed values (e.g. sysName)

Open
#17,306 3 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

Description

### Use Case

I want to add `RFC1213-MIB::sysUpTime.0` as tag to metrics. (e.g. network interface traffic, printer supplies,...). Can we make the `index_tag` value optional and if it's not defined by the configuration, the value is applied to all metrics of the `agent_tag`?

### Expected behavior

Using this configuration:
```
[[inputs.snmp]]
agents = ["udp://10.20.30.40:161" ]
name_override = "printers"

[[inputs.snmp.table]]
oid = "Printer-MIB::prtMarkerSuppliesTable"
[[inputs.snmp.table.field]]
oid = "Printer-MIB::prtMarkerSuppliesDescription"
is_tag = true

[[processors.snmp_lookup]]
agent_tag = "agent_host"
namepass = ["printers"]
[[processors.snmp_lookup.tag]]
oid = "RFC1213-MIB::sysName.0"
name = "sysName"
```

I expect results like:
```
printers,agent_host=10.20.30.40,some_more_tags=foo,prtMarkerSuppliesDescription=foo,sysName=pri-somewhere some_fields=123i,prtMarkerSuppliesColorantIndex=2i,prtMarkerSuppliesLevel=31i 1751993506000000000
printers,agent_host=10.20.30.40,some_more_tags=foo,prtMarkerSuppliesDescription=bar,sysName=pri-somewhere some_fields=123i,prtMarkerSuppliesColorantIndex=3i,prtMarkerSuppliesLevel=31i 1751993506000000000
printers,agent_host=10.20.30.40,some_more_tags=foo,prtMarkerSuppliesDescription=baz,sysName=pri-somewhere some_fields=123i,prtMarkerSuppliesColorantIndex=4i,prtMarkerSuppliesLevel=31i 1751993506000000000
```

I tried to add `sysName` as separate fields to the `inputs.snmp` plugin, but then I receive two results (one with sysName and some dummy field and one with the data) that I later have to join somehow (aggregators.merge can't join on tags)

### Actual behavior

the `processors.snmp_lookup` plugin doesn't accept the configuration.

### Additional info

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at the processors.snmp_lookup plugin and its configuration handling for tag entries, then trace how agent_tag and index_tag are applied to metrics. Compare the current configuration requirements with the supplied non-indexed sysName example. Done means the configuration is accepted and sysName appears on every matching metric without requiring index_tag.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.