How to configure loki, do not get data from s3 when querying, when I use s3 to store index and chunk

I use s3 to store index and chunk ,
And I found that, when I use grafana to query log , loki fetch data from s3 every time ,event the last 5 mini query.
What can I do , when I want the last 7 days query do not fetch data from s3 then just from the local filesystem ?

schema_config:
  configs:
    - from: 2021-06-01
      store: boltdb-shipper
      object_store: s3
      schema: v11
      index:
        prefix: index_
        period: 24h

storage_config:
  boltdb_shipper:
    active_index_directory: /loki/boltdb-shipper-active
    cache_location: /loki/boltdb-shipper-cache
    shared_store: s3
    query_ready_num_days: 7
    cache_ttl: 168h
    
  aws:
    s3forcepathstyle: false
    bucketnames: loki-xxx
    endpoint: oss-cn-beijing.aliyuncs.com
    region: oss-cn-beijing
    access_key_id: xxx
    secret_access_key: xxx
    insecure: true
1 Like

hi @airclear.

When you use s3 to store chunks, the query always fetches it from s3 (except if the log chunks are still in ingester memory still).

I think there is confusion with your boltdb_shipper config. Just to clarify Its only for index store and not for your log chunks.

Does this help?