Telegraf drop certain tag values with processor plugin

Hi,

Is there a way to drop certain tag values before they get sent over to the DB?

Example:
I currently have the following tag values in my InfluxDB:

show tag values from CPU with key="/components/component/properties/property/@name"
name: CPU
key value


/components/component/properties/property/@name mem-util-dma-bytes-allocated
/components/component/properties/property/@name mem-util-dma-size
/components/component/properties/property/@name mem-util-dma-utilization
/components/component/properties/property/@name mem-util-kernel-802-1br-allocations
/components/component/properties/property/@name mem-util-kernel-802-1br-allocations-failed
/components/component/properties/property/@name mem-util-kernel-802-1br-bytes-allocated
/components/component/properties/property/@name mem-util-kernel-802-1br-frees

Is there a way to filter out all tag values that match the word “kernel”. I want the output to look like this:

show tag values from CPU with key="/components/component/properties/property/@name"
name: CPU
key value


/components/component/properties/property/@name mem-util-dma-bytes-allocated
/components/component/properties/property/@name mem-util-dma-size
/components/component/properties/property/@name mem-util-dma-utilization

Thanks,
Mo

Hi @mohsin106,

You can use taginclude or tagexclude ,

 [[inputs.cpu]]
  percpu = true
  totalcpu = true
  taginclude = ["cpu"]

# Exclude the "fstype" tag from the measurements for the disk plugin.
[[inputs.disk]]
  tagexclude = ["fstype"]

I think you can use [“ *kernel *”] without the blanks …

The reference please Search for Metric Filtering …Modifiers …

Best regards

1 Like

@MarcV Thank you for the reference it helped a ton. In my case I had to use the “tagdrop” setting to target tag values that I did not want showing up in my InfluxDB.

@mohsin106 , thanks for the feedback
I am glad I could help ,

have fun