Hi guys,
Do we have any features or solutions to save logs with different retention period? This maybe a common case that for some services we wish to save their logs for a longer period whereas other are not.
Regards
Hi guys,
Do we have any features or solutions to save logs with different retention period? This maybe a common case that for some services we wish to save their logs for a longer period whereas other are not.
Regards
You can override it like this:
limits_config:
retention_period: 744h
retention_stream:
- selector: '{namespace="dev"}'
priority: 1
period: 24h
You can also override it per tenant. See more here: Log retention | Grafana Loki documentation
Appreciate for the reply!!
However I’m using s3 bucket as storage. The doc says I can only manage retention policy from aws side (we are using table-manager to do retention for current configuration). Does loki have control of retention under such case? Or the “select stream” is a feature only supported by compactor
You can absolutely manage retention policy from Loki. You should want to use compactor instead of table manager (see Log retention | Grafana Loki documentation), and if you are not at a version where compactor is recommended you should consider upgrading as well.
If you are using S3 as storage, this would be my recommendation:
That would be great!
One last question here, the compactor will delete logs chunks inside s3 instead of only delete index files right? I’m trying to save storage cost.
Yes, compactor will remove chunk files. I still recommend also putting in S3 lifecycle policy just as a safety net.