Can I define an interval for pushing logs to object storage

This is my configuration, I was wondering if I can define an interval for pushing the logs to the object storage. If I can’t, what is the default time I have to wait in order to see the logs there?

apiVersion: v1
kind: ConfigMap
metadata:
name: loki-config-2
data:
loki-config.yaml: |
auth_enabled: false

server:
  http_listen_port: 3100

common:
  ring:
    instance_addr: 127.0.0.1
    kvstore:
      store: inmemory
  replication_factor: 1
  path_prefix: /loki

schema_config:
  configs:
    - from: 2025-03-03
      store: tsdb
      object_store: s3
      schema: v13
      index:
        prefix: index_
        period: 24h

storage_config:
  tsdb_shipper:
    active_index_directory: /loki/index
    cache_location: /loki/index_cache
    resync_interval: 5s
  aws:
    s3: http://minio:minio@127.0.0.1:9000/logs
    s3forcepathstyle: true

Frequency of Loki writing to backend storage are controlled by three configurations, max_chunk_age, chunk_target_size, and chunk_idle_period. Unless you have a good reason to change them, default should work just fine.

You also shouldn’t care about when you’d see files in S3. It does not matter, you should be see logs from Loki right way once it’s ingested regardless if it’s written to S3 or not.

1 Like