Split collected data and insert it as tags values




I’m using telegraf with inputs.snmp to collect interfaces descriptions from cisco devices.
So far it is working ok but telegraf inyects all the decription into one tag type column and I would like to split the text by whitespaces and insert it into different tag type columns.
I know this descriptions will always have the exact same format.

Can I do this with Telegraf? Or do i have to work with Kapacitor directly?
Or this can’t be done either way?

Telegraf v1.5.2
Kapacitor v1.4.0

agents = [ “HOST” ]
timeout = “10s”
retries = 3
version = 2
community = “public”
name = “test_table”
index_as_tag = true
name = “pppSessTot”
oid = “”
oid_index_suffix = “.1”
name = “description”
oid = “”
is_tag = true
name = “ifaceName”
oid = “”
name = “inbps”
oid = “”
name = “outbps”
oid = “”

Example output:

collector,index=435,description=Cisco Sub Interface Description ,agent_host=HOST ,host=grafana-srv pppSessTot=111,ifaceName=“InterfaceName”, inbps=4967476543061i,outbps=59008607926711i 1520963841000000000

I would like to have the tag value “CIsco Subs Interface Description” split into 4 different tag type columns

Any kind of help is more than welcome.



Telegraf can’t do this out of the box, you would need a custom processor plugin written in Go.



Thank you for your answer.

I will assume that Kapacitor does not have this functionality either, is that correct?
I’ve seen some doc about strTrim function or other functions for strings and regex but it does not seem to match with what I’m expecting to have as result.

Do you have any recomended documentation about how to create custom plugins on Telegraf?

Thanks in advance



Here is the documentation for writing a processor plugin for Telegraf: https://github.com/influxdata/telegraf/blob/master/CONTRIBUTING.md#processor-plugins. I don’t think this a plugin that we would merge into the official Telegraf repo, it seems like a very specialized use.

@michael Do you know if Kapacitor can handle this use case?


@daniel thank you so much for your help.
@michael any help with this is appreciated.



I don’t think it’ll be possible to do in kapacitor without a UDF. :confused: