You can also use the name_override and namepass to filter measurements.
name_override - changes a measurement name for the inputs, useful for self-owned scripts.
namepass - filters the measurements to send to influx, defined in the outputs.
An example can be:
[[outputs.influxdb_v2]]
urls = ["http://localhost:8086"]
token = "sadojpqrq9we894e6461e4614d6a46gwajg4g=="
organization = "awesome_org"
bucket = "system_data"
namepass = ["mem", "processes"]
[[inputs.processes]]
[[inputs.mem]]
or
[[outputs.influxdb_v2]]
urls = ["http://localhost:8086"]
token = "sadojpqrq9we894e6461e4614d6a46gwajg4g=="
organization = "awesome_org"
bucket = "system_data"
namepass = ["kernel"]
[[inputs.exec]]
name_override = "kernel"
commands = [
"/etc/telegraf/kernel.bash"
]
interval = "1m"
timeout = "5s"
data_format = "logfmt"
Where /etc/telegraf/kernel.bash is a script that outputs data in logfmt format.