Restore grafana past logs

We are currently implementing a solution to export our Google Cloud logs to a GCS bucket using the Cloud Logging export sink.

As we finalize this setup, I have a few technical questions regarding storage behavior and log restoration:
1. GCS Storage Mechanism: How does the Cloud Logging export sink structure the logs within the GCS bucket? Does it dump all logs into a single, continuous object, or does it automatically partition them by creating new, incremental objects/folders daily?

2. Grafana Log Restoration: Once the logs are in the GCS bucket, we will eventually need to view older data in Grafana. For example, if our development team needs to review logs that are several months old(may 5 6 months old data), what is the best practice or recommended mechanism to restore and query these archived logs within Grafana?

Hello @skhamitkar
no idea about cloud logging export sink but you can try this download the archived log files from Google Cloud Storage (GCS) and push them to Grafana Loki using Promtail (or Grafana Alloy). Once the logs are ingested into Loki, they can be searched and visualized in Grafana just like current logs.

But as far as I know Grafana doesn’t recognize older data. Since, it has retention period of 30 days by default. Assume If I were to export Nov 2025 logs then does it accept and shows the correct time stamp?

The retention period only determines how long the data is stored, not whether older timestamps are accepted.
keep it false see nov 2025 log.
limits_config:
reject_old_samples: false

May I ask for the detailed steps to do so?

please follow the document.

https://ghazanfaralidevops.medium.com/grafana-loki-promtail-complete-end-to-end-project-d698aaa636d6

Hi @skhamitkar

There is a limit on how old data you can push to an active stream in Loki. I don’t remember the default out of my head but but if you do so, you will see Entry too far behind. errors in the logs.

Solution depends on what you want to do. From your message, I see you have some logs in Google and you want to send them to a GCS bucket and also want to be able to search on them later (as in 5-6 montsh later)

First of all: Do you iuse Grafana Cloud or Grafana OpenSource?

For Grafana Cloud case, you need to contact with your account manager to check and if needed increase your retention period. If you want to search 5-6 months old data, you need to have your retention period at least 6 months.

For Grafana OpenSource this retention period can be adjusted in Loki backend configuration by yourself (same idea as Grafana cloud but you are your account manager :smiley: )

On the other hand, if you can verify how old Google Cloud can retain your logs (if it is enough to cover 6 months), you can also use Google Cloud Logging plugin for Grafana to access to Google logs from Grafana UI (for example from a dashboard panel or directly from Explore view). This works for both Grafana Cloud and Grafana OpenSource. THis method does not ship log records to Grafana Loki but directly reads them from Google.

If you have any more questions to clarify please let us know.

-Suleyman Kutlu (a.k.a. SNK)