Prompt
How do I handle hot and cold log storage for old logs?
Latest observation
Oct 27, 2026
OpenAI APIWeb search: off
A good pattern is to treat old logs as tiered storage based on how often you query them:
1) Define log “hotness”
- Hot logs: recent logs you query often for debugging/alerts.
- Warm logs: less-frequently accessed logs, still reasonably fast to query.
- Cold logs: archived logs kept for compliance/auditing, rarely read.
2) Use retention and lifecycle policies
Set automated policies such as:
- Keep logs in hot storage for 7–30 days
- Move to warm/cold storage after that
- Delete after the required retention period
Examples:
- Hot: Elasticsearch/OpenSearch, CloudWatch Logs, Splunk index
- Cold: S3 Glacier, Azure Archive, GCS Archive, cheap object storage
3) Store in an accessible archive format
For cold storage:
- Compress logs (
gzip,zstd) - Partition by time:
year=/month=/day= - Prefer queryable formats when possible:
- JSON lines for simplicity
- Parquet for analytics/cheap querying
- Keep metadata/indexes so you can find the right archive quickly
4) Separate storage from indexing
A common design:
- Keep a searchable index for recent logs
- Move raw log files to object storage
- Store pointers/metadata in the index so you know where archived logs live
5) Make retrieval deliberate
Cold logs should not be “always on”:
- Restore only when needed
- Expect higher latency and retrieval costs
- Use async restore jobs or temporary rehydration into warm storage
6) Automate with ILM/lifecycle rules
If using common platforms:
- Elasticsearch/OpenSearch: Index Lifecycle Management
- AWS S3: Lifecycle rules to transition to Glacier
- Azure Blob: Access tiers hot/cool/archive
- GCP: Storage class transitions
7) Plan for compliance and security
- Encrypt at rest
- Restrict access tightly
- Define immutable retention if required
- Ensure deletion policies meet legal/compliance rules
8) Cost-control tips
- Don’t keep verbose debug logs hot too long
- Sample or reduce noise at ingest
- Aggregate old logs when detailed per-event access isn’t needed
- Use compression and object storage for archives
A practical setup
- 0–14 days: searchable hot index
- 15–90 days: warm storage, lower-cost searchable tier
- 90+ days: compressed archives in object storage / Glacier
- After retention: automatic deletion
If you want, I can also give you:
- a cloud-specific setup (AWS/Azure/GCP), or
- a self-hosted architecture for hot/warm/cold log storage.