Skip to content

snapp-incubator/loki-log-export

 
 

Repository files navigation

Loki log export to s3 buckets

export AWS_REGION=eu-central-1
export AWS_BUCKET=your-log-bucket
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export LOKI_HOST=http://localhost:3100

export EXTRACTORS='[{
  "prefix": "some-service/",
  "query": "{service=\"some-service\"}",
  "transform": "json"
},
{
  "prefix": "another-service/",
  "query": "{service=\"another-service\"}",
  "transform": "json"
}]'

docker run --name loki-log-export ghcr.io/snapp-incubator/loki-log-export:v1.1.0

Will run the log export every hour at 5 past and upload gzipped log files to s3:

some-service/2020/12/01/00.log.gz
some-service/2020/12/01/01.log.gz
...
some-service/2020/12/01/23.log.gz
some-service/2020/12/02/00.log.gz

another-service/2020/12/01/00.log.gz
another-service/2020/12/01/01.log.gz
...
another-service/2020/12/01/23.log.gz
another-service/2020/12/02/00.log.gz

You can Also set S3_ENDPOINT env for using an S3-Compatible Object Storage like Minio

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • JavaScript 98.7%
  • Dockerfile 1.3%