Telemetry
Security and audit SQL recipe

Review Sensitive Data Exports with SQL

Summarize export volume, denied attempts, data classifications, and review status without storing exported contents.

Intermediatedata_export_audit_eventsReviewed 2026-07-28Tested with Apache DataFusion 45.2.0

Reviewed by the Telemetry product team on . SQL compatibility, event contract, synthetic output, and operational caveats. Editorial ownership

Question answered

Which sensitive export classes or actor roles require review?

Export metadata supports governance review when it records the actor role, approved data class, row-count band, outcome, and review decision—not the exported payload.

Event contract

Fields the query expects

FieldTypeWhy it exists
timestamp_utcTimestampExport outcome time.
actor_roleUtf8Bounded actor role.
data_classUtf8Approved classification such as internal or restricted.
row_count_bandUtf8Coarse export size band.
outcomeUtf8success, denied, or failed.
review_statusUtf8not_required, pending, approved, or escalated.
DataFusion SQL

Copy the query

sql
SELECT
  data_class,
  actor_role,
  COUNT(*) AS export_attempts,
  SUM(CASE WHEN outcome = 'success' THEN 1 ELSE 0 END) AS completed_exports,
  SUM(CASE WHEN outcome <> 'success' THEN 1 ELSE 0 END) AS unsuccessful_exports,
  SUM(CASE WHEN review_status IN ('pending', 'escalated') THEN 1 ELSE 0 END)
    AS open_reviews
FROM data_export_audit_events
WHERE timestamp_utc >= now() - INTERVAL '30 days'
GROUP BY data_class, actor_role
ORDER BY open_reviews DESC, unsuccessful_exports DESC;

This read-only query is planned and executed against an empty typed table with Apache DataFusion 45.2.0. The deterministic sample output is synthetic and reviewed separately; validate field types, thresholds, and business definitions against your own data. Read the testing methodology.

Query result

Open export reviews by data class

Restricted support exports create the largest current review queue.

data_classactor_roleexport_attemptscompleted_exportsunsuccessful_exportsopen_reviews
restrictedsupport18994
internaladmin848221

Synthetic example output. Run the query against your own event schema and thresholds before using it for operational decisions.

Open export reviews by data class: static chart of synthetic open_reviews values from the Review Sensitive Data Exports with SQL example result
Indexable SVG of the deterministic example output. Download it for an article, runbook, or design review with attribution.

Reproduce the example

Download the public fixture

The JSON bundle includes the typed event contract, illustrative input rows, exact SQL, expected output, review notes, and engine version. The CSV contains the displayed result.

How the SQL works

  1. 1Data classification and role produce policy-relevant groups.
  2. 2Open reviews remain separate from failed outcomes.
  3. 3A size band supports proportional review without copying export contents into telemetry.

Edge cases to decide

  • Never log exported rows, filenames containing personal data, or signed download URLs.
  • Approved service exports may need separate policy.
  • Immutable source audit records and aggregate dashboards serve different retention needs.

Recommended dashboard

  • Bars: open_reviews by data class
  • Trend: completed_exports by role
  • Table: escalated reviews in the restricted system

Alert guidance

Alert on an unapproved restricted export, repeated denied attempts, or an overdue review.

Read alert setup

Put the recipe to work

Related instrumentation and guides

Continue the analysis

Run it on real events

Create a table, adapt the fields, and save the result

Start free, send structured events, and use the query result as a chart, shared dashboard widget, or alert input.

Get an API key