Hi there, I am sending logs to loki using vector.dev as the log shipper.
I am having a hard time getting loki to accept/parse the time field sent.
I parse my applications logs own timestamp in vector before shipping them to loki.
I am formatting my timetamps to rfc3339 before sending them off to loki, but loki seems to just set the timestamp to time received of the logs, not the parsed timestamp from my logs.
I have set the loki sink in vector to allow unordered-writes, and I’ve set the chnk age in loki to 72 hours.
Loki version: 2.6.1
If I run a query using logcli agains my single loki instance, I can see the timestamps do not match what I sent to loki (expanded json for readability)
LogCli output below:
2022-10-20T22:59:13+00:00 {}
{
"environment": "dev",
"file": "/var/log/haproxy.log",
"message": " <fake-ip-goes-here>:1741 [20/Oct/2022:22:59:12.808] Fake message goes here",
"owner": "company",
"platform": "web",
"source_type": "file",
"time": "2022-10-20T22:59:12+00:00"
}
In the above, we can see that there is a 1 second difference, which leads me to think Loki was unable to parse the timestamp in the time field, and just reverted to setting the timestamp as time received
I am unable to find any documentation that states what timestamp format Loki expects in the time field. The documentation I find only relates to date parsing stages in promtail (timestamp | Grafana Loki documentation)
In the Loki configuratoin file, I have enabled unorderd_writes in order to allow historical dates.
limits_config:
unordered_writes: true