Skip to main content
CDF delivers audit logs as a Delta Lake table to the cloud storage you configured in Setting up audit log streaming. This reference covers the delivery model, query examples for common Delta Lake-compatible tools, Delta maintenance, and how to keep the table intact. For delivery timing and the log schema, see About CDF audit logs.

Delivery model

Audit logs are written as a Delta Lake table in storage you own. Your stream is scoped to your organization or to specific projects within it. Cognite creates the table when the stream is first set up and appends new events in batches. Cognite does not modify existing events.
  • Partitioning — The table is partitioned by orgName, year, and month. Most streams contain a single CDF organization. If your stream covers multiple organizations, filter with orgName = 'your-org' in WHERE clauses so the query engine applies partition pruning and scans less data.
  • Write cadence — Batches flush when a buffer reaches its size threshold or when a maximum time since the last successful write is reached, whichever comes first. The maximum interval is 60 minutes.
  • Durability — Each flush is a Delta commit. Failed or incomplete writes do not appear in your bucket.
  • Table properties — Cognite sets properties such as target file size and deleted file retention when the table is created. Verify the table configuration before running maintenance.
You control ongoing Delta operations such as OPTIMIZE and VACUUM. See Delta maintenance for recommended commands and schedule.

Query examples

The Delta Lake table can be queried with any compatible tool. Common options include:
  • Amazon Athena — for AWS-hosted storage
  • Azure Synapse Analytics — for Azure-hosted storage
  • Google BigQuery — for GCP-hosted storage
  • Apache Spark — for any storage, shown in the examples below
Register the Delta table from your storage location before running any query. The following examples use Apache Spark.

Find all actions by a specific principal

Find all events in a time window

Filter using the year and month partition columns to apply partition pruning.

Find failed requests

Count failures per principal

Find authentication events

Find group changes

Monitor IAM events that create or delete groups.

Summarize activity by service

Delta maintenance

Delta Lake maintenance requires two operations: storage optimization and data retention. Tune the schedule to your data volume and internal policies. A low-traffic organization may be fine with bi-weekly maintenance; a high-volume organization may need daily OPTIMIZE on recent partitions only.

Order of operations

Always run maintenance in this order:
  1. OPTIMIZE — merge small Parquet files created by frequent appends.
  2. VACUUM — remove files that are no longer referenced by the Delta log.
Delta Lake supports automated optimization through optimized write and auto-compaction. Cognite recommends scheduled offline optimization instead, tuned to your data volume and needs.

Data retention

Delta differentiates between logical and physical retention. Data must be deleted logically before Delta removes the underlying files. This lets you recover data before files are permanently erased. See the Delta Lake data retention documentation for details. Logical deletion uses a DELETE query:
Physical deletion uses VACUUM:
The RETAIN period must be greater than or equal to the table’s delta.deletedFileRetentionDuration setting. Setting RETAIN below your required policy may permanently delete files needed for time travel or forensic investigation. Always specify the retention duration explicitly when using VACUUM.

Default table configuration

Cognite sets the following Delta properties when creating the table. Verify or reapply them before running OPTIMIZE or VACUUM if your maintenance depends on custom values. To adjust a property:

Data integrity

Cognite’s compatibility guarantees apply at the Delta Lake table level. Use a Delta-compatible reader (such as DuckDB, Apache Spark, or Microsoft Fabric) and do not depend on the structure, naming, or location of individual .parquet files.

Do not modify the Delta log

The Delta log in the _delta_log directory contains the metadata required to read the table.
  • Partial deletion — Removing individual log files makes the table state inconsistent. Queries may fail or return incorrect results.
  • Total deletion — If the entire directory is deleted, the storage path is no longer recognized as a Delta table. Cognite generates a new log as it continues to append data, starting at version 0. Data written before the deletion remains on disk but is invisible to the new table.
  • Manual edits — Modifying the log corrupts table history and makes VACUUM unsafe because the system can no longer determine which files are active.

Do not modify Parquet files manually

Parquet files in the table directory are managed by the Delta transaction log.
  • Manual deletion — The log still references deleted files, causing queries to fail with FileNotFoundException.
  • Manual addition — Files added outside the transaction log are invisible to Delta Lake.
  • Manual moves or renames — Disrupt the mapping between the log and physical files and can cause OPTIMIZE or VACUUM to fail.
To remove data safely, use DELETE followed by VACUUM.

Storage tiering

Delta Lake requires frequent access to both the transaction log and data files. Manage storage tiers as follows: Delta log — hot storage only The _delta_log directory is read every time the table is opened or queried. Keep it on your provider’s most performant storage tier. Data files — cold storage optional Parquet data files can use lower-cost, infrequent-access tiers if you query older data less often. Archive tiers — not supported Archive-class tiers (for example, Azure Archive or AWS S3 Glacier) take data offline and require rehydration before reads. Delta Lake expects all referenced files to be immediately available. Moving any part of an active Delta table to an archive tier causes query failures.

Further reading

Last modified on July 29, 2026