Hey! I’ve been trying to parse my logs and assign the log timestamp to the Grafana timestamp. Right now, the timestamp reflects when the log is ingested into Loki, but I want to use the actual timestamp from the log itself. I’ve been working with the following Loki process and log structure, and the message extraction is working fine, but I can’t seem to get the timestamp sync to work.
Tested the config, I think the problem is with the @ symbol. I would recommend you to see if you can remove that from your source log. If not, use a replace block to get rid of it.
This is the config I used to test your log:
Sample log (/tmp/test.log):
{"body": {"@timestamp": "2025-01-20T19:25:48.893Z","message": "{\"this is test log\"}","message_size": 1089,"stream": "stdout","tags": [""]}}
level=info component_path=/ component_id=loki.echo.test receiver=loki.echo.test entry="{\"this is test log\"}" labels="{extracted_timestamp=\"2025-01-20T19:25:48.893Z\", job=\"consumer_prod__paas_prdpg_apps\"}"