Loki backfilling with historical data

I really like LogQL and using it to query logs. The syntax is very intuitive. I wonder if it would be possible to enable backfilling data into Loki so that this capability can be used on historical data.

It looks like out of order data is supported: Ordering Constraint Removal | Grafana Labs, but it sounds like arbitrarily loading old data might be problematic. Any thoughts on whether it would be possible to enable (and have guides) on how to load historical data offline into Loki?

Hi @jlin , I’m working on the same problem, how to get historical data into Loki.
It is definitely possible, but I’m encountering some quirks that I need to understand first . See my issue that I posted here

What do you mean by arbitrarily loading data?

From what I understand right now, loading historical data has always been possible. You only needed to enter the loglines in the right order. This ‘right order’ needs to be maintained within one stream (whereby each stream is defined by a set of labels).

Now, with the out-of-order feature, default settings allow you to enter log lines into a stream that are 1/2 hour older than the youngest entered log line within that same stream.

But again, this out of order treatment has almost nothing to do with historical data. I could imagine that you just create a stream specifically for this historical data. Make sure that you sort the data beforehand, and you should be fine.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.