title: Loki config with s3
body: <p>I can't get Loki to connect to AWS S3 using <code>docker-compose</code>. Logs are visible in Grafana but the S3 bucket remains empty.</p>
  <p>The s3 bucket is public and I have an IAM role attached to allow <code>s3:FullAccess</code>.</p>
  <p>I updated loki to v2.0.0 and changed the period to 24h but it made no difference. There are no errors in  the loki logs.</p>
  <p>Here are the selected lines from docker logs (loki):</p>
  <pre class="lang-sh prettyprint-override"><code>msg=&quot;Starting Loki&quot; version=&quot;(version=master-4e661cd, branch=master, revision=4e661cde)&quot;
  caller=server.go:225 http=[::]:3100 grpc=[::]:9095 msg=&quot;server listening on addresses&quot;
  caller=worker.go:65 msg=&quot;no address specified, not starting worker&quot;
  msg=&quot;cleaning up mapped rules directory&quot; path=/loki/tmprules
  msg=initialising module=memberlist-kv
  msg=initialising module=store
  msg=initialising module=server
  msg=initialising module=ring
  msg=&quot;value is nil&quot; key=collectors/ring index=1
  msg=initialising module=ingester
  msg=&quot;not loading tokens from file, tokens file path is empty&quot;
  msg=&quot;instance not found in ring, adding with no tokens&quot; ring=ingester
  msg=&quot;auto-joining cluster after timeout&quot; ring=ingester
  msg=initialising module=table-manager
  msg=initialising module=distributor
  msg=initialising module=ingester-querier
  msg=initialising module=ruler
  msg=&quot;ruler up and running&quot;
  msg=&quot;Loki started&quot;
  msg=&quot;synching tables&quot; expected_tables=132
  </code></pre>
  <p>Here is my <code>loki.config</code>:</p>
  <pre class="lang-yaml prettyprint-override"><code>auth_enabled: false
  
  server:
    http_listen_port: 3100
  
  distributor:
    ring:
      kvstore:
        store: memberlist
  
  ingester:
    lifecycler:
      ring:
        kvstore:
          store: memberlist
        replication_factor: 1
      final_sleep: 0s
    chunk_idle_period: 5m
    chunk_retain_period: 30s
  
  schema_config:
    configs:
    - from: 2020-10-27
      store: boltdb-shipper
      object_store: s3
      schema: v11
      index:
        prefix: index_
        period: 24h
    
  storage_config:
    boltdb_shipper:
      active_index_directory: /loki/index
      cache_location: /loki/index_cache
      resync_interval: 5s
      shared_store: s3
    
    aws:
       s3: s3://AKIARE3@us-east-1/mydomain.com.docker.loki.logs
       s3forcepathstyle: true 
  
  limits_config:
    enforce_metric_name: false
    reject_old_samples: true
    reject_old_samples_max_age: 168h     
  </code></pre>
  <p>Here is <code>docker-compose.yaml</code></p>
  <pre class="lang-yaml prettyprint-override"><code>version: &quot;3.8&quot;
  
  networks:
    traefik:
      external: true
  
  volumes:
    data:
     
  services:
    fluentd:
      image: grafana/fluent-plugin-loki:master
      command:
        - &quot;fluentd&quot;
        - &quot;-v&quot;
        - &quot;-p&quot;
        - &quot;/fluentd/plugins&quot;
      environment:
        LOKI_URL: http://loki:3100
        LOKI_USERNAME:
        LOKI_PASSWORD:
      container_name: &quot;fluentd&quot;
      restart: always
      ports:
        - '24224:24224'
      networks:
        - traefik
      volumes:
        - type: bind
          source: ./config/fluent.conf
          target: /fluentd/etc/fluent.conf
      logging:
        options:
          tag: docker.monitoring
    
    loki:
      image: grafana/loki:master
      container_name: &quot;loki&quot;
      restart: always
      networks:
        - traefik
      volumes:
        - type: volume
          source: data
          target: /loki
      ports:
        - 3100
      volumes:
        - type: bind
          source: ./config/s3.loki.conf
          target: /loki/etc/loki.conf
      depends_on:
        - fluentd
  </code></pre>