Add key to the value of new key

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:


after regex

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?

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


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.