Prompt

How do I keep application logs for 90 days and still search them fast?

Technology / Observability1 observationLast seen Oct 28, 2026

Latest observation

Oct 28, 2026OpenAI APIWeb search: off

To keep application logs for 90 days and still search them quickly, use a setup that separates hot search storage from long retention storage, and make the logs easy to query.

Recommended approach

1. Use a log platform built for indexed search

Store logs in a system like:

  • Elasticsearch / OpenSearch
  • Splunk
  • Datadog Logs
  • Loki with a good query strategy
  • ClickHouse for very high volume, SQL-style analytics

These systems let you search by fields like:

  • timestamp
  • service name
  • host/pod
  • log level
  • request ID / trace ID
  • user ID
  • error code

Fast search depends much more on structured fields than on plain text.


2. Write logs as structured JSON

Example:

{
  "timestamp": "2026-10-28T10:15:30Z",
  "level": "error",
  "service": "payment-api",
  "env": "prod",
  "request_id": "abc123",
  "user_id": "u789",
  "message": "Card authorization failed",
  "error_code": "PAY_402"
}

This makes it much faster to filter by fields instead of scanning raw text.


3. Partition by time

Store logs in daily or hourly indices/partitions.

Example:

  • logs-2026-10-01
  • logs-2026-10-02

This helps the system skip most data when you search a date range.

Best practice:

  • Hot tier: recent logs on fast SSDs for quick searches
  • Warm tier: older logs on cheaper storage
  • Cold/archive tier: rarely used logs, compressed and slower

4. Use retention and lifecycle policies

Set up automatic aging:

  • keep logs fully searchable for 90 days
  • move older logs to cheaper storage if needed
  • delete automatically after 90 days

This is often called:

  • ILM in Elasticsearch/OpenSearch
  • retention policies in Splunk/Datadog/Loki

A common pattern:

  • Days 0–14: hot
  • Days 15–60: warm
  • Days 61–90: cold
  • Delete after 90 days

5. Index only the fields you need

Too many indexed fields can slow ingestion and increase cost.

Index:

  • timestamp
  • service
  • severity
  • request_id
  • trace_id
  • environment
  • error code

Avoid indexing large free-text blobs unless necessary.


6. Keep logs compressed but searchable

Use compression to reduce storage cost, but make sure your tool can still query efficiently.

Good options:

  • compressed indices
  • columnar storage
  • object storage + query layer
  • tiered storage

7. Add correlation IDs

For fast debugging, include:

  • request_id
  • trace_id
  • session_id

Then you can search a single request across multiple services instantly.


A practical architecture

If you’re building this yourself:

  1. Apps write JSON logs
  2. Logs ship via Fluent Bit / Vector / Filebeat
  3. Store in:
    • OpenSearch/Elasticsearch for recent searchable logs
    • S3/GCS/Azure Blob for long-term archive
  4. Use ILM to move logs between tiers and delete at 90 days

This gives:

  • fast search for recent logs
  • lower cost for older logs
  • automatic cleanup

If you want the simplest answer

For most teams, the best balance is:

  • Structured JSON logs
  • Daily index rotation
  • Hot/warm/cold tiers
  • Retention policy for 90 days
  • Search by indexed fields and correlation IDs

If you want, I can also suggest:

  1. a low-cost architecture for 90-day retention, or
  2. a specific setup for Elasticsearch/OpenSearch, Loki, or Splunk.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.