Read Json Log and Push reformated Json to Loki

Hi,
I’m reading logs like:

{"timestamp":"2024-06-06T01:00:30.840+02:00","version":1.68,"country": "en"}

and like to transform it e.g. to:

{"timestamp":"2024-06-06T01:00:30.840+02:00","ver":1.68,"country": "en"}

How can I use loki.process stage to reformat the labels?

That’s the stage what I use:

loki.process "version_log" {
	forward_to = [loki.write.version_log.receiver]

	stage.json {
		expressions = {
			version		= "version",
		}
	}

	stage.labels {
		values = {
			"ver" = "version",
		}
	}
}

Thanks for your help

I would recommend you not to.

Thank you for your help. Then I will not do it.