Prompt

How do I normalize logs from different apps into one schema?

Technology / Observability1 observationLast seen Oct 28, 2026

Latest observation

Oct 28, 2026OpenAI APIWeb search: off

A good way to normalize logs from different apps into one schema is to define a common event model and then build per-app mappings into it.

1) Pick a canonical schema

Use a standard if possible instead of inventing one. Good options:

  • OpenTelemetry Logs
  • Elastic Common Schema (ECS)
  • CloudEvents for event-style logs

A common normalized log record usually includes:

  • timestamp
  • severity / level
  • message
  • service.name
  • service.version
  • environment
  • host / container / pod
  • trace_id
  • span_id
  • request_id
  • user.id
  • source.file
  • source.line
  • event.category
  • event.action
  • error.type
  • error.message
  • labels / attributes for extra fields

2) Identify shared concepts across apps

Different apps may call the same thing by different names:

  • ts, time, timestamp → @timestamp
  • lvl, severity, logLevel → log.level
  • msg, message, log_message → message
  • app, service, component → service.name

Create a mapping table for each app.

3) Parse logs into structured fields first

If some apps emit plain text, parse them before normalization.

Examples:

  • JSON logs: parse directly
  • Regex/grok for text logs
  • Multiline handling for stack traces
  • Extract key-value pairs where possible

4) Use a transformation layer

Normalize in a central place such as:

  • Log shipper: Fluent Bit, Logstash, Vector, Filebeat
  • Stream processor: Kafka Streams, Flink
  • Ingestion pipeline: custom ETL

This layer should:

  1. Parse raw log
  2. Map fields to canonical schema
  3. Enrich with metadata
  4. Drop or preserve unknown fields in labels

5) Keep raw data too

Don’t lose the original log. Store:

  • raw_message
  • raw_fields
  • source_app

This helps debugging mappings and future schema changes.

6) Version your schema

Treat the schema like an API:

  • schema_version
  • backward-compatible changes only when possible
  • document field definitions and data types

7) Handle app-specific extras

For fields that don’t fit the common schema:

  • keep them under labels.*, attributes.*, or custom.*
  • avoid inventing new top-level fields unless reused broadly

Example normalized record

{
  "@timestamp": "2026-10-28T12:34:56.789Z",
  "log.level": "error",
  "message": "Payment failed",
  "service.name": "checkout-api",
  "service.version": "1.8.2",
  "environment": "prod",
  "trace.id": "abc123",
  "span.id": "def456",
  "error.type": "TimeoutError",
  "error.message": "Upstream payment service timed out",
  "labels": {
    "customer_tier": "gold",
    "region": "us-east-1"
  },
  "raw_message": "{\"ts\":\"...\",\"lvl\":\"ERR\",...}"
}

Recommended practical approach

If you want a simple path:

  1. Choose ECS or OpenTelemetry Logs
  2. Require new apps to emit structured JSON
  3. Add a transformer for legacy apps
  4. Store raw logs plus normalized fields
  5. Validate schema with tests

If you want, I can also provide:

  • a sample mapping table
  • an example Fluent Bit / Logstash / Vector pipeline
  • a canonical log schema you can adopt directly

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.