Can Grafana Loki read the logs from S3 as the storage backend

In Grafana Loki with a 7-day retention period and S3 as the storage backend, are logs older than 7 days deleted from S3 by Loki? Or is retention only applied to local storage? If retention applies only to local, can Loki still query older logs directly from S3?

Loki can be configured with local backend, or S3 backend, but not both. Retention applies regardless of backend.

Hi,
Thanks tonyswumac
As per my understanding loki keep the logs data till retention period and if storage is configured it will push the logs data to s3 which is beyond retention period. Is it right?

My query is does loki able to query which is beyond retention period which is in s3

No, Loki keeps some logs on local disk (this is called write-ahead-logs), and after some conditions are met (chunks reaching desired size or reaching maximum WAL wait time) then it gets sent to backend. the maximum time you’d have WAL logs is by default 3 hours.

All logs should be sent to the backend (again, by default no longer than 3 hours). After which retention applies.