1. Ingesting is not indexing #
The main cost lever.
Lifecycle #
| Stage | What you pay for | Lever |
|---|---|---|
| Ingestion | Volume ingested | Filter at the source (agent) what is never used |
| Indexing | Volume indexed × retention | Exclusion filters, short-retention indexes |
| Flex Logs | Long-term storage at reduced cost | Data rarely viewed but worth keeping |
| Archives | Object storage on your side | Keep everything, rehydrate during an investigation |
2. Indexes and exclusion #
Several indexes, several retentions.
Configuration #
- An
auditindex at 30 days for security, anappindex at 7 days, adebugindex 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:infologs. - 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_rulesof typemask_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,}' My progress
Sign in to track your progress and take notes. Sign in
💬 Recent discussions about this course
- Datadog : relier traces, logs et métriques du même service✓ solved · 1 reply(ies)
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...