RousselTMLEARNING

Article · Datadog: from discovery to expertise

Advanced logs: indexes, Flex and archives

1. Ingesting is not indexing #

The main cost lever.

Lifecycle #

Lifecycle of a log in Datadog
StageWhat you pay forLever
IngestionVolume ingestedFilter at the source (agent) what is never used
IndexingVolume indexed × retentionExclusion filters, short-retention indexes
Flex LogsLong-term storage at reduced costData rarely viewed but worth keeping
ArchivesObject storage on your sideKeep everything, rehydrate during an investigation

2. Indexes and exclusion #

Several indexes, several retentions.

Configuration #

  • An audit index at 30 days for security, an app index at 7 days, a debug index at 3 days.
  • Indexes are evaluated in order: a log goes into the first index whose filter matches.
  • An index's exclusion filters remove all or part (sampling) of the matching logs, for example 90% of health check status:info logs.
  • Excluded logs remain visible in Live Tail, usable by Logs to Metrics and sent to archives.
Good practice: Before excluding, create a metric from the logs (Logs to Metrics): you keep the error count for 15 months without indexing the logs themselves.

3. Sensitive data #

Compliance.

Sensitive Data Scanner #

The Sensitive Data Scanner detects patterns (credit cards, emails, API keys, IBANs, social security numbers) in logs, traces and events, and masks, hashes or replaces them at ingestion, before indexing.

Common mistake: Masking on the Datadog side happens after sending: for data that must never leave your network, mask in the agent (log_processing_rules of type mask_sequences).
logs:
  - type: file
    path: /var/log/app/app.log
    service: shop
    source: python
    log_processing_rules:
      - type: mask_sequences
        name: masquer_emails
        replace_placeholder: "[email]"
        pattern: '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}' 

📄 Advanced Datadog logs: indexes, exclusion filters, Flex Logs, archives and Sensitive Data Scanner →

My progress

  • ⏱ Estimated time : ≈ 4 min

Sign in to track your progress and take notes. Sign in

💬 Recent discussions about this course

Ask a question about this lesson →See all discussions about this course

Recommended Articles

Logs in Datadog: collection, pipelines, indexes and volume control

Collect logs with the agent, structure them with pipelines and processors (grok), use facets and ...

Advanced Datadog APM: sampling, retention, profiler and Software Catalog

Go further with Datadog APM: ingestion control and sampling, retention filters, trace metrics, Co...

Advanced logs with OpenPipeline: processing, masking, buckets and retention

Manage logs in Dynatrace with OpenPipeline: ingestion, routing, DQL processing (parsing, enrichme...

Datadog APM and OpenTelemetry: traces, services and correlation with logs

Instrument applications for Datadog APM (dd-trace, single step instrumentation, OpenTelemetry), u...

Datadog best practices: tags, costs, alerts and governance

Checklist for using Datadog effectively: unified tagging, cost control (hosts, logs, custom metri...

Advanced Datadog metrics: types, aggregations, cardinality and Metrics without Limits

Master Datadog metrics: types (count, rate, gauge, histogram, distribution), time and space aggre...

Advanced infrastructure with Datadog: network, cloud, containers and databases

Monitor infrastructure beyond hosts: Network Performance Monitoring, AWS, Azure and GCP integrati...

Datadog costs and governance: usage, attribution, RBAC and tag policies

Control the bill and govern Datadog: tracking usage and estimates, cost attribution per team, usa...

Dynatrace security and governance: advanced IAM, policies, SSO, audit and data protection

Secure and govern Dynatrace: SSO and SCIM, groups, IAM policies with conditions, security context...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!