Possible to add custom tags so I can sort by city/location name?

Hello,

I’ve been working on this today without success:

I have Telegraf, Influxdb and Grafana on the same VM that is using individual telegraf.conf files in the telegraf.d folder to pull snmp info from different sites. I need to tag these site locations so I can sort in Grafana.

I tried the [global_tags] command in each .conf file and it seems one overwrites the other (screenshot in reddit link).

I use the [[inputs.snmp]] in each .conf is there a way to tag in there?

I did try:

[[inputs.snmp]]
  agents = [ "10.20.30.1:161" ]
  version = 2
  community = "public"
  [inputs.snmp.tags]
     location="New York"

But telegraf would no longer start.

Any help would be most appreciated.

Thanks

Yes, of course:

https://docs.influxdata.com/telegraf/v1.17/administration/configuration/#input-config-tags

Besides that, you could also use prefix, suffix and override in each input plugin individually:

https://docs.influxdata.com/telegraf/v1.17/administration/configuration/#input-config-prefix-suffix-and-override

What is the error message?

I’ve just looked at you links and added the following and the service starts, but the “location” tag doesn’t show in the database if I run

“select * from snmp”

Just realise I used cpu tag which I don’t want, I need something to show the location of the datacenter.

Yes of course, because your syntax is wrong, it should be:

[inputs.snmp.tags]
  location = "Victoria"

And I doubt the following line works at all:

[[inputs.snmp.field]]