# Telegraf snmp plugin agent\_host\_tag, use value instead of hostname in source or another tag

**URL:** <https://community.influxdata.com/t/telegraf-snmp-plugin-agent-host-tag-use-value-instead-of-hostname-in-source-or-another-tag/55176>\
**Category:** Telegraf\
**Tags:** telegraf, snmp\
**Created:** [January 13, 2025, 12:50pm UTC](https://community.influxdata.com/t/telegraf-snmp-plugin-agent-host-tag-use-value-instead-of-hostname-in-source-or-another-tag/55176 "2025-01-13T12:50:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![whatasavings](https://avatars.discourse-cdn.com/v4/letter/w/65b543/32.png) [@whatasavings](https://community.influxdata.com/u/whatasavings)\
**Post date:** [January 13, 2025, 12:50pm UTC](https://community.influxdata.com/t/telegraf-snmp-plugin-agent-host-tag-use-value-instead-of-hostname-in-source-or-another-tag/55176/1 "2025-01-13T12:50:28Z")

</div>

Hi,  
I may be missing something here but is there a way to preserve the IP and use it as a tag, instead of or in addition to having it be resolved to hostname1?

```auto
[[inputs.snmp]]
  agents = ["1.2.3.4"]
  agent_host_tag = "source"
...

```

and output

```auto
  weather,source=hostname1 temperature=55 1465839830100400200

```

Thanks!

---

<div class="post-metadata">

**Author:** ![whatasavings](https://avatars.discourse-cdn.com/v4/letter/w/65b543/32.png) [@whatasavings](https://community.influxdata.com/u/whatasavings)\
**Post date:** [January 13, 2025, 2:50pm UTC](https://community.influxdata.com/t/telegraf-snmp-plugin-agent-host-tag-use-value-instead-of-hostname-in-source-or-another-tag/55176/2 "2025-01-13T14:50:37Z")

</div>

Ok, keeping `agent_host_tag = "agent_host"` gives both `source` and `agent_host` tag (the IP), just deprecated.

---

<div class="post-metadata">

**Author:** ![Hipska](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/hipska/32/3877_2.png) [@Hipska](https://community.influxdata.com/u/Hipska)\
**Post date:** [January 15, 2025, 8:08am UTC](https://community.influxdata.com/t/telegraf-snmp-plugin-agent-host-tag-use-value-instead-of-hostname-in-source-or-another-tag/55176/3 "2025-01-15T08:08:15Z")

</div>

It looks like something else in your config creates a `source` tag. This is indeed deprecated and the agent IP should be placed in the `source` tag to be streamlined with the other plugins…

---

<div class="post-metadata">

**Author:** ![whatasavings](https://avatars.discourse-cdn.com/v4/letter/w/65b543/32.png) [@whatasavings](https://community.influxdata.com/u/whatasavings)\
**Post date:** [January 15, 2025, 12:27pm UTC](https://community.influxdata.com/t/telegraf-snmp-plugin-agent-host-tag-use-value-instead-of-hostname-in-source-or-another-tag/55176/4 "2025-01-15T12:27:55Z")

</div>

Sorry, you’re right and I was being sloppy. `source` does the job just fine, except it was being overwritten…
