Add key to the value of new key

Hello,
I’m new to telegraf, and I try to find a way to rename specific tags to the same name, and add the original tag as a part of the value of the new tag, like:

input
agent_host="hostA"
agent_ip="10.10.10.1"

after regex
aggregated="agent_host:hostA"
aggregated="agent_ip:10.10.10.1"

The reason why I’d do this is I found no way to push raw output as text with outputs.cloudwatch_logs. If there is a known way, please, stop me doing this now :slight_smile:

I’d like to do something like the following below. My question: is there a way to do this tag name: value concatenation for the replacement, please?

[[processors.regex]]
  [[processors.regex.tags]]
    key ="agent_host"
	pattern = '^(?P<agent_host.+>)\=.+$'
	replacement = agent_host+':'+${agent_host}
	result_key = "aggregated"

Hi,

To be sure I understand your request, do you want to have two tags where they have the same key? For example,

CPU,aggregated=0,aggregated=1 temp=32

I don’t believe Telegraf will let you do that.