Delete or export logs out from Loki in Grafana Cloud?

Hello,
I am evaluating Grafana cloud and was curious if there is a way to delete logs from Loki in grafana cloud? I am wondering if there was accidental flood of logs or PII data that made it through into Loki, would there be any way to delete it quickly?

Also, curious about if logs can be exported / forwarded from Loki for longer term retention ( >= 1 year).

Thanks

1 Like

Hey there!

Data cannot be deleted once ingested into the hosted environment. The data will remain for the duration of its retention period or until the Grafana Cloud stack has been deleted. If the end goal for deleting data is for billing purposes, billing is based on how much data has been shipped. So once the metrics/logs/traces have been received they’ve contributed towards billing costs.

Logs can be exported using the Explore feature as either a CSV or TXT file, though I would recommend sending the logs from the source to the long term retention location at the same time as Grafana Agent / Promtail is sending logs to Grafana Cloud Loki. There might also be a plugin that would allow you to query and visualize your log data from the long term retention location.