New to Kestra?
Use blueprints to kickstart your first workflows.
Pipe Kestra audit logs from a Kafka topic into Google BigQuery. Flatten audit detail fields, load them via Avro, and query workflow activity at scale.
Move Kestra audit logs from the kestra_auditlogs Kafka topic into a Google BigQuery table so security, platform, and analytics teams can query workflow activity in one place. Raw audit events carry nested detail objects that are awkward to analyze, so this pipeline flattens them into typed columns and loads the result into BigQuery, turning a stream of operational events into a queryable warehouse table for dashboards, audits, and troubleshooting.
schedule trigger (io.kestra.plugin.core.trigger.Schedule) runs the flow on a daily cron (0 10 * * *, 10 AM UTC).consume task (io.kestra.plugin.kafka.Consume) reads up to 500 records from the kestra_auditlogs topic, using auto.offset.reset: earliest and deserializing each value as JSON.transform task (io.kestra.plugin.graalvm.js.FileTransform) drops the Kafka headers, keeps the original payload as a serialized value string, and flattens nested detail fields into columns like detail_type, detail_cls, detail_permission, detail_namespace, detail_flowId, and detail_executionId.avro task (io.kestra.plugin.serdes.avro.IonToAvro) converts the transformed Ion file into Avro using an explicit nullable schema.load task (io.kestra.plugin.gcp.bigquery.Load) writes the Avro file into BigQuery with format: AVRO, useAvroLogicalTypes: true, and writeDisposition: WRITE_TRUNCATE.detail fields promoted to first-class columns plus the full original payload preserved as a JSON string.Kafka and BigQuery each ship their own tooling, but neither stitches the end-to-end path together. Kestra connects the consume, transform, serialize, and load steps as one declarative YAML flow with built-in retries, full execution lineage, and event or schedule triggers. BigQuery's scheduled queries can only operate on data already inside BigQuery, they cannot pull from Kafka, reshape nested JSON, or convert to Avro first. Kestra fills exactly that ingestion and transformation gap.
kestra_auditlogs topic populated.GCP_CREDS: the GCP service account JSON used by the load task to authenticate with BigQuery.GCP_CREDS secret with your service account JSON.bootstrap.servers and topic at your Kafka cluster and audit log topic.projectId and destinationTable to your real BigQuery project, dataset, and table.Schedule trigger for a streaming or more frequent ingestion cadence.writeDisposition to WRITE_APPEND to accumulate history instead of truncating.transform script to capture more audit detail.