# Cloud - Full Markdown Export > This file contains all Cloud documentation pages in markdown format for AI agent consumption. > Generated from 971 pages on 2026-11-14T07:01:07.535Z > Component: cloud-data-platform | Version: > Site: https://docs.redpanda.com ## About This Export This export includes the **latest version** () of the Cloud documentation. ### AI-Friendly Documentation Formats We provide multiple formats optimized for AI consumption: - **https://docs.redpanda.com/llms.txt**: Curated overview of all Redpanda documentation - **https://docs.redpanda.com/llms-full.txt**: Complete documentation export with all components - **https://docs.redpanda.com/cloud-data-platform-full.txt**: This file - Cloud documentation only - **Individual markdown pages**: Each HTML page has a corresponding .md file --- # Page 1: Manage Billing **URL**: https://docs.redpanda.com/cloud-data-platform/billing.md --- # Manage Billing - [Billing and Support](https://docs.redpanda.com/cloud-data-platform/billing/billing/) Learn about the metrics Redpanda uses to measure consumption in Redpanda Cloud. - [Manage Payment Methods](https://docs.redpanda.com/cloud-data-platform/billing/manage-payment-methods/) Add a credit card, set a default payment method, and update billing contact information in Redpanda Cloud. - [View Billing Activity](https://docs.redpanda.com/cloud-data-platform/billing/view-billing-activity/) View charges, filter the resources breakdown, and export billing activity to CSV in Redpanda Cloud. - [Manage Billing Notifications](https://docs.redpanda.com/cloud-data-platform/billing/billing-notifications/) Manage billing notifications in Redpanda Cloud: what alerts you receive, who receives them, and how to configure your notification preferences. - AWS - [Use AWS Commitments](https://docs.redpanda.com/cloud-data-platform/billing/aws-commit/) Subscribe to Redpanda in AWS Marketplace with committed use. - [Use AWS Pay As You Go](https://docs.redpanda.com/cloud-data-platform/billing/aws-pay-as-you-go/) Subscribe to Redpanda in AWS Marketplace with pay-as-you-go billing, and cancel anytime. - Azure - [Use Azure Commitments](https://docs.redpanda.com/cloud-data-platform/billing/azure-commit/) Subscribe to Redpanda in Azure Marketplace with committed use. - GCP - [Use GCP Commitments](https://docs.redpanda.com/cloud-data-platform/billing/gcp-commit/) Subscribe to Redpanda in Google Cloud Marketplace with committed use. - [Use GCP Pay As You Go](https://docs.redpanda.com/cloud-data-platform/billing/gcp-pay-as-you-go/) Subscribe to Redpanda in Google Cloud Marketplace with pay-as-you-go billing, and cancel anytime. --- # Page 2: Use AWS Commitments **URL**: https://docs.redpanda.com/cloud-data-platform/billing/aws-commit.md --- # Use AWS Commitments You can subscribe to Redpanda Cloud through AWS Marketplace and use your existing marketplace billing and credits to quickly provision clusters. View your bills and manage your subscription directly in the marketplace. With a usage-based billing commitment, you sign up for a minimum spend amount. Commitments are minimums: - If you use less than your committed amount, you still pay the minimum. Any unused amount on a monthly commitment rolls over to the next month until the end of your term. - If you use more than your committed amount, you can continue using Redpanda Cloud without interruption. You’re charged for any additional usage until the end of your term. > ❗ **IMPORTANT** > > When you subscribe to Redpanda Cloud through AWS Marketplace, you can only create clusters on AWS. ## Sign up in AWS Marketplace 1. Contact [Redpanda Sales](https://redpanda.com/contact) to request a private offer with possible discounts. 2. You will receive a private offer on AWS Marketplace. Review the policy and required terms, and click **Accept**. > 📝 **NOTE** > > If you don’t have a billing account associated with your project, you’re prompted to enable billing to link the subscription with a billing account. You are taken to the Redpanda sign-up page. 3. On the Redpanda sign-up page: - For **Email**, enter your email address to register with Redpanda. - For **Organization name**, enter a name for your new organization connected through AWS Marketplace. Redpanda organizations contain all resources, including clusters and networks. - Click **Sign up and create organization**. You will receive an email sent to the address you entered. 4. In the email, click **Verify email address**. This completes the registration and associates the email with a Redpanda account. 5. On the **Accept your invitation to sign up** page, click **Sign up** or **Log in**. You can now create resource groups, clusters, and networks in your organization. ## Next steps - [Create a Serverless cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/#create-a-serverless-cluster) - [Create a BYOC cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/) - [Create a Dedicated cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/create-dedicated-cloud-cluster/#create-a-dedicated-cluster) --- # Page 3: Use AWS Pay As You Go **URL**: https://docs.redpanda.com/cloud-data-platform/billing/aws-pay-as-you-go.md --- # Use AWS Pay As You Go Subscribe to Redpanda Cloud through AWS Marketplace to quickly provision Serverless and Dedicated clusters. With a usage-based pay-as-you-go subscription, you only pay for what you use and can cancel anytime. > ❗ **IMPORTANT** > > When you sign up for Redpanda Cloud through AWS Marketplace, you can only create clusters on AWS. ## Sign up in AWS Marketplace 1. In the AWS Marketplace, select [**Redpanda Cloud - The proven Apache Kafka alternative (Pay as You Go)**](https://aws.amazon.com/marketplace/pp/prodview-ecbu7wwsfh644?applicationId=AWSMPContessa&ref_=beagle&sr=0-3). 2. On the **Redpanda Cloud - Pay as You Go** overview page, click **View purchase options**, then click **Subscribe**. > 📝 **NOTE** > > If you don’t have a billing account associated with your project, you’re prompted to link the subscription with a billing account. 3. On the **Subscribe to Redpanda Cloud** page, click **Set up your account**. You’re taken to the Redpanda sign-up page. 4. On the Redpanda sign-up page: - For **Email**, enter your email address to register with Redpanda. - For **Organization name**, enter a name for your new organization connected through AWS Marketplace. > 💡 **TIP** > > This process creates a new organization, even for existing Redpanda customers. Organizations contain all resources, including clusters and networks. - Click **Sign up and create organization**. You will receive an email sent to the address you entered. 5. In the email, click **Verify email address**. This associates the email with a Redpanda account. 6. On the **Accept your invitation to sign up** page, enter the credentials you want to use for Redpanda Cloud. You can now create resource groups, networks, and clusters in your organization. ## Next steps - [Create a Serverless cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/#create-a-serverless-cluster) - [Create a Dedicated cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/create-dedicated-cloud-cluster/#create-a-dedicated-cluster) --- # Page 4: Use Azure Commitments **URL**: https://docs.redpanda.com/cloud-data-platform/billing/azure-commit.md --- # Use Azure Commitments You can subscribe to Redpanda Cloud through Azure Marketplace and use your existing marketplace billing and credits to quickly provision clusters. View your bills and manage your subscription directly in the marketplace. With a usage-based billing commitment, you sign up for a monthly or an annual minimum spend amount. Commitments are minimums: - If you use less than your committed amount, you still pay the minimum. Any unused amount on a monthly commitment rolls over to the next month until the end of your term. - If you use more than your committed amount, you can continue using Redpanda Cloud without interruption. You’re charged for any additional usage until the end of your term. > ❗ **IMPORTANT** > > When you subscribe to Redpanda Cloud through Azure Marketplace, you can only create clusters on Azure. ## Sign up in Azure Marketplace 1. Contact [Redpanda sales](https://redpanda.com/contact) to request a private offer with possible discounts. You will receive a private offer on Azure Marketplace. This offer is associated with an Azure user account that has access to the Azure subscription used for billing. 2. In Azure Marketplace, review the policy and required terms, and click **Accept**. You are taken to the Redpanda sign-up page. 3. On the Redpanda sign-up page: - For **Email**, enter your email address to register with Redpanda. - For **Organization name**, enter a name for your new organization connected through Azure Marketplace. Redpanda organizations contain all resources, including clusters and networks. - Click **Sign up and create organization**. You will receive an email sent to the address you entered. 4. In the email, click **Verify email address**. This completes the registration and associates the email with a Redpanda account. 5. On the **Accept your invitation to sign up** page, click **Sign up** or **Log in**. You can now create resource groups, clusters, and networks in your organization. ## Next steps - [Create a BYOC cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/) - [Create a Dedicated cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/create-dedicated-cloud-cluster/) --- # Page 5: Manage Billing Notifications **URL**: https://docs.redpanda.com/cloud-data-platform/billing/billing-notifications.md --- # Manage Billing Notifications Redpanda Cloud sends email notifications to help you monitor your billing balance. Organization admins receive alerts when credit or commit balances reach spending thresholds. In this guide, you will: - Identify the billing notifications Redpanda Cloud sends and their thresholds - Configure which users in your organization receive billing notifications - Opt out of billing notification emails for yourself or your organization ## What notifications you receive Redpanda Cloud monitors your balance and sends a notification when it crosses each threshold. Each threshold triggers one notification. If your balance crosses the same threshold again after adding credits, you may receive another notification at that level. | Notification | Description | Thresholds | | --- | --- | --- | | Low credit balance | Sent when your pre-paid credit balance is running low. Credits are drawn down by usage, similar to a prepaid account. | 50%, 30%, 10%, 0% remaining | | Low commit balance | Sent when your contractual commit balance is running low. Commits represent a minimum spend over a contract period. | 50%, 30%, 10%, 0% remaining | Notifications are sent to email only. The subject line follows this format: `Action Required: Your Redpanda Cloud is % remaining` ## Who receives notifications All users with the **Admin** role in your organization receive billing notifications by default. To change who receives notifications, update role assignments on the **Organization IAM** page. See [Role-Based Access Control](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac/) or [Group-Based Access Control](https://docs.redpanda.com/cloud-data-platform/security/authorization/gbac/gbac/). ## Opt out of notifications ### Individual opt-out To stop receiving billing notification emails: - Open any billing notification email. - Click the **Unsubscribe** or **Manage notification preferences** link at the bottom of the email. No support ticket is needed. The change takes effect within 24-48 hours. ### Organization-wide opt-out To disable billing notifications for all admins in your organization, contact [Redpanda support](https://support.redpanda.com/hc/en-us/requests/new). > 📝 **NOTE** > > If billing notifications are enabled for the organization, individual admins who have not unsubscribed will continue to receive notifications. ## Common questions - I didn’t sign up for these emails. Why am I receiving them? Billing notifications are sent automatically to all organization admins. If you don’t want to receive them, click the **Unsubscribe** link at the bottom of the email. - I got an alert but I already added credits. Why? Notifications are triggered when your balance crosses a threshold. If you added credits after the threshold was crossed, the notification was already queued. If your balance later crosses the same threshold again (for example, after adding credits and then using them), you may receive another notification. - Who else in my organization is getting these? All users with the Admin role receive billing notifications. To see who has the Admin role, check the **Organization IAM** > **Users** page in Redpanda Cloud. - I unsubscribed but still received a notification. What happened? Unsubscribe requests take 24-48 hours to process. If you receive a notification during that window, it was sent before your request was fully applied. - What should I do when I get an alert? Review your current balance on the **Billing** page. You can add credits or contact your Redpanda account team to discuss your usage and plan options. - Do trial accounts get notifications? Only if the trial has promotional credits. Standard trial accounts without a credit balance do not receive billing notifications. --- # Page 6: Billing and Support **URL**: https://docs.redpanda.com/cloud-data-platform/billing/billing.md --- # Billing and Support Redpanda Cloud uses various [metrics](#redpanda-streaming-billing-metrics) to measure the consumption of resources. - All pricing is set in US dollars (USD). - All usage-based billing computations are conducted in Coordinated Universal Time (UTC). Billing accrues at hourly intervals. Any usage that is less than an hour is billed for the full hour. - The **Billing** page shows detailed billing activity for your organization and lets you [manage payment methods](https://docs.redpanda.com/cloud-data-platform/billing/manage-payment-methods/). Redpanda charges the credit card marked as the default. > 📝 **NOTE** > > - Redpanda Cloud can notify you when your credit or commit balance is running low. See [Manage Billing Notifications](https://docs.redpanda.com/cloud-data-platform/billing/billing-notifications/). > > - Pricing information is available on [redpanda.com](https://www.redpanda.com/price-estimator). For questions about billing, contact [billing@redpanda.com](mailto:billing@redpanda.com). ## Redpanda Streaming billing metrics ### Serverless Pricing for Serverless clusters depends on the data in, data out, data stored, partitions (virtual streams), and the time the instance is up. The cost for each Serverless metric varies based on the region you select for your cluster. | Metric | Description | | --- | --- | | Uptime | Tracks the number of hours the instance is running.
**NOTE**: Uptime is not charged if partitions = 0 and storage = 0. This condition is met when all topics are deleted. | | Ingress | Tracks the data written into Redpanda (in GB).
All Kafka protocol requests (_except_ message headers) are counted as ingress as soon as they are read by Redpanda’s proxy process. | | Egress | Tracks the data read out of Redpanda (in GB).
All Kafka protocol responses generated by the cluster (_except_ message headers) are counted as egress as soon as the cluster processes the request, even if the client drops the connection before they are delivered. | | Partitions | Tracks the number of partitions used per hour. | | Storage | Tracks the data in object storage per hour (in GB). | See also: [Serverless limits](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/#serverless-usage-limits) ### Dedicated Pricing for Dedicated clusters depends on the time the instance is up, the data in, data out, and data stored. | Metric | Description | | --- | --- | | Uptime | Tracks the number of hours the instance is running.
The cost varies based on the [region and tier](https://docs.redpanda.com/cloud-data-platform/reference/tiers/dedicated-tiers/) you select for your cluster. | | Ingress | Tracks the data written into Redpanda (in GB).
All Kafka protocol requests (_including_ message headers) are counted as ingress as soon as they are read by Redpanda’s proxy process.
The cost varies based on the region you select for your cluster. | | Egress | Tracks the data read out of Redpanda (in GB).
All Kafka protocol responses generated by the cluster (_including_ message headers) are counted as egress as soon as the cluster processes the request, even if the client drops the connection before they are delivered.
The cost varies based on the number of availability zones (AZ) you select for your cluster. | | Storage | Tracks the usage of object storage on an hourly basis during the billing period (in GB-hours).
Replication to object storage is implemented with [Tiered Storage](https://docs.redpanda.com/home/glossary/#tiered-storage). All topics have a fixed replication factor of 3, but Redpanda counts each byte only once. | ### BYOC Pricing for BYOC clusters depends on compute, data in, data out, and data stored. The rate decreases as usage increases. | Metric | Description | | --- | --- | | Compute | Tracks the server resources (vCPU and memory) a cluster uses on an hourly basis in Redpanda units (RPUs). Where:
1 RPU = 2 vCPU + 8 GB memory | | Ingress | Tracks the data written into Redpanda (in GB).
All Kafka protocol requests (_including_ message headers) are counted as ingress as soon as they are read by Redpanda’s proxy process. | | Ingress to Iceberg topics | Tracks the data written to Iceberg tables per hour (in GB).
NOTE: This metric applies only if you write to Iceberg topics. This charge is in addition to the standard ingress charge. | | Egress | Tracks the data read out of Redpanda (in GB).
All Kafka protocol responses generated by the cluster (_including_ message headers) are counted as egress as soon as the cluster processes the request, even if the client drops the connection before they are delivered.
The cost varies based on the number of availability zones (AZ) you select for your cluster. | | Storage | Tracks the usage of object storage on an hourly basis during the billing period (in GB-hours).
Replication to object storage is implemented with [Tiered Storage](https://docs.redpanda.com/home/glossary/#tiered-storage). All topics have a fixed replication factor of 3, but Redpanda counts each byte only once. | ## Redpanda SQL billing metrics Pricing for Redpanda SQL depends on the provisioned compute resources allocated to the SQL workload, measured in RPUs. The cost of an RPU can vary based on the cloud provider and region you select. | Metric | Description | | --- | --- | | Compute | Tracks the server resources (vCPU and memory) Redpanda SQL uses on an hourly basis in Redpanda units (RPUs). Where:
1 RPU = 2 vCPU + 8 GB memory | > 📝 **NOTE** > > Redpanda SQL uses the same RPU definition as Redpanda Streaming BYOC clusters, but the price per RPU differs. Contact your Redpanda account team for current pricing. ## Redpanda Connect billing metrics Pricing per pipeline depends on the compute units you allocate. The cost of a compute unit can vary based on the cloud provider and region you select for your cluster. | Metric | Description | | --- | --- | | Compute | Tracks the server resources (vCPU and memory) a pipeline uses in compute units per hour. Where:
1 compute unit = 0.1 CPU + 400 MB memory | ## Support plans All organizations in Redpanda require one of the following support plans: | Support plan | Features | | --- | --- | | Basic | - Designed for non-production environments
- Provides minimal support: priority 3 tickets within 8 business hours response time and priority 4 tickets with no target response time
- Support availability is 8:00 AM to 5:00 PM Pacific Time, Monday through Friday, excluding federal US holidays | | Enterprise | - Designed for production environments needing continuous availability
- P1/P2 tickets may be submitted
- Support availability is 24/7, including holidays | | Premium | - Designed for mission-critical workloads
- 30-minute response times for production outages
- Includes a named Customer Success Manager to support planning and coordination, and 10 hours per month of consulting from a Solutions Architect
- Required for deployments with BYOVPC/BYOVNet clusters | ## Next steps - [Use AWS Commitments](https://docs.redpanda.com/cloud-data-platform/billing/aws-commit/) - [Use Azure Commitments](https://docs.redpanda.com/cloud-data-platform/billing/azure-commit/) - [Use GCP Commitments](https://docs.redpanda.com/cloud-data-platform/billing/gcp-commit/) - [Create a Serverless cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/#create-a-serverless-cluster) - [Create a Dedicated cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/create-dedicated-cloud-cluster/#create-a-dedicated-cluster) - [Create a BYOC cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/) --- # Page 7: Use GCP Commitments **URL**: https://docs.redpanda.com/cloud-data-platform/billing/gcp-commit.md --- # Use GCP Commitments You can subscribe to Redpanda Cloud through Google Cloud Marketplace and use your existing marketplace billing and credits to quickly provision clusters. View your bills and manage your subscription directly in the marketplace. With a usage-based billing commitment, you sign up for a monthly or an annual minimum spend amount. Commitments are minimums: - If you use less than your committed amount, you still pay the minimum. Any unused amount on a monthly commitment rolls over to the next month until the end of your term. - If you use more than your committed amount, you can continue using Redpanda Cloud without interruption. You’re charged for any additional usage until the end of your term. > ❗ **IMPORTANT** > > When you subscribe to Redpanda Cloud through Google Cloud Marketplace, you can only create clusters on GCP. ## Sign up in Google Cloud Marketplace 1. Contact [Redpanda sales](https://redpanda.com/contact) to request a private offer with possible discounts. 2. You will receive a private offer on Google Cloud Marketplace. Review the policy and required terms, and click **Accept**. > 📝 **NOTE** > > If you don’t have a billing account associated with your project, you’re prompted to enable billing to link the subscription with a billing account. You are taken to the Redpanda sign-up page. 3. On the Redpanda sign-up page: - For **Email**, enter your email address to register with Redpanda. - For **Organization name**, enter a name for your new organization connected through Google Cloud Marketplace. Redpanda organizations contain all resources, including clusters and networks. - Click **Sign up and create organization**. You will receive an email sent to the address you entered. 4. In the email, click **Verify email address**. This completes the registration and associates the email with a Redpanda account. 5. On the **Accept your invitation to sign up** page, click **Sign up** or **Log in**. You can now create resource groups, clusters, and networks in your organization. On BYOC clusters in GCP, Redpanda adds a consumption-tracking label to the resources it creates. See [Google Cloud Marketplace consumption-tracking label](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/create-byoc-cluster-gcp/#marketplace-label). ## Next steps - [Create a Serverless cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/#create-a-serverless-cluster) - [Create a BYOC cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/) - [Create a Dedicated cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/create-dedicated-cloud-cluster/) --- # Page 8: Use GCP Pay As You Go **URL**: https://docs.redpanda.com/cloud-data-platform/billing/gcp-pay-as-you-go.md --- # Use GCP Pay As You Go Subscribe to Redpanda Cloud through Google Cloud Marketplace to provision Serverless and Dedicated clusters. With a usage-based pay-as-you-go subscription, you only pay for what you use and can cancel anytime. > ❗ **IMPORTANT** > > When you sign up for Redpanda Cloud through Google Cloud Marketplace, you can only create clusters on GCP. > 📝 **NOTE** > > Serverless on GCP is currently in a [beta](https://docs.redpanda.com/home/glossary/#beta) release. ## Sign up in Google Cloud Marketplace 1. In the Google Cloud Marketplace, select [**Redpanda Cloud - The proven Apache Kafka alternative (Pay as You Go)**](https://console.cloud.google.com/marketplace/product/redpanda-public/redpanda-cloud-platform?project=redpanda-public). 2. On the **Redpanda Cloud - Pay as You Go** overview page, click **Subscribe**. > 📝 **NOTE** > > If you don’t have a billing account associated with your project, you’re prompted to link the subscription with a billing account. 3. On the **Subscribe to Redpanda Cloud** page, click **Set up your account**. You’re taken to the Redpanda sign-up page. 4. On the Redpanda sign-up page: - For **Email**, enter your email address to register with Redpanda. - For **Organization name**, enter a name for your new organization connected through Google Cloud Marketplace. > 💡 **TIP** > > This process creates a new organization, even for existing Redpanda customers. Organizations contain all resources, including clusters and networks. - Click **Sign up and create organization**. Redpanda sends a verification email to the address you entered. 5. In the email, click **Verify email address**. This associates the email with a Redpanda account. 6. On the **Accept your invitation to sign up** page, enter the credentials you want to use for Redpanda Cloud. You can now create resource groups, networks, and clusters in your organization. ## Next steps - [Create a Serverless cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/#create-a-serverless-cluster) - [Create a Dedicated cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/create-dedicated-cloud-cluster/) --- # Page 9: Manage Payment Methods **URL**: https://docs.redpanda.com/cloud-data-platform/billing/manage-payment-methods.md --- # Manage Payment Methods To pay for usage in Redpanda Cloud, you must add a credit card on the **Billing** page. The card you add is the payment method for all billable resources in your organization, including Serverless, Dedicated, and BYOC clusters, Redpanda Connect pipelines, and your support plan. The most recently added card becomes the default payment method, but you can change the default at any time. After reading this page, you will be able to: - Add a credit card as a payment method in Redpanda Cloud - Set a default payment method that Redpanda charges automatically - Update the billing contact information for your organization ## Prerequisites - You have the **Admin** role in your Redpanda Cloud organization. See [Role-Based Access Control](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac/). - You have a valid credit card. ## Add a payment method 1. Sign in to [Redpanda Cloud](https://cloud.redpanda.com). 2. From the navigation menu, click **Billing**. 3. On the **Billing** page, select the **Payment methods** tab. 4. Click **Add payment method**. 5. Enter your card details and billing address, then click **Save**. The new card appears on the **Payment methods** tab. The most recently added card becomes the default payment method unless you select a different one. > 📝 **NOTE** > > - After you add a credit card, any remaining credit balance is applied first. After that, Redpanda charges the default card on the first of each month. > > - Serverless free trials do not require a credit card to start. After your trial ends, you have a 7-day grace period to add a payment method before your clusters are suspended. See [Serverless Clusters](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/). ## Set the default payment method If you have more than one card on file, you can choose which one Redpanda charges: 1. Sign in to [Redpanda Cloud](https://cloud.redpanda.com). 2. From the navigation menu, click **Billing**. 3. On the **Billing** page, select the **Payment methods** tab. 4. Find the card you want to use, and mark it as the default. The card you selected is now labeled **Default payment method** and is the one Redpanda charges for usage. ## Remove a payment method 1. Sign in to [Redpanda Cloud](https://cloud.redpanda.com). 2. From the navigation menu, click **Billing**. 3. On the **Billing** page, select the **Payment methods** tab. 4. Find the card you want to remove, and delete it. The card is removed from the **Payment methods** tab. If the card you want to remove is the default and the only card on file, add another card and set it as the default first. For help, contact [billing@redpanda.com](mailto:billing@redpanda.com). ## Update billing contact information The billing contact is the person and address Redpanda uses for invoices and billing-related communication. It is separate from the recipients of low-balance email alerts, which are all users with the **Admin** role in your organization. See [Manage Billing Notifications](https://docs.redpanda.com/cloud-data-platform/billing/billing-notifications/). To update the billing contact: 1. Sign in to [Redpanda Cloud](https://cloud.redpanda.com). 2. From the navigation menu, click **Billing**. 3. On the **Billing** page, select the **Settings** tab. 4. Next to **Billing contact information**, click **Edit**. 5. Update all required fields, then click **Save**. The updated billing contact appears on the **Settings** tab. ## Next steps - [Billing and Support](https://docs.redpanda.com/cloud-data-platform/billing/billing/) - [View Billing Activity](https://docs.redpanda.com/cloud-data-platform/billing/view-billing-activity/) - [Manage Billing Notifications](https://docs.redpanda.com/cloud-data-platform/billing/billing-notifications/) --- # Page 10: View Billing Activity **URL**: https://docs.redpanda.com/cloud-data-platform/billing/view-billing-activity.md --- # View Billing Activity The **Billing activity** tab on the **Billing** page shows a summary of charges and a per-resource breakdown for your organization. Use it to review usage for the current or a previous month, drill into per-resource costs, and export charges for record keeping or external billing systems. After reading this page, you will be able to: - View a summary of charges for your organization - Filter the per-resource breakdown of billing activity - Export billing activity to a CSV file ## Prerequisites - You have the **Admin** role in your Redpanda Cloud organization. See [Role-Based Access Control](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac/). ## View a summary of charges 1. Sign in to [Redpanda Cloud](https://cloud.redpanda.com). 2. From the navigation menu, click **Billing**. 3. On the **Billing** page, select the **Billing activity** tab. 4. From the **Time range** menu, choose the period to display, for example, the current month or a previous month. The tab has three sections: - **Usage totals**: A high-level summary that subtotals usage by resource type (Dedicated, BYOC, Serverless) and shows the total amount owed for the selected time range. Expand any row to see the metrics that contribute to that subtotal. Amounts are shown before any discounts are applied. - **Resources breakdown**: A per-resource list showing the cost of each cluster, Redpanda Connect pipeline, and your support plan. Filter the list by: - Resource type: All, Dedicated, Serverless, Redpanda Connect pipeline, or Support. - Resource group: Limit results to a specific resource group. - Resource name: Search by name. - Show deleted resources: Toggle to include resources that have been deleted in the selected time range. Expand any resource to see a table of activity (for example, Compute, Ingress, Egress, Storage, Uptime, Partitions) with quantity, unit price, and amount. - **Plan details**: A side panel showing your pricing plan (for example, Pay-as-you-go) and the payment method on file. ## Download charges as CSV To download a CSV summary of your monthly charges per resource, click the download icon next to **Resources breakdown**. You can use the exported file for record keeping or to import into your billing system. ## Next steps - [Billing and Support](https://docs.redpanda.com/cloud-data-platform/billing/billing/) - [Manage Payment Methods](https://docs.redpanda.com/cloud-data-platform/billing/manage-payment-methods/) - [Manage Billing Notifications](https://docs.redpanda.com/cloud-data-platform/billing/billing-notifications/) --- # Page 11: Develop **URL**: https://docs.redpanda.com/cloud-data-platform/develop.md --- # Develop - [Kafka Compatibility](https://docs.redpanda.com/cloud-data-platform/develop/kafka-clients/) Kafka clients, version 0.11 or later, are compatible with Redpanda. Validations and exceptions are listed. - [Topics](https://docs.redpanda.com/cloud-data-platform/develop/topics/) Overview of standard topics in Redpanda Cloud. - [Produce Data](https://docs.redpanda.com/cloud-data-platform/develop/produce-data/) Learn how to configure producers and idempotent producers. - [Consume Data](https://docs.redpanda.com/cloud-data-platform/develop/consume-data/) Learn about consumer offsets and follower fetching. - [Use Redpanda with the HTTP Proxy API](https://docs.redpanda.com/cloud-data-platform/develop/http-proxy/) HTTP Proxy exposes a REST API to list topics, produce events, and subscribe to events from topics using consumer groups. - [Redpanda Cloud Management MCP Server](https://docs.redpanda.com/cloud-data-platform/develop/cloud-mcp/) Manage your Redpanda Cloud clusters, topics, and users through AI agents using natural language commands. - [Data Transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/) Learn about WebAssembly data transforms within Redpanda Cloud. - [Transactions](https://docs.redpanda.com/cloud-data-platform/develop/transactions/) Learn how to use transactions; for example, you can fetch messages starting from the last consumed offset and transactionally process them one by one, updating the last consumed offset and producing events at the same time. - [Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/) Use Kafka Connect to stream data into and out of Redpanda. --- # Page 12: Redpanda Cloud Management MCP Server **URL**: https://docs.redpanda.com/cloud-data-platform/develop/cloud-mcp.md --- # Redpanda Cloud Management MCP Server - [Redpanda Cloud Management MCP Server](https://docs.redpanda.com/cloud-data-platform/develop/cloud-mcp/overview/) Let AI agents securely operate your Redpanda Cloud clusters, topics, and users through natural language commands. - [Redpanda Cloud Management MCP Server Quickstart](https://docs.redpanda.com/cloud-data-platform/develop/cloud-mcp/quickstart/) Connect your Claude AI agent to your Redpanda Cloud account and clusters using the Redpanda Cloud Management MCP Server. - [Configure the Redpanda Cloud Management MCP Server](https://docs.redpanda.com/cloud-data-platform/develop/cloud-mcp/configuration/) Learn how to configure the Redpanda Cloud Management MCP Server, including auto and manual client setup, enabling deletes, and security considerations. --- # Page 13: Configure the Redpanda Cloud Management MCP Server **URL**: https://docs.redpanda.com/cloud-data-platform/develop/cloud-mcp/configuration.md --- # Configure the Redpanda Cloud Management MCP Server After installing the Redpanda Cloud Management MCP Server, you can configure it for different AI clients, customize security settings, and troubleshoot common issues. After reading this page, you will be able to: - Configure MCP clients - Enable delete operations safely - Troubleshoot common configuration issues ## Prerequisites - At least version 25.2.3 of [`rpk` installed on your local machine](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/) - Access to a Redpanda Cloud account - An MCP-compatible AI client such as Claude, Claude Code, or another tool that supports MCP > 💡 **TIP** > > The MCP server exposes Redpanda Cloud API endpoints for both the [Control Plane](https://docs.redpanda.com/api/doc/cloud-controlplane/) and the [Data Plane](https://docs.redpanda.com/api/doc/cloud-dataplane/). Available endpoints depend on your `rpk` version. Keep `rpk` updated to access new Redpanda Cloud features through the MCP server. Changes to the Cloud APIs, and so to the tools the MCP server exposes, are announced in [What’s New in Redpanda Cloud](https://docs.redpanda.com/cloud-data-platform/get-started/whats-new-cloud/). ## Install the integration for Claude or Claude Code For some supported clients, you can install and configure the MCP integration using the [`rpk cloud mcp install` command](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cloud/rpk-cloud-mcp-install/). For Claude and Claude Code, run one of these commands: ```bash # Choose one rpk cloud mcp install --client claude rpk cloud mcp install --client claude-code ``` If you need to update the integration, re-run the install command for your client. ## Configure other MCP clients manually If you’re using another MCP-compatible client, manually configure it to use the Redpanda Cloud Management MCP Server. Follow these steps: Add an MCP server entry to your client’s configuration (example shown in JSON). Adjust paths for your system. ```json "mcpServers": { "redpandaCloud": { "command": "rpk", "args": [ "--config", "", (1) "cloud", "mcp", "stdio" ] } } ``` 1. Optional: The `--config` flag lets you target a specific `rpk.yaml`, which contains the configuration for connecting to your cluster. Always use the same configuration path as you used for `rpk cloud login` to ensure it has your token. Default paths vary by operating system. See the [`rpk cloud login`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cloud/rpk-cloud-login/) reference for the default paths. You can also [start the server manually in a terminal to observe logs and troubleshoot](#local). ## Enable delete operations The server disables destructive operations by default. To allow delete operations, add `--allow-delete` to the MCP server invocation. > ⚠️ **CAUTION** > > Enabling delete operations permits actions like **deleting topics or clusters**. Restrict access to your AI client and double-check prompts. ### Auto-configured clients ```bash # Choose one rpk cloud mcp install --client claude --allow-delete rpk cloud mcp install --client claude-code --allow-delete ``` ### Manual configuration example ```json "mcpServers": { "redpandaCloud": { "command": "rpk", "args": [ "cloud", "mcp", "stdio", "--allow-delete" ] } } ``` ## Specify configuration file paths All `rpk` commands accept a `--config` flag, which lets you specify the exact `rpk.yaml` configuration file to use for connecting to your Redpanda cluster. This flag overrides the default search path and ensures that the command uses the credentials and settings from the file you provide. Always use the same configuration path for both `rpk cloud login` and any MCP server setup or install commands to avoid authentication issues. By default, `rpk` searches for config files in standard locations depending on your operating system. See the [reference documentation](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cloud/rpk-cloud-login/) for details. Use an absolute path and make sure your user has read and write permissions. > ⚠️ **CAUTION** > > The `rpk` configuration file contains your Redpanda Cloud token. Keep the file secure and never share it. For example, if you want to use a custom config path, specify it for both login and the MCP install command: ```bash rpk cloud login --config /Users//my-rpk-config.yaml rpk cloud mcp install --client claude --config /Users//my-rpk-config.yaml ``` Or for Claude Code: ```bash rpk cloud login --config /Users//my-rpk-config.yaml rpk cloud mcp install --client claude-code --config /Users//my-rpk-config.yaml ``` ## Remove the MCP server To remove the MCP server, delete or disable the `mcpServers.redpandaCloud` entry in your client’s config (steps vary by client). ## Security considerations - Avoid enabling `--allow-delete` unless required. - For most local use cases, such as with Claude or Claude Code, log in with your personal Redpanda Cloud user account for better security and easier management. - If you are deploying the MCP server as part of an application or shared environment, consider using a [service account](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/#authenticate-to-the-cloud-api) with tailored roles. To log in as a service account, use: ```bash rpk cloud login --client-id --client-secret --save ``` - Regularly review and rotate your credentials. ## Troubleshooting ### Verify your installation 1. Make sure you are using at least version 25.2.3 of `rpk`. 2. If you see authentication errors, run `rpk cloud login` again. 3. Ensure you installed for the right client: ```bash rpk cloud mcp install --client claude # or rpk cloud mcp install --client claude-code ``` 4. If using another MCP client, verify your `mcpServers.redpandaCloud` entry (paths, JSON syntax, and args order). 5. Start the server manually using the [`rpk cloud mcp stdio` command](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cloud/rpk-cloud-mcp-stdio/) (one-time login required) to verify connectivity to Redpanda Cloud endpoints: ```bash rpk cloud login rpk cloud mcp stdio ``` 1. Send the following newline-delimited JSON-RPC messages (each on its own line): ```json {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{"roots":{},"sampling":{},"elicitation":{}},"clientInfo":{"name":"ManualTest","version":"0.1.0"}}} {"jsonrpc":"2.0","method":"notifications/initialized"} {"jsonrpc":"2.0","id":2,"method":"tools/list"} ``` Expected response shapes (examples): ```json {"jsonrpc":"2.0","id":1,"result":{"capabilities":{...}}} {"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"...","description":"..."}, ...]}} ``` 2. Stop the server with `Ctrl+C`. ### Client can’t find the MCP server - Re-run the install for your MCP client. - Confirm the path in `--config /path/to/rpk.yaml` exists and is readable. - Double-check your client’s configuration format and syntax. ### Unauthorized errors or token errors Your capabilities depend on your Redpanda Cloud account permissions. If an operation fails with a permissions error, contact your account admin. - Run `rpk cloud login` to refresh the token. - Ensure your account has the necessary permissions for the requested operation. ### Deletes not working - The server disables delete operations by default. Add `--allow-delete` to the server invocation (auto or manual configuration) and restart the client. - For auto-configured clients, you may need to edit the generated config or re-run the install command and adjust the entry. --- # Page 14: Redpanda Cloud Management MCP Server **URL**: https://docs.redpanda.com/cloud-data-platform/develop/cloud-mcp/overview.md --- # Redpanda Cloud Management MCP Server The Redpanda Cloud Management MCP Server lets AI agents securely access and operate your Redpanda Cloud account and clusters through natural language commands. After reading this page, you will be able to: - Explain what the Redpanda Cloud Management MCP Server does - Identify what operations are available through MCP - Identify security considerations for MCP authentication ![A terminal window showing Claude Code invoking the Redpanda Cloud Management MCP Server to list topics in a cluster.](https://docs.redpanda.com/cloud-data-platform/shared/_images/cloud-mcp.gif) ## What you can do The MCP server provides controlled access to: - [Control Plane](https://docs.redpanda.com/api/doc/cloud-controlplane/) API endpoints, for example to create a Redpanda Cloud cluster or list clusters. - [Data Plane](https://docs.redpanda.com/api/doc/cloud-dataplane/) API endpoints, for example to create topics or list topics. The MCP server runs on your computer and authenticates to Redpanda Cloud using a Redpanda Cloud token. You can do anything that’s available in the Control Plane or Data Plane APIs. Typical requests you can make to your assistant once connected include: - Create a Redpanda Cloud cluster named `dev-mcp`. - List topics in `dev-mcp`. - Create a topic `orders-raw` with 6 partitions. > 📝 **NOTE** > > The MCP server does **not** expose delete endpoints by default. You can enable delete endpoints when you create the server if you intentionally want to allow delete operations. ## Use cases - Test automation: Create short-lived clusters, create topics, and validate pipelines quickly. - Operational assistance: Inspect a cluster’s health or list topics during incidents. - Onboarding and demos: Let team members issue high-level requests without memorizing every CLI flag. ## How it works 1. Authenticate to Redpanda Cloud and receive a token using the [`rpk cloud login` command](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cloud/rpk-cloud-login/). 2. Configure your MCP client using the [`rpk cloud mcp install`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cloud/rpk-cloud-mcp-install/) command. Your client then starts the server on-demand using [`rpk cloud mcp stdio`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cloud/rpk-cloud-mcp-stdio/), authenticating with the Redpanda Cloud token from `rpk cloud login`. 3. Prompt your assistant to perform Redpanda operations. The MCP server executes them in your Redpanda Cloud account using your Redpanda Cloud token. ### Components The Redpanda Cloud Management MCP Server requires these components: - AI client (Claude, Claude Code, or any other MCP client) that connects to the MCP server. - Redpanda CLI (`rpk`) for obtaining a token and starting the MCP server. - Redpanda Cloud account that the MCP server can connect to and issue API requests. ## Security considerations MCP servers authenticate to Redpanda Cloud using your personal or service account credentials. However, there is **no auditing or access control** that distinguishes between actions performed by MCP servers versus direct API calls: - All API actions appear in Redpanda Cloud’s internal logs as coming from the authenticated user account, not the specific MCP server. - You cannot audit which MCP server performed which operations, as Redpanda Cloud logs are not accessible to users. - You cannot restrict specific MCP servers to only certain API endpoints or resources. ## Next steps - [Redpanda Cloud Management MCP Server Quickstart](https://docs.redpanda.com/cloud-data-platform/develop/cloud-mcp/quickstart/) - [Configure the Redpanda Cloud Management MCP Server](https://docs.redpanda.com/cloud-data-platform/develop/cloud-mcp/configuration/) > 💡 **TIP** > > The Redpanda documentation site has a read-only MCP server that provides access to Redpanda docs and examples. This server has no access to your Redpanda Cloud account or clusters. See [How to Use These Docs](https://docs.redpanda.com/home/how-to-use-these-docs/). --- # Page 15: Redpanda Cloud Management MCP Server Quickstart **URL**: https://docs.redpanda.com/cloud-data-platform/develop/cloud-mcp/quickstart.md --- # Redpanda Cloud Management MCP Server Quickstart In this quickstart, you’ll get your Claude AI agent talking to Redpanda Cloud using the [Redpanda Cloud Management MCP Server](https://docs.redpanda.com/cloud-data-platform/develop/cloud-mcp/overview/). After completing this quickstart, you will be able to: - Authenticate to Redpanda Cloud with rpk - Install the MCP integration for Claude - Issue natural language commands to manage clusters ## Prerequisites - At least version 25.2.3 of [`rpk` installed on your computer](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/) - Access to a Redpanda Cloud account - [Claude](https://support.anthropic.com/en/articles/10065433-installing-claude-desktop) or [Claude Code](https://docs.anthropic.com/en/docs/claude-code/setup) installed > 💡 **TIP** > > For other clients, see [Configure the Redpanda Cloud Management MCP Server](https://docs.redpanda.com/cloud-data-platform/develop/cloud-mcp/configuration/). ## Set up the MCP server 1. Verify your `rpk` version. ```bash rpk version ``` Ensure the version is at least 25.2.3. 2. Log in to Redpanda Cloud. ```bash rpk cloud login ``` A browser window opens. Sign in to grant access. After you sign in, `rpk` stores a token locally. This token is not shared with your AI agent. It is used by the MCP server to authenticate requests to your Redpanda Cloud account. 3. Install the MCP integration. Choose one client: ```bash # Claude desktop rpk cloud mcp install --client claude # Claude Code (IDE) rpk cloud mcp install --client claude-code ``` This command configures the MCP server for your client. If you need to update the integration, re-run the install command for your client. ## Start prompting Launch Claude or Claude Code and try one of these prompts: - “Create a Redpanda Cloud cluster named `dev-mcp`.” - “List topics in `dev-mcp`.” - “Create a topic `orders-raw` with 6 partitions.” > 📝 **NOTE: Delete operations are opt-in** > > The MCP server does **not** expose API endpoints that result in delete operations by default. Use `--allow-delete` only if you intentionally want to enable delete operations. See [Enable delete operations](https://docs.redpanda.com/cloud-data-platform/develop/cloud-mcp/configuration/#enable_delete_operations). ## Next steps - [Configure the Redpanda Cloud Management MCP Server](https://docs.redpanda.com/cloud-data-platform/develop/cloud-mcp/configuration/) --- # Page 16: Redpanda Connect in Redpanda Cloud **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/about.md --- # Redpanda Connect in Redpanda Cloud Redpanda Connect in Redpanda Cloud lets you quickly build and deploy streaming data pipelines on your clusters from a fully-integrated UI or using the [Data Plane API](https://docs.redpanda.com/api/doc/cloud-dataplane/group/endpoint-redpanda-connect-pipeline). Choose from a [wide range of connectors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/about/) to suit your use case, including connectors to: - Integrate data sources ([inputs](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/about/)) - Write to data sinks ([outputs](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/about/)) - Transform data ([processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/)) Comprehensive data pipeline metrics are also available to help you to [monitor your data pipelines](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/monitor-connect/) and [per pipeline scaling](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/resource-management/). Try this [quickstart](https://docs.redpanda.com/cloud-data-platform/develop/connect/connect-quickstart/). > 💡 **TIP** > > If you’re new to Redpanda Connect, try [building and testing data pipelines locally](https://docs.redpanda.com/connect/get-started/quickstarts/rpk/) before deploying to the Cloud. --- # Page 17: Components Catalog **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/about.md --- # Components Catalog Use the following table to search for available inputs, outputs, and processors. Type: All Types Selected ▼ Buffer Cache Input Metric Output Processor Rate limit Scanner Tracer [ ### `memory` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/buffers/memory/) Stores consumed messages in memory and acknowledges them at the input level. 📦 Type [Buffer](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/buffers/memory/ "Component type: Buffer") [Cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/memory/ "Component type: Cache") Support Certified [ ### `none` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/buffers/none/) Do not buffer messages. This is the default and most resilient configuration. 📦 Type [Buffer](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/buffers/none/ "Component type: Buffer") [Metric](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/none/ "Component type: Metric") [Tracer](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/tracers/none/ "Component type: Tracer") Support Certified [ ### `system_window` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/buffers/system_window/) Chops a stream of messages into tumbling or sliding windows of fixed temporal size, following the system clock. 📦 Type [Buffer](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/buffers/system_window/ "Component type: Buffer") Support Certified [ ### `aws_dynamodb` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/aws_dynamodb/) Stores key/value pairs as a single document in a DynamoDB table. ![](https://docs.redpanda.com/_/img/logos/awsdynamo-db.svg) Type [Cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/aws_dynamodb/ "Component type: Cache") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/aws_dynamodb/ "Component type: Output") Support Community AWS DynamoDB Amazon DynamoDB DynamoDB [ ### `aws_s3` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/aws_s3/) Stores each item in an S3 bucket as a file, where an item ID is the path of the item within the bucket. ![](https://docs.redpanda.com/_/img/logos/awss3.svg) Type [Cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/aws_s3/ "Component type: Cache") [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_s3/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/aws_s3/ "Component type: Output") Support Certified AWS S3 Amazon S3 S3 Simple Storage Service [ ### `gcp_cloud_storage` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/gcp_cloud_storage/) Use a Google Cloud Storage bucket as a cache. ![](https://docs.redpanda.com/_/img/logos/google-cloud.svg) Type [Cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/gcp_cloud_storage/ "Component type: Cache") [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gcp_cloud_storage/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/gcp_cloud_storage/ "Component type: Output") Support Certified GCP Cloud Storage Google Cloud Storage GCS [ ### `lru` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/lru/) Stores key/value pairs in a lru in-memory cache. This cache is therefore reset every time the service restarts. 💾 Type [Cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/lru/ "Component type: Cache") Support Community [ ### `memcached` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/memcached/) Connects to a cluster of memcached services, a prefix can be specified to allow multiple cache types to share a memcached cluster under different... ![](https://docs.redpanda.com/_/img/logos/memcached.svg) Type [Cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/memcached/ "Component type: Cache") Support Community [ ### `mongodb` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/mongodb/) Use a MongoDB instance as a cache. ![](https://docs.redpanda.com/_/img/logos/mongo-db.svg) Type [Cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/mongodb/ "Component type: Cache") [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/mongodb/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/mongodb/ "Component type: Output") [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mongodb/ "Component type: Processor") Support Certified Mongo [ ### `multilevel` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/multilevel/) Combines multiple caches as levels, performing read-through and write-through operations across them. 💾 Type [Cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/multilevel/ "Component type: Cache") Support Certified [ ### `nats_kv` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/nats_kv/) Caches key/value pairs in a NATS key-value bucket. ![](https://docs.redpanda.com/_/img/logos/nats.svg) Type [Cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/nats_kv/ "Component type: Cache") [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/nats_kv/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/nats_kv/ "Component type: Output") [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/nats_kv/ "Component type: Processor") Support Certified NATS KV [ ### `noop` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/noop/) Noop is a cache that stores nothing, all gets returns not found. Why? Sometimes doing nothing is the braver option. ⚙️ Type [Cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/noop/ "Component type: Cache") [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/noop/ "Component type: Processor") Support Certified [ ### `redis` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/redis/) Use a Redis instance as a cache. The expiration can be set to zero or an empty string in order to set no expiration. ![](https://docs.redpanda.com/_/img/logos/redis.svg) Type [Cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/redis/ "Component type: Cache") [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/redis/ "Component type: Processor") [Rate_limit](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/redis/ "Component type: Rate_limit") Support Certified [ ### `redpanda` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/redpanda/) A Kafka cache implemented using the Franz Kafka client library. ![](https://cdn.prod.website-files.com/68ed36e99e31581dedf5dc7c/68ed91d74b9cd10c98cb8e6e_footer-logo.svg) Type [Cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/redpanda/ "Component type: Cache") [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda/ "Component type: Output") [Tracer](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/tracers/redpanda/ "Component type: Tracer") Support Certified [ ### `ristretto` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/ristretto/) Stores key/value pairs in a map held in the memory-bound Ristretto cache. 💾 Type [Cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/ristretto/ "Component type: Cache") Support Community [ ### `sql` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/sql/) Uses an SQL database table as a destination for storing cache key/value items. 📤 Type [Cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/sql/ "Component type: Cache") Support Certified Community [ ### `ttlru` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/ttlru/) Stores key/value pairs in a ttlru in-memory cache. This cache is therefore reset every time the service restarts. 💾 Type [Cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/ttlru/ "Component type: Cache") Support Community [ ### `amqp_0_9` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/amqp_0_9/) Connects to an AMQP (0.91) queue. AMQP is a messaging protocol used by various message brokers, including RabbitMQ. ![](https://docs.redpanda.com/_/img/logos/rabbit-mq.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/amqp_0_9/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/amqp_0_9/ "Component type: Output") Support Certified RabbitMQ AMQP [ ### `aws_cloudwatch_logs` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_cloudwatch_logs/) Consumes log events from AWS CloudWatch Logs. ![](https://docs.redpanda.com/_/img/logos/awscloud-watch.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_cloudwatch_logs/ "Component type: Input") Support Community AWS CloudWatch Logs Amazon CloudWatch Logs [ ### `aws_dynamodb_cdc` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_dynamodb_cdc/) Reads change data capture (CDC) events from DynamoDB Streams. ![](https://docs.redpanda.com/_/img/logos/awsdynamo-db.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_dynamodb_cdc/ "Component type: Input") Support Certified Amazon DynamoDB CDC [ ### `aws_kinesis` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_kinesis/) Receive messages from one or more Kinesis streams. ![](https://docs.redpanda.com/_/img/logos/awskinesis.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_kinesis/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/aws_kinesis/ "Component type: Output") Support Certified AWS Kinesis Amazon Kinesis Kinesis [ ### `aws_sqs` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_sqs/) Consume messages from an AWS SQS URL. ![](https://docs.redpanda.com/_/img/logos/awssqs.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_sqs/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/aws_sqs/ "Component type: Output") Support Certified AWS SQS Amazon SQS SQS Simple Queue Service [ ### `azure_blob_storage` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/azure_blob_storage/) Downloads objects within an Azure Blob Storage container, optionally filtered by a prefix. ![](https://docs.redpanda.com/_/img/logos/microsoftazure.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/azure_blob_storage/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/azure_blob_storage/ "Component type: Output") Support Certified Azure Blob Storage Microsoft Azure Storage [ ### `azure_cosmosdb` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/azure_cosmosdb/) Executes a SQL query against Azure CosmosDB and creates a batch of messages from each page of items. ![](https://docs.redpanda.com/_/img/logos/microsoftazure.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/azure_cosmosdb/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/azure_cosmosdb/ "Component type: Output") [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/azure_cosmosdb/ "Component type: Processor") Support Certified Microsoft Azure Azure [ ### `azure_queue_storage` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/azure_queue_storage/) Dequeue objects from an Azure Storage Queue. ![](https://docs.redpanda.com/_/img/logos/microsoftazure.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/azure_queue_storage/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/azure_queue_storage/ "Component type: Output") Support Certified Azure Queue Storage Microsoft Azure Queue [ ### `azure_table_storage` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/azure_table_storage/) Queries an Azure Storage Account Table, optionally with multiple filters. ![](https://docs.redpanda.com/_/img/logos/microsoftazure.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/azure_table_storage/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/azure_table_storage/ "Component type: Output") Support Certified Azure Table Storage Microsoft Azure Table [ ### `batched` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/batched/) Consumes data from a child input and applies a batching policy to the stream. 📦 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/batched/ "Component type: Input") Support Certified [ ### `broker` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/broker/) Allows you to combine multiple inputs into a single stream of data, where each input will be read in parallel. 📥 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/broker/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/broker/ "Component type: Output") Support Certified [ ### `csv` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/csv/) Reads one or more CSV files as structured records following the format described in RFC 4180. 📥 Type [Scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/csv/ "Component type: Scanner") Support Certified Comma-Separated Values [ ### `gateway` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gateway/) Receive messages delivered over HTTP. 📥 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gateway/ "Component type: Input") Support Certified [ ### `gcp_bigquery_select` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gcp_bigquery_select/) Executes a SELECT query against BigQuery and creates a message for each row received. ![](https://docs.redpanda.com/_/img/logos/google-cloud.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gcp_bigquery_select/ "Component type: Input") [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/gcp_bigquery_select/ "Component type: Processor") Support Certified GCP BigQuery Google Cloud GCP [ ### `gcp_pubsub` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gcp_pubsub/) Consumes messages from a GCP Cloud Pub/Sub subscription. ![](https://docs.redpanda.com/_/img/logos/google-cloud.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gcp_pubsub/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/gcp_pubsub/ "Component type: Output") Support Certified GCP PubSub Google Cloud Pub/Sub GCP Pub/Sub Google Pub/Sub [ ### `gcp_spanner_cdc` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gcp_spanner_cdc/) Consumes change records from a Google Cloud Spanner change stream. ![](https://docs.redpanda.com/_/img/logos/google-cloud.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gcp_spanner_cdc/ "Component type: Input") Support Certified Google Cloud GCP [ ### `generate` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/generate/) Generates messages at a given interval using a Bloblang mapping executed without a context. 📥 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/generate/ "Component type: Input") Support Certified [ ### `git` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/git/) Clones a Git repository, reads its contents, then polls for new commits at a configurable interval. 📥 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/git/ "Component type: Input") Support Certified [ ### `http_client` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/http_client/) Connects to a server and continuously performs requests for a single message. 🌐 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/http_client/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/http_client/ "Component type: Output") Support Certified HTTP REST API REST [ ### `http_server` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/http_server/) Receive messages POSTed over HTTP(S). HTTP 2.0 is supported when using TLS, which is enabled when key and cert files are specified. 🌐 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/http_server/ "Component type: Input") Support Certified HTTP REST API REST Gateway [ ### `inproc` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/inproc/) Directly connects to an output within the same process by a chosen ID, to link isolated streams when running in streams mode. 📥 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/inproc/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/inproc/ "Component type: Output") Support Certified [ ### `jira` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/jira/) Streams Jira issues, comments, or changelog entries via JQL with incremental polling. 📥 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/jira/ "Component type: Input") [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/jira/ "Component type: Processor") Support Certified Atlassian Jira [ ### `kafka` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/kafka/) Connects to Kafka brokers and consumes one or more topics. ![](https://docs.redpanda.com/_/img/logos/apache-kafka.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/kafka/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/kafka/ "Component type: Output") Support Certified Apache Kafka [ ### `kafka_franz` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/kafka_franz/) A Kafka input using the Franz Kafka client library. ![](https://docs.redpanda.com/_/img/logos/apache-kafka.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/kafka_franz/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/kafka_franz/ "Component type: Output") Support Certified Apache Kafka Kafka [ ### `microsoft_sql_server_cdc` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/microsoft_sql_server_cdc/) Enables Change Data Capture by consuming from Microsoft SQL Server's change tables. ![](https://docs.redpanda.com/_/img/logos/microsoftsqlserver.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/microsoft_sql_server_cdc/ "Component type: Input") Support Certified [ ### `mongodb_cdc` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/mongodb_cdc/) Streams changes from a MongoDB replica set. ![](https://docs.redpanda.com/_/img/logos/mongo-db.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/mongodb_cdc/ "Component type: Input") Support Certified MongoDB CDC [ ### `mqtt` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/mqtt/) Subscribe to topics on MQTT brokers. ![](https://docs.redpanda.com/_/img/logos/mqtt.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/mqtt/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/mqtt/ "Component type: Output") Support Certified [ ### `mysql_cdc` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/mysql_cdc/) Streams data changes from a MySQL or MariaDB database, using the binary log to capture data updates. ![](https://docs.redpanda.com/_/img/logos/my-sql.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/mysql_cdc/ "Component type: Input") Support Certified [ ### `nats` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/nats/) Subscribes to a NATS subject. ![](https://docs.redpanda.com/_/img/logos/nats.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/nats/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/nats/ "Component type: Output") Support Certified NATS.io [ ### `nats_jetstream` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/nats_jetstream/) Reads messages from NATS JetStream subjects. ![](https://docs.redpanda.com/_/img/logos/nats.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/nats_jetstream/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/nats_jetstream/ "Component type: Output") Support Certified NATS JetStream NATS [ ### `oracledb_cdc` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/oracledb_cdc/) Enables Change Data Capture by consuming from OracleDB. ![](https://docs.redpanda.com/_/img/logos/oracle.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/oracledb_cdc/ "Component type: Input") Support Certified Oracle CDC OracleDB CDC Oracle Database CDC [ ### `otlp_grpc` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/otlp_grpc/) Receive OpenTelemetry traces, logs, and metrics via OTLP/gRPC protocol. ![](https://docs.redpanda.com/_/img/logos/open-telemetry.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/otlp_grpc/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/otlp_grpc/ "Component type: Output") Support Certified OpenTelemetry OTLP OTel gRPC [ ### `otlp_http` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/otlp_http/) Receive OpenTelemetry traces, logs, and metrics via OTLP/HTTP protocol. ![](https://docs.redpanda.com/_/img/logos/open-telemetry.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/otlp_http/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/otlp_http/ "Component type: Output") Support Certified OpenTelemetry OTLP OTel ### `pg_stream` Streams changes from a PostgreSQL database using logical replication. ![](https://docs.redpanda.com/_/img/logos/postgre-sql.svg) Type Input Support Certified [ ### `postgres_cdc` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/postgres_cdc/) Streams changes from a PostgreSQL database using logical replication. ![](https://docs.redpanda.com/_/img/logos/postgre-sql.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/postgres_cdc/ "Component type: Input") Support Certified [ ### `read_until` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/read_until/) Reads messages from a child input until a consumed message passes a Bloblang query, at which point the input closes. 📥 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/read_until/ "Component type: Input") Support Certified [ ### `redis_list` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redis_list/) Pops messages from the beginning of a Redis list using the BLPop command. ![](https://docs.redpanda.com/_/img/logos/redis.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redis_list/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redis_list/ "Component type: Output") Support Certified Redis List Redis Lists Redis [ ### `redis_pubsub` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redis_pubsub/) Consume from a Redis publish/subscribe channel using either the SUBSCRIBE or PSUBSCRIBE commands. ![](https://docs.redpanda.com/_/img/logos/redis.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redis_pubsub/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redis_pubsub/ "Component type: Output") Support Certified Redis PubSub Redis Pub/Sub Redis [ ### `redis_scan` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redis_scan/) Scans the set of keys in the current selected database and gets their values, using the Scan and Get commands. ![](https://docs.redpanda.com/_/img/logos/redis.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redis_scan/ "Component type: Input") Support Certified Redis [ ### `redis_streams` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redis_streams/) Pulls messages from Redis (v5.0+) streams with the XREADGROUP command. The client_id should be unique for each consumer of a group. ![](https://docs.redpanda.com/_/img/logos/redis.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redis_streams/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redis_streams/ "Component type: Output") Support Certified Redis Streams Redis [ ### `redpanda_common` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda_common/) Consumes data from a Redpanda (Kafka) broker, using credentials defined in a common top-level redpanda config block. ![](https://cdn.prod.website-files.com/68ed36e99e31581dedf5dc7c/68ed91d74b9cd10c98cb8e6e_footer-logo.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda_common/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda_common/ "Component type: Output") Support Certified [ ### `redpanda_migrator` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda_migrator/) Consumes records from a source Kafka or Redpanda cluster for the redpanda_migrator output to migrate. ![](https://cdn.prod.website-files.com/68ed36e99e31581dedf5dc7c/68ed91d74b9cd10c98cb8e6e_footer-logo.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda_migrator/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda_migrator/ "Component type: Output") Support Certified [ ### `resource` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/resource/) Resource is an input type that channels messages from a resource input, identified by its name. 📥 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/resource/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/resource/ "Component type: Output") [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/resource/ "Component type: Processor") Support Certified [ ### `salesforce` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce/) Executes a Salesforce SOQL query once and emits a message for each record. 📥 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce/ "Component type: Input") Support Certified [ ### `salesforce_cdc` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce_cdc/) Streams Salesforce Change Data Capture (CDC) and Platform Events from the Pub/Sub gRPC API, optionally preceded by a REST snapshot of the... 🔄 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce_cdc/ "Component type: Input") Support Certified Salesforce Salesforce CDC [ ### `salesforce_graphql` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce_graphql/) Executes a Salesforce GraphQL (UIAPI) query once and emits a message for each record. 📥 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce_graphql/ "Component type: Input") Support Certified Salesforce Salesforce GraphQL [ ### `sap_hana` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sap_hana/) Reads rows from a SAP HANA table. 📥 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sap_hana/ "Component type: Input") Support Certified SAP HANA [ ### `schema_registry` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/schema_registry/) Reads schemas from a schema registry. 📥 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/schema_registry/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/schema_registry/ "Component type: Output") Support Certified [ ### `sequence` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sequence/) Reads messages from a sequence of child inputs, starting with the first and once that input gracefully terminates starts consuming from the next,... 📥 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sequence/ "Component type: Input") Support Certified [ ### `sftp` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sftp/) Consumes files from an SFTP server. 📁 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sftp/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/sftp/ "Component type: Output") Support Certified [ ### `slack` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/slack/) Connects to Slack using Socket Mode and receives events, interactions, and slash commands. ![](https://docs.redpanda.com/_/img/logos/slack.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/slack/ "Component type: Input") Support Certified [ ### `slack_users` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/slack_users/) Returns the full profile of all users in your Slack organization using the users.list API method. You can filter the returned users by team ID. ![](https://docs.redpanda.com/_/img/logos/slack.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/slack_users/ "Component type: Input") Support Certified Slack Users [ ### `spicedb_watch` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/spicedb_watch/) Consume messages from the Watch API from SpiceDB. 📥 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/spicedb_watch/ "Component type: Input") Support Community [ ### `splunk` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/splunk/) Consumes messages from Splunk. ![](https://docs.redpanda.com/_/img/logos/splunk.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/splunk/ "Component type: Input") Support Certified [ ### `sql_raw` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sql_raw/) Executes a select query and creates a message for each row received. 🗄️ Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sql_raw/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/sql_raw/ "Component type: Output") [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/sql_raw/ "Component type: Processor") Support Certified: MYSQL, Oracle, PostgreSQL, SQLiteCommunity: ClickHouse, Azure Cosmos DB, Microsoft SQL Server, Snowflake, Trino SQL PostgreSQL MySQL Microsoft SQL Server ClickHouse Trino [ ### `sql_select` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sql_select/) Executes a select query and creates a message for each row received. 🗄️ Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sql_select/ "Component type: Input") [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/sql_select/ "Component type: Processor") Support Certified: MYSQL, Oracle, PostgreSQL, SQLiteCommunity: ClickHouse, Azure Cosmos DB, Microsoft SQL Server, Snowflake, Trino SQL PostgreSQL MySQL Microsoft SQL Server ClickHouse Trino [ ### `timeplus` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/timeplus/) Executes a query on Timeplus Enterprise and creates a message from each row received. 📥 Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/timeplus/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/timeplus/ "Component type: Output") Support Community [ ### `websocket` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/websocket/) Connects to a websocket server and continuously receives messages. ![](https://docs.redpanda.com/_/img/logos/web-socket.svg) Type [Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/websocket/ "Component type: Input") [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/websocket/ "Component type: Output") Support Certified [ ### `open_telemetry_collector` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/open_telemetry_collector/) Sends metrics to one or more OpenTelemetry Collector endpoints. ![](https://docs.redpanda.com/_/img/logos/open-telemetry.svg) Type [Metric](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/open_telemetry_collector/ "Component type: Metric") [Tracer](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/tracers/open_telemetry_collector/ "Component type: Tracer") Support Certified OpenTelemetry [ ### `prometheus` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/prometheus/) Host endpoints (/metrics and /stats) for Prometheus scraping. ![](https://docs.redpanda.com/_/img/logos/prometheus.svg) Type [Metric](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/prometheus/ "Component type: Metric") Support Certified [ ### `arc` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/arc/) Writes data to an Arc database via the msgpack ingestion endpoint. 📤 Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/arc/ "Component type: Output") Support Community [ ### `aws_kinesis_firehose` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/aws_kinesis_firehose/) Sends messages to a Kinesis Firehose delivery stream. ![](https://docs.redpanda.com/_/img/logos/awskinesis.svg) Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/aws_kinesis_firehose/ "Component type: Output") Support Certified AWS Kinesis Firehose Amazon Kinesis Firehose Kinesis Firehose [ ### `aws_sns` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/aws_sns/) Sends messages to an AWS SNS topic. ![](https://docs.redpanda.com/_/img/logos/awssns.svg) Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/aws_sns/ "Component type: Output") Support Community AWS SNS Amazon SNS SNS Simple Notification Service [ ### `azure_data_lake_gen2` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/azure_data_lake_gen2/) Sends message parts as files to an Azure Data Lake Gen2 filesystem. Each file is uploaded with the filename specified with the path field. ![](https://docs.redpanda.com/_/img/logos/microsoftazure.svg) Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/azure_data_lake_gen2/ "Component type: Output") Support Certified Microsoft Azure Azure [ ### `cache` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/cache/) Stores each message in a cache. 💾 Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/cache/ "Component type: Output") [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cache/ "Component type: Processor") Support Certified [ ### `cyborgdb` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/cyborgdb/) Inserts items into a CyborgDB encrypted vector index. 📤 Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/cyborgdb/ "Component type: Output") Support Community [ ### `drop` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/drop/) Drops all messages. 🗑️ Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/drop/ "Component type: Output") Support Certified [ ### `drop_on` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/drop_on/) Attempts to write messages to a child output and if the write fails for one of a list of configurable reasons the message is dropped (acked)... 📤 Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/drop_on/ "Component type: Output") Support Certified [ ### `elasticsearch_v8` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/elasticsearch_v8/) Publishes messages into an Elasticsearch index. If the index does not exist then it is created with a dynamic mapping. ![](https://docs.redpanda.com/_/img/logos/elasticsearch.svg) Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/elasticsearch_v8/ "Component type: Output") Support Certified [ ### `fallback` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/fallback/) Attempts to send each message to a child output, starting from the first output on the list. 📤 Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/fallback/ "Component type: Output") Support Certified [ ### `gcp_bigquery` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/gcp_bigquery/) Sends messages as new rows to a Google Cloud BigQuery table. ![](https://docs.redpanda.com/_/img/logos/google-cloud.svg) Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/gcp_bigquery/ "Component type: Output") Support Certified GCP BigQuery Google BigQuery BigQuery [ ### `gcp_bigquery_write_api` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/gcp_bigquery_write_api/) Streams data into BigQuery using the Storage Write API. ![](https://docs.redpanda.com/_/img/logos/google-cloud.svg) Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/gcp_bigquery_write_api/ "Component type: Output") Support Certified GCP BigQuery [ ### `iceberg` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/iceberg/) Writes data to Apache Iceberg tables using the REST catalog API. 📤 Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/iceberg/ "Component type: Output") Support Certified Apache Iceberg Apache Polaris AWS Glue Databricks Unity Catalog [ ### `opensearch` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/opensearch/) Publishes messages into an Elasticsearch index. If the index does not exist then it is created with a dynamic mapping. ![](https://docs.redpanda.com/_/img/logos/open-search.svg) Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/opensearch/ "Component type: Output") Support Certified [ ### `pinecone` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/pinecone/) Inserts items into a Pinecone index. ![](https://docs.redpanda.com/_/img/logos/pinecone.svg) Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/pinecone/ "Component type: Output") Support Certified [ ### `qdrant` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/qdrant/) Adds items to a Qdrant collection. ![](https://docs.redpanda.com/_/img/logos/qdrant.svg) Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/qdrant/ "Component type: Output") [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/qdrant/ "Component type: Processor") Support Certified [ ### `questdb` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/questdb/) Pushes messages to a QuestDB table. 📤 Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/questdb/ "Component type: Output") Support Certified [ ### `redis_hash` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redis_hash/) Sets Redis hash objects using the HSET command. ![](https://docs.redpanda.com/_/img/logos/redis.svg) Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redis_hash/ "Component type: Output") Support Certified Redis Hash Redis [ ### `reject` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/reject/) Rejects all messages, treating them as though the output destination failed to publish them. 📤 Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/reject/ "Component type: Output") Support Certified [ ### `reject_errored` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/reject_errored/) Rejects messages that have failed their processing steps, resulting in nack behavior at the input level, otherwise sends them to a child output. 📤 Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/reject_errored/ "Component type: Output") Support Certified [ ### `retry` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/retry/) Attempts to write messages to a child output and if the write fails for any reason the message is retried either until success or, if the retries... 📤 Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/retry/ "Component type: Output") [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/retry/ "Component type: Processor") Support Certified [ ### `salesforce_sink` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/salesforce_sink/) Writes messages to Salesforce, routing each Kafka topic to its own sObject configuration. 📤 Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/salesforce_sink/ "Component type: Output") Support Certified Salesforce Salesforce Sink [ ### `slack_post` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/slack_post/) Posts a new message to a Slack channel using the Slack API method chat.postMessage. ![](https://docs.redpanda.com/_/img/logos/slack.svg) Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/slack_post/ "Component type: Output") Support Certified Slack Post [ ### `slack_reaction` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/slack_reaction/) Adds or removes an emoji reaction on a Slack message. ![](https://docs.redpanda.com/_/img/logos/slack.svg) Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/slack_reaction/ "Component type: Output") Support Certified Slack Reaction [ ### `snowflake_put` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/snowflake_put/) Sends messages to Snowflake stages and, optionally, calls Snowpipe to load this data into one or more tables. ![](https://docs.redpanda.com/_/img/logos/snowflake.svg) Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/snowflake_put/ "Component type: Output") Support Certified Snowflake [ ### `snowflake_streaming` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/snowflake_streaming/) Ingests data into Snowflake using the Snowpipe Streaming classic architecture. ![](https://docs.redpanda.com/_/img/logos/snowflake.svg) Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/snowflake_streaming/ "Component type: Output") Support Certified Snowflake Streaming [ ### `snowflake_streaming_pipe` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/snowflake_streaming_pipe/) Ingest data into Snowflake using Snowpipe Streaming, writing through a Snowflake pipe. ![](https://docs.redpanda.com/_/img/logos/snowflake.svg) Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/snowflake_streaming_pipe/ "Component type: Output") Support Certified Snowflake Streaming Pipe [ ### `splunk_hec` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/splunk_hec/) Publishes messages to a Splunk HTTP Endpoint Collector (HEC). ![](https://docs.redpanda.com/_/img/logos/splunk.svg) Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/splunk_hec/ "Component type: Output") Support Certified Splunk [ ### `sql_insert` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/sql_insert/) Inserts a row into an SQL database for each message. 🗄️ Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/sql_insert/ "Component type: Output") [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/sql_insert/ "Component type: Processor") Support Certified: MYSQL, Oracle, PostgreSQL, SQLiteCommunity: ClickHouse, Azure Cosmos DB, Microsoft SQL Server, Snowflake, Trino SQL PostgreSQL MySQL Microsoft SQL Server ClickHouse Trino [ ### `switch` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/switch/) The switch output type allows you to route messages to different outputs based on their contents. 📤 Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/switch/ "Component type: Output") [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/switch/ "Component type: Processor") [Scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/switch/ "Component type: Scanner") Support Certified [ ### `sync_response` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/sync_response/) Returns the final message payload back to the input origin of the message, where it is dealt with according to that specific input type. 📤 Type [Output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/sync_response/ "Component type: Output") [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/sync_response/ "Component type: Processor") Support Certified [ ### `a2a_message` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/a2a_message/) Sends messages to an A2A (Agent-to-Agent) protocol agent and returns the response. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/a2a_message/ "Component type: Processor") Support Certified [ ### `archive` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/archive/) Archives all the messages of a batch into a single message according to the selected archive format. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/archive/ "Component type: Processor") Support Certified ZIP TAR GZIP [ ### `avro` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/avro/) Performs Avro based operations on messages based on a schema. ![](https://docs.redpanda.com/_/img/logos/apacheavro.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/avro/ "Component type: Processor") [Scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/avro/ "Component type: Scanner") Support Community [ ### `aws_bedrock_chat` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/aws_bedrock_chat/) Generates responses to messages in a chat conversation, using the AWS Bedrock API. ![](https://docs.redpanda.com/_/img/logos/awslambda.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/aws_bedrock_chat/ "Component type: Processor") Support Certified Amazon AWS Bedrock Chat [ ### `aws_bedrock_embeddings` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/aws_bedrock_embeddings/) Computes vector embeddings on text, using the AWS Bedrock API. ![](https://docs.redpanda.com/_/img/logos/awslambda.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/aws_bedrock_embeddings/ "Component type: Processor") Support Certified Amazon AWS Bedrock Embeddings [ ### `aws_dynamodb_partiql` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/aws_dynamodb_partiql/) Executes a PartiQL expression against a DynamoDB table for each message. ![](https://docs.redpanda.com/_/img/logos/awsdynamo-db.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/aws_dynamodb_partiql/ "Component type: Processor") Support Certified Amazon AWS DynamoDB PartiQL [ ### `aws_lambda` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/aws_lambda/) Invokes an AWS lambda for each message. ![](https://docs.redpanda.com/_/img/logos/awslambda.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/aws_lambda/ "Component type: Processor") Support Certified AWS Lambda Amazon Lambda Lambda [ ### `benchmark` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/benchmark/) Logs basic throughput statistics of messages that pass through this processor. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/benchmark/ "Component type: Processor") Support Certified [ ### `bloblang` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/bloblang/) Executes a Bloblang mapping on messages. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/bloblang/ "Component type: Processor") Support Certified [ ### `bounds_check` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/bounds_check/) Removes messages (and batches) that do not fit within certain size boundaries. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/bounds_check/ "Component type: Processor") Support Certified [ ### `branch` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/) The branch processor allows you to create a new request message via a Bloblang mapping, execute a list of processors on the request messages, and,... ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/ "Component type: Processor") Support Certified [ ### `cached` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cached/) Cache the result of applying one or more processors to messages identified by a key. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cached/ "Component type: Processor") Support Certified [ ### `catch` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/catch/) Applies a list of child processors only when a previous processing step has failed. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/catch/ "Component type: Processor") Support Certified [ ### `cohere_chat` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cohere_chat/) Generates responses to messages in a chat conversation, using the Cohere API. ![](https://docs.redpanda.com/_/img/logos/cohere.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cohere_chat/ "Component type: Processor") Support Certified [ ### `cohere_embeddings` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cohere_embeddings/) Generates vector embeddings to represent input text, using the Cohere API. ![](https://docs.redpanda.com/_/img/logos/cohere.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cohere_embeddings/ "Component type: Processor") Support Certified [ ### `cohere_rerank` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cohere_rerank/) Reranks a list of documents by their relevance to a query, using the Cohere API. ![](https://docs.redpanda.com/_/img/logos/cohere.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cohere_rerank/ "Component type: Processor") Support Certified [ ### `compress` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/compress/) Compresses messages according to the selected algorithm. Supported compression algorithms are: \[flate gzip lz4 pgzip snappy zlib\] ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/compress/ "Component type: Processor") Support Certified [ ### `decompress` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/decompress/) Decompresses messages according to the selected algorithm. Supported decompression algorithms are: \[bzip2 flate gzip lz4 pgzip snappy zlib\] ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/decompress/ "Component type: Processor") [Scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/decompress/ "Component type: Scanner") Support Certified [ ### `dedupe` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/dedupe/) Deduplicates messages by storing a key value in a cache using the add operator. If the key already exists within the cache it is dropped. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/dedupe/ "Component type: Processor") Support Certified [ ### `for_each` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/for_each/) A processor that applies a list of child processors to messages of a batch as though they were each a batch of one message. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/for_each/ "Component type: Processor") Support Certified [ ### `gcp_vertex_ai_chat` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/gcp_vertex_ai_chat/) Generates responses to messages in a chat conversation, using the Vertex AI API. ![](https://docs.redpanda.com/_/img/logos/google-cloud.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/gcp_vertex_ai_chat/ "Component type: Processor") Support Certified GCP Vertex AI Google Cloud GCP [ ### `gcp_vertex_ai_embeddings` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/gcp_vertex_ai_embeddings/) Generates vector embeddings to represent input text, using the Vertex AI API. ![](https://docs.redpanda.com/_/img/logos/google-cloud.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/gcp_vertex_ai_embeddings/ "Component type: Processor") Support Certified Google Cloud GCP [ ### `google_drive_download` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/google_drive_download/) Downloads files from Google Drive. ![](https://docs.redpanda.com/_/img/logos/google-drive.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/google_drive_download/ "Component type: Processor") Support Certified [ ### `google_drive_list_labels` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/google_drive_list_labels/) Lists labels for a file in Google Drive. ![](https://docs.redpanda.com/_/img/logos/google-drive.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/google_drive_list_labels/ "Component type: Processor") Support Certified [ ### `google_drive_search` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/google_drive_search/) Searches Google Drive for files matching the provided query. ![](https://docs.redpanda.com/_/img/logos/google-drive.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/google_drive_search/ "Component type: Processor") Support Certified [ ### `group_by` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/group_by/) Splits a batch of messages into N batches, where each resulting batch contains a group of messages determined by a Bloblang query. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/group_by/ "Component type: Processor") Support Certified [ ### `group_by_value` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/group_by_value/) Splits a batch of messages into N batches, where each resulting batch contains a group of messages determined by a function interpolated string... ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/group_by_value/ "Component type: Processor") Support Certified [ ### `http` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/http/) Performs an HTTP request using a message batch as the request body, and replaces the original message parts with the body of the response. 🌐 Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/http/ "Component type: Processor") Support Certified [ ### `insert_part` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/insert_part/) Insert a new message into a batch at an index. If the specified index is greater than the length of the existing batch it will be appended to the end. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/insert_part/ "Component type: Processor") Support Certified [ ### `jmespath` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/jmespath/) Executes a JMESPath query on JSON documents and replaces the message with the resulting document. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/jmespath/ "Component type: Processor") Support Certified [ ### `jq` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/jq/) Transforms and filters messages using jq queries. ![](https://docs.redpanda.com/_/img/logos/jq.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/jq/ "Component type: Processor") Support Certified [ ### `json_schema` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/json_schema/) Checks messages against a provided JSONSchema definition but does not change the payload under any circumstances. ![](https://docs.redpanda.com/_/img/logos/json.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/json_schema/ "Component type: Processor") Support Certified JSON Schema [ ### `log` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/log/) Prints a log event for each message. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/log/ "Component type: Processor") Support Certified [ ### `mapping` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mapping/) Executes a Bloblang mapping on messages, creating a new document that replaces (or filters) the original message. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mapping/ "Component type: Processor") Support Certified [ ### `metric` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/metric/) Emit custom metrics by extracting values from messages. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/metric/ "Component type: Processor") Support Certified [ ### `mutation` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mutation/) Executes a Bloblang mapping and directly transforms the contents of messages, mutating (or deleting) them. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mutation/ "Component type: Processor") Support Certified [ ### `nats_request_reply` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/nats_request_reply/) Sends a message to a NATS subject and expects a reply back from a NATS subscriber acting as a responder. ![](https://docs.redpanda.com/_/img/logos/nats.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/nats_request_reply/ "Component type: Processor") Support Certified NATS Request Reply [ ### `ollama_chat` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/ollama_chat/) Generates responses to messages in a chat conversation, using the Ollama API. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/ollama_chat/ "Component type: Processor") Support Certified [ ### `ollama_embeddings` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/ollama_embeddings/) Generates vector embeddings from text, using the Ollama API. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/ollama_embeddings/ "Component type: Processor") Support Certified [ ### `ollama_moderation` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/ollama_moderation/) Checks whether responses from a large language model (LLM) are safe, using the Ollama API. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/ollama_moderation/ "Component type: Processor") Support Certified [ ### `openai_chat_completion` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_chat_completion/) Generates responses to messages in a chat conversation, using the OpenAI API. ![](https://docs.redpanda.com/_/img/logos/open-ai.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_chat_completion/ "Component type: Processor") Support Certified [ ### `openai_embeddings` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_embeddings/) Generates vector embeddings to represent input text, using the OpenAI API. ![](https://docs.redpanda.com/_/img/logos/open-ai.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_embeddings/ "Component type: Processor") Support Certified [ ### `openai_image_generation` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_image_generation/) Generates an image from a text description and other attributes, using OpenAI API. ![](https://docs.redpanda.com/_/img/logos/open-ai.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_image_generation/ "Component type: Processor") Support Certified [ ### `openai_speech` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_speech/) Generates audio from a text description and other attributes, using OpenAI API. ![](https://docs.redpanda.com/_/img/logos/open-ai.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_speech/ "Component type: Processor") Support Certified [ ### `openai_transcription` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_transcription/) Generates a transcription of spoken audio in the input language, using the OpenAI API. ![](https://docs.redpanda.com/_/img/logos/open-ai.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_transcription/ "Component type: Processor") Support Certified [ ### `openai_translation` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_translation/) Translates spoken audio into English, using the OpenAI API. ![](https://docs.redpanda.com/_/img/logos/open-ai.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_translation/ "Component type: Processor") Support Certified [ ### `parallel` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/parallel/) A processor that applies a list of child processors to messages of a batch as though they were each a batch of one message (similar to the... ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/parallel/ "Component type: Processor") Support Certified [ ### `parquet_decode` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/parquet_decode/) Decodes Parquet files into a batch of structured messages. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/parquet_decode/ "Component type: Processor") Support Certified [ ### `parquet_encode` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/parquet_encode/) Encodes Parquet files from a batch of structured messages. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/parquet_encode/ "Component type: Processor") Support Certified [ ### `parse_log` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/parse_log/) Parses common log formats into structured data. This is easier and often much faster than grok. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/parse_log/ "Component type: Processor") Support Community [ ### `processors` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/processors/) A processor grouping several sub-processors. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/processors/ "Component type: Processor") Support Certified [ ### `rate_limit` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/rate_limit/) Throttles the throughput of a pipeline according to a specified rate_limit resource. ⏱️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/rate_limit/ "Component type: Processor") Support Certified [ ### `redis_script` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/redis_script/) Performs actions against Redis using LUA scripts. ![](https://docs.redpanda.com/_/img/logos/redis.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/redis_script/ "Component type: Processor") Support Certified Redis Script [ ### `schema_registry_decode` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/schema_registry_decode/) Automatically decodes and validates messages with schemas from a Confluent Schema Registry service. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/schema_registry_decode/ "Component type: Processor") Support Certified [ ### `schema_registry_encode` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/schema_registry_encode/) Automatically encodes and validates messages with schemas from a Confluent Schema Registry service. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/schema_registry_encode/ "Component type: Processor") Support Certified [ ### `select_parts` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/select_parts/) Cherry pick a set of messages from a batch by their index. Indexes larger than the number of messages are simply ignored. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/select_parts/ "Component type: Processor") Support Certified [ ### `slack_thread` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/slack_thread/) Reads a Slack thread using the Slack API method conversations.replies. ![](https://docs.redpanda.com/_/img/logos/slack.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/slack_thread/ "Component type: Processor") Support Certified Slack Thread [ ### `sleep` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/sleep/) Sleep for a period of time specified as a duration string for each message. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/sleep/ "Component type: Processor") Support Certified [ ### `split` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/split/) Breaks message batches (synonymous with multiple part messages) into smaller batches. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/split/ "Component type: Processor") Support Certified [ ### `string_split` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/string_split/) Splits a string by a delimiter into an array. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/string_split/ "Component type: Processor") Support Certified [ ### `text_chunker` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/text_chunker/) Breaks text-based message content into chunks using a configurable strategy, typically to create vector embeddings of large documents. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/text_chunker/ "Component type: Processor") Support Certified [ ### `try` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/try/) Executes a list of child processors on messages only if no prior processors have failed (or the errors have been cleared). ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/try/ "Component type: Processor") Support Certified [ ### `try_catch` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/try_catch/) Executes a list of child processors on each message and, if any of them fail, executes a separate list of catch processors to recover from or... ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/try_catch/ "Component type: Processor") Support Community [ ### `unarchive` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/unarchive/) Unarchives messages according to the selected archive format into multiple messages within a batch. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/unarchive/ "Component type: Processor") Support Certified ZIP TAR GZIP Archive [ ### `while` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/while/) A processor that checks a Bloblang query against each batch of messages and executes child processors on them for as long as the query resolves to... ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/while/ "Component type: Processor") Support Certified [ ### `workflow` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/workflow/) Executes a topology of branch processors, performing them in parallel where possible. ⚙️ Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/workflow/ "Component type: Processor") Support Certified [ ### `xml` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/xml/) Parses messages as an XML document, performs a mutation on the data, and then overwrites the previous contents with the new value. ![](https://docs.redpanda.com/_/img/logos/xml.svg) Type [Processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/xml/ "Component type: Processor") Support Community [ ### `local` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/local/) A simple X every Y rate limit that can be shared across any number of components within a pipeline. ⏱️ Type [Rate_limit](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/local/ "Component type: Rate_limit") Support Certified [ ### `chunker` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/chunker/) Split an input stream into chunks of a given number of bytes. 🔍 Type [Scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/chunker/ "Component type: Scanner") Support Certified [ ### `json_array` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/json_array/) Consumes a stream of one or more JSON elements within a top level array. ![](https://docs.redpanda.com/_/img/logos/json.svg) Type [Scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/json_array/ "Component type: Scanner") Support Community [ ### `json_documents` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/json_documents/) Consumes a stream of one or more JSON documents. ![](https://docs.redpanda.com/_/img/logos/json.svg) Type [Scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/json_documents/ "Component type: Scanner") Support Certified [ ### `lines` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/lines/) Split an input stream into a message per line of data. 🔍 Type [Scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/lines/ "Component type: Scanner") Support Certified [ ### `re_match` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/re_match/) Split an input stream into segments matching against a regular expression. 🔍 Type [Scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/re_match/ "Component type: Scanner") Support Certified [ ### `skip_bom` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/skip_bom/) Skip one or more byte order marks for each opened child scanner. 🔍 Type [Scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/skip_bom/ "Component type: Scanner") Support Certified [ ### `tar` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/tar/) Consume a tar archive file by file. 🔍 Type [Scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/tar/ "Component type: Scanner") Support Certified [ ### `to_the_end` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/to_the_end/) Read the input stream all the way until the end and deliver it as a single message. 🔍 Type [Scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/to_the_end/ "Component type: Scanner") Support Certified [ ### `gcp_cloudtrace` ](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/tracers/gcp_cloudtrace/) Send tracing events to a Google Cloud Trace. ![](https://docs.redpanda.com/_/img/logos/google-cloud.svg) Type [Tracer](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/tracers/gcp_cloudtrace/ "Component type: Tracer") Support Certified GCP Cloud Trace ## About Components Every Redpanda Connect pipeline has at least one [input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/about/), an optional [buffer](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/buffers/about/), an [output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/about/) and any number of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/): ```yaml input: kafka: addresses: [ TODO ] topics: [ foo, bar ] consumer_group: foogroup buffer: type: none pipeline: processors: - mapping: | message = this meta.link_count = links.length() output: aws_s3: bucket: TODO path: '${! meta("kafka_topic") }/${! json("message.id") }.json' ``` These are the main components within Redpanda Connect and they provide the majority of useful behavior. ## Observability components There are also the observability components: [logger](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/logger/about/), [metrics](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/about/), and [tracing](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/tracers/about/), which allow you to specify how Redpanda Connect exposes observability data. ```yaml http: address: 0.0.0.0:4195 enabled: true debug_endpoints: false logger: format: json level: WARN metrics: statsd: address: localhost:8125 flush_period: 100ms tracer: jaeger: agent_address: localhost:6831 ``` ## Resource components Finally, there are [caches](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) and [rate limits](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/about/). These are components that are referenced by core components and can be shared. ```yaml input: http_client: # This is an input url: TODO rate_limit: foo_ratelimit # This is a reference to a rate limit pipeline: processors: - cache: # This is a processor resource: baz_cache # This is a reference to a cache operator: add key: '${! json("id") }' value: "x" - mapping: root = if errored() { deleted() } rate_limit_resources: - label: foo_ratelimit local: count: 500 interval: 1s cache_resources: - label: baz_cache memcached: addresses: [ localhost:11211 ] ``` It’s also possible to configure inputs, outputs and processors as resources which allows them to be reused throughout a configuration with the [`resource` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/resource/), [`resource` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/resource/) and [`resource` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/resource/) respectively. For more information about any of these component types check out their sections: - [inputs](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/about/) - [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) - [outputs](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/about/) - [buffers](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/buffers/about/) - [metrics](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/about/) - [tracers](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/tracers/about/) - [logger](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/logger/about/) - [caches](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) - [rate limits](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/about/) --- # Page 18: Buffers **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/buffers/about.md --- # Buffers Redpanda Connect uses a transaction model internally for guaranteeing delivery of messages, this means that a message from an input is not acknowledged (or its offset committed, etc) until that message has been processed and either intentionally deleted or successfully delivered to all outputs. This transaction model makes Redpanda Connect safe to deploy in scenarios where data loss is unacceptable. However, sometimes it’s useful to customize the way in which messages are delivered, and this is where buffers come in. A buffer is an optional component type that comes immediately after the input layer and can be used as a way of decoupling the transaction model from components downstream such as the processing layer and outputs. This is considered an advanced component as most users will likely not benefit from a buffer, but they enable you to do things like group messages using window algorithms or intentionally weaken the delivery guarantees of the pipeline depending on the buffer you choose. Since buffers are able to modify (or disable) the transaction model within Redpanda Connect it is important that when you choose a buffer you read its documentation to understand the implication it will have on delivery guarantees. --- # Page 19: memory **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/buffers/memory.md --- # memory Stores consumed messages in memory and acknowledges them at the input level. During shutdown Redpanda Connect will make a best attempt at flushing all remaining messages before exiting cleanly. This buffer is appropriate when consuming messages from inputs that do not gracefully handle back pressure and where delivery guarantees aren’t critical. This buffer has a configurable limit, where consumption will be stopped with back pressure upstream if the total size of messages in the buffer reaches this amount. Since this calculation is only an estimate, and the real size of messages in RAM is always higher, it is recommended to set the limit significantly below the amount of RAM available. ## Delivery guarantees This buffer intentionally weakens the delivery guarantees of the pipeline and therefore should never be used in places where data loss is unacceptable. ## Batching It is possible to batch up messages sent from this buffer using a [batch policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/#batch-policy). ### Common ```yml buffer: memory: limit: 524288000 batch_policy: enabled: false count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml buffer: memory: limit: 524288000 batch_policy: enabled: false count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `batch_policy` Optionally configure a policy to flush buffered messages in batches. **Type**: `object` ### `batch_policy.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batch_policy.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batch_policy.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batch_policy.enabled` Whether to batch messages as they are flushed. **Type**: `bool` **Default**: `false` ### `batch_policy.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batch_policy.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `limit` The maximum buffer size (in bytes) to allow before applying backpressure upstream. **Type**: `int` **Default**: `524288000` --- # Page 20: none **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/buffers/none.md --- # none Do not buffer messages. This is the default and most resilient configuration. Selecting no buffer means the output layer is directly coupled with the input layer. This is the safest and lowest latency option since acknowledgements from at-least-once protocols can be propagated all the way from the output protocol to the input protocol. If the output layer is hit with back pressure it will propagate all the way to the input layer, and further up the data stream. If you need to relieve your pipeline of this back pressure consider using a more robust buffering solution such as Kafka before resorting to alternatives. ## Common ```yml buffer: none: {} ``` ## Advanced ```yml buffer: none: {} ``` --- # Page 21: system_window **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/buffers/system_window.md --- # system_window > ⚠️ **CAUTION** > > This component is in beta. Its behavior might change in a future release. Chops a stream of messages into tumbling or sliding windows of fixed temporal size, following the system clock. A window is a grouping of messages that fit within a discrete measure of time following the system clock. Messages are allocated to a window either by the processing time (the time at which they’re ingested) or by the event time, and this is controlled via the [`timestamp_mapping` field](#timestamp_mapping). In tumbling mode (default) the beginning of a window immediately follows the end of a prior window. When the buffer is initialized the first window to be created and populated is aligned against the zeroth minute of the zeroth hour of the day by default, and may therefore be open for a shorter period than the specified size. A window is flushed only once the system clock surpasses its scheduled end. If an [`allowed_lateness`](#allowed_lateness) is specified then the window will not be flushed until the scheduled end plus that length of time. When a message is added to a window it has a metadata field `window_end_timestamp` added to it containing the timestamp of the end of the window as an RFC3339 string. ## Sliding windows Sliding windows begin from an offset of the prior windows' beginning rather than its end, and therefore messages may belong to multiple windows. In order to produce sliding windows specify a [`slide` duration](#slide). ## Back pressure If back pressure is applied to this buffer either due to output services being unavailable or resources being saturated, windows older than the current and last according to the system clock will be dropped in order to prevent unbounded resource usage. This means you should ensure that under the worst case scenario you have enough system memory to store two windows' worth of data at a given time (plus extra for redundancy and other services). If messages could potentially arrive with event timestamps in the future (according to the system clock) then you should also factor in these extra messages in memory usage estimates. ## Delivery guarantees This buffer honours the transaction model within Redpanda Connect in order to ensure that messages are not acknowledged until they are either intentionally dropped or successfully delivered to outputs. However, since messages belonging to an expired window are intentionally dropped there are circumstances where not all messages entering the system will be delivered. When this buffer is configured with a slide duration it is possible for messages to belong to multiple windows, and therefore be delivered multiple times. In this case the first time the message is delivered it will be acked (or nacked) and subsequent deliveries of the same message will be a "best attempt". During graceful termination if the current window is partially populated with messages they will be nacked such that they are re-consumed the next time the service starts. ### Common ```yml buffer: system_window: timestamp_mapping: root = now() size: "" # No default (required) slide: "" offset: "" allowed_lateness: "" ``` ### Advanced ```yml buffer: system_window: timestamp_mapping: root = now() size: "" # No default (required) slide: "" offset: "" allowed_lateness: "" ``` ## Examples ### Counting Passengers at Traffic Given a stream of messages relating to cars passing through various traffic lights of the form: ```json { "traffic_light": "cbf2eafc-806e-4067-9211-97be7e42cee3", "created_at": "2021-08-07T09:49:35Z", "registration_plate": "AB1C DEF", "passengers": 3 } ``` We can use a window buffer in order to create periodic messages summarizing the traffic for a period of time of this form: ```json { "traffic_light": "cbf2eafc-806e-4067-9211-97be7e42cee3", "created_at": "2021-08-07T10:00:00Z", "total_cars": 15, "passengers": 43 } ``` With the following config: ```yaml buffer: system_window: timestamp_mapping: root = this.created_at size: 1h pipeline: processors: # Group messages of the window into batches of common traffic light IDs - group_by_value: value: '${! json("traffic_light") }' # Reduce each batch to a single message by deleting indexes > 0, and # aggregate the car and passenger counts. - mapping: | root = if batch_index() == 0 { { "traffic_light": this.traffic_light, "created_at": meta("window_end_timestamp"), "total_cars": json("registration_plate").from_all().unique().length(), "passengers": json("passengers").from_all().sum(), } } else { deleted() } ``` ## Fields ### `allowed_lateness` An optional duration string describing the length of time to wait after a window has ended before flushing it, allowing late arrivals to be included. Since this windowing buffer uses the system clock an allowed lateness can improve the matching of messages when using event time. **Type**: `string` **Default**: `""` ```yaml # Examples: allowed_lateness: 10s # --- allowed_lateness: 1m ``` ### `offset` An optional duration string to offset the beginning of each window by, otherwise they are aligned to the zeroth minute and zeroth hour on the UTC clock. The offset cannot be a larger or equal measure to the window size or the slide. **Type**: `string` **Default**: `""` ```yaml # Examples: offset: -6h # --- offset: 30m ``` ### `size` A duration string describing the size of each window. By default windows are aligned to the zeroth minute and zeroth hour on the UTC clock, meaning windows of 1 hour duration will match the turn of each hour in the day, this can be adjusted with the `offset` field. **Type**: `string` ```yaml # Examples: size: 30s # --- size: 10m ``` ### `slide` An optional duration string describing by how much time the beginning of each window should be offset from the beginning of the previous, and therefore creates sliding windows instead of tumbling. When specified this duration must be smaller than the `size` of the window. **Type**: `string` **Default**: `""` ```yaml # Examples: slide: 30s # --- slide: 10m ``` ### `timestamp_mapping` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) applied to each message during ingestion that provides the timestamp to use for allocating it a window. By default the function `now()` is used in order to generate a fresh timestamp at the time of ingestion (the processing time), whereas this mapping can instead extract a timestamp from the message itself (the event time). The timestamp value assigned to `root` must either be a numerical unix time in seconds (with up to nanosecond precision via decimals), or a string in ISO 8601 format. If the mapping fails or provides an invalid result the message will be dropped (with logging to describe the problem). **Type**: `string` **Default**: `root = now()` ```yaml # Examples: timestamp_mapping: root = this.created_at # --- timestamp_mapping: root = meta("kafka_timestamp_unix").number() ``` --- # Page 22: Caches **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about.md --- # Caches A cache is a key/value store which can be used by certain components for applications such as deduplication or data joins. Caches are configured as a named resource: ```yaml cache_resources: - label: foobar memcached: addresses: - localhost:11211 default_ttl: 60s ``` > It’s possible to layer caches with read-through and write-through behavior using the [`multilevel` cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/multilevel/). And then any components that use caches have a field `resource` that specifies the cache resource: ```yaml pipeline: processors: - cache: resource: foobar operator: add key: '${! json("message.id") }' value: "storeme" - mapping: root = if errored() { deleted() } ``` For the simple case where you wish to store messages in a cache as an output destination for your pipeline check out the [`cache` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/cache/). To see examples of more advanced uses of caches such as hydration and deduplication check out the [`cache` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cache/). --- # Page 23: aws_dynamodb **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/aws_dynamodb.md --- # aws_dynamodb Stores key/value pairs as a single document in a DynamoDB table. The key is stored as a string value and used as the table hash key. The value is stored as a binary value using the `data_key` field name. A prefix can be specified to allow multiple cache types to share a single DynamoDB table. An optional TTL duration (`ttl`) and field (`ttl_key`) can be specified if the backing table has TTL enabled. Strong read consistency can be enabled using the `consistent_read` configuration field. #### Common ```yml cache: label: "" aws_dynamodb: table: "" # No default (required) hash_key: "" # No default (required) data_key: "" # No default (required) ``` #### Advanced ```yml cache: label: "" aws_dynamodb: table: "" # No default (required) hash_key: "" # No default (required) data_key: "" # No default (required) consistent_read: false default_ttl: "" # No default (optional) ttl_key: "" # No default (optional) retries: initial_interval: 1s max_interval: 5s max_elapsed_time: 30s region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) ``` ## Fields ### `consistent_read` Whether to use strongly consistent reads on Get commands. **Type**: `bool` **Default**: `false` ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `data_key` The key of the table column to store item values within. **Type**: `string` ### `default_ttl` An optional default TTL to set for items, calculated from the moment the item is cached. A `ttl_key` must be specified in order to set item TTLs. **Type**: `string` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `hash_key` The key of the table column to store item keys within. **Type**: `string` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `retries` Determine time intervals and cut offs for retry attempts. **Type**: `object` ### `retries.initial_interval` The initial period to wait between retry attempts. The retry interval increases for each failed attempt, up to the `max_interval` value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `1s` ```yaml # Examples: initial_interval: 50ms # --- initial_interval: 1s ``` ### `retries.max_elapsed_time` The maximum overall period of time to spend on retry attempts before the request is aborted. **Type**: `string` **Default**: `30s` ```yaml # Examples: max_elapsed_time: 1m # --- max_elapsed_time: 1h ``` ### `retries.max_interval` The maximum period to wait between retry attempts **Type**: `string` **Default**: `5s` ```yaml # Examples: max_interval: 5s # --- max_interval: 1m ``` ### `table` The table to store items in. **Type**: `string` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `ttl_key` The column key to place the TTL value within. The value is the expiry time as a Unix timestamp in seconds, stored as a number attribute, which is the format that DynamoDB TTL requires. A TTL value is only written when both this field and a TTL duration are set. **Type**: `string` --- # Page 24: aws_s3 **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/aws_s3.md --- # aws_s3 Stores each item in an S3 bucket as a file, where an item ID is the path of the item within the bucket. This cache implements the `add` operation as an existence check followed by a separate upload, so the operation is not atomic and concurrent writers can both succeed. Therefore, this cache is not suitable for deduplication. #### Common ```yml cache: label: "" aws_s3: bucket: "" # No default (required) content_type: application/octet-stream ``` #### Advanced ```yml cache: label: "" aws_s3: bucket: "" # No default (required) content_type: application/octet-stream force_path_style_urls: false retries: initial_interval: 1s max_interval: 5s max_elapsed_time: 30s region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) ``` It is not possible to atomically upload S3 objects exclusively when the target does not already exist, therefore this cache is not suitable for deduplication. ## Fields ### `bucket` The S3 bucket to store items in. **Type**: `string` ### `content_type` The content type to set for each item. **Type**: `string` **Default**: `application/octet-stream` ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `force_path_style_urls` Forces the client API to use path style URLs, which helps when connecting to custom endpoints. **Type**: `bool` **Default**: `false` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `retries` Determine time intervals and cut offs for retry attempts. **Type**: `object` ### `retries.initial_interval` The initial period to wait between retry attempts. The retry interval increases for each failed attempt, up to the `max_interval` value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `1s` ```yaml # Examples: initial_interval: 50ms # --- initial_interval: 1s ``` ### `retries.max_elapsed_time` The maximum overall period of time to spend on retry attempts before the request is aborted. **Type**: `string` **Default**: `30s` ```yaml # Examples: max_elapsed_time: 1m # --- max_elapsed_time: 1h ``` ### `retries.max_interval` The maximum period to wait between retry attempts **Type**: `string` **Default**: `5s` ```yaml # Examples: max_interval: 5s # --- max_interval: 1m ``` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` --- # Page 25: gcp_cloud_storage **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/gcp_cloud_storage.md --- # gcp_cloud_storage Use a Google Cloud Storage bucket as a cache. This cache implements the `add` operation as an existence check followed by a separate upload, so the operation is not atomic and concurrent writers can both succeed. Therefore, this cache is not suitable for deduplication. ```yml cache: label: "" gcp_cloud_storage: bucket: "" # No default (required) content_type: "" # No default (optional) credentials_json: "" ``` ## Fields ### `bucket` The Google Cloud Storage bucket to store items in. **Type**: `string` ### `content_type` Optional field to explicitly set the Content-Type. **Type**: `string` ### `credentials_json` An optional field to set Google Service Account Credentials json. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` --- # Page 26: lru **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/lru.md --- # lru Stores key/value pairs in a lru in-memory cache. This cache is therefore reset every time the service restarts. This provides the lru package which implements a fixed-size thread safe LRU cache. It uses the package [`lru`](https://pkg.go.dev/github.com/hashicorp/golang-lru/v2) The field init_values can be used to pre-populate the memory cache with any number of key/value pairs: ```yaml cache_resources: - label: foocache lru: cap: 1024 init_values: foo: bar ``` These values can be overridden during execution. #### Common ```yml cache: label: "" lru: cap: 1000 init_values: {} ``` #### Advanced ```yml cache: label: "" lru: cap: 1000 init_values: {} algorithm: standard two_queues_recent_ratio: 0.25 two_queues_ghost_ratio: 0.5 optimistic: false ``` ## Fields ### `algorithm` the lru cache implementation **Type**: `string` **Default**: `standard` | Option | Summary | | --- | --- | | `arc` | is an adaptive replacement cache. It tracks recent evictions as well as recent usage in both the frequent and recent caches. Its computational overhead is comparable to two_queues, but the memory overhead is linear with the size of the cache. ARC has been patented by IBM. | | `standard` | is a simple LRU cache. It is based on the LRU implementation in groupcache | | `two_queues` | tracks frequently used and recently used entries separately. This avoids a burst of accesses from taking out frequently used entries, at the cost of about 2x computational overhead and some extra bookkeeping. | ### `cap` The cache maximum capacity (number of entries) **Type**: `int` **Default**: `1000` ### `init_values` A table of key/value pairs that should be present in the cache on initialization. This can be used to create static lookup tables. **Type**: `object` **Default**: `{}` ```yaml # Examples: init_values: Nickelback: "1995" Spice Girls: "1994" The Human League: "1977" ``` ### `optimistic` If true, we do not lock on read/write events. The lru package is thread-safe, however the ADD operation is not atomic. **Type**: `bool` **Default**: `false` ### `two_queues_ghost_ratio` is the default ratio of ghost entries kept to track entries recently evicted on two_queues cache. **Type**: `float` **Default**: `0.5` ### `two_queues_recent_ratio` is the ratio of the two_queues cache dedicated to recently added entries that have only been accessed once. **Type**: `float` **Default**: `0.25` --- # Page 27: memcached **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/memcached.md --- # memcached Connects to a cluster of memcached services, a prefix can be specified to allow multiple cache types to share a memcached cluster under different namespaces. #### Common ```yml cache: label: "" memcached: addresses: [] # No default (required) prefix: "" # No default (optional) default_ttl: 300s ``` #### Advanced ```yml cache: label: "" memcached: addresses: [] # No default (required) prefix: "" # No default (optional) default_ttl: 300s retries: initial_interval: 1s max_interval: 5s max_elapsed_time: 30s ``` ## Fields ### `addresses[]` A list of addresses of memcached servers to use. **Type**: `array` ### `default_ttl` The expiration applied to items that are written without a TTL of their own. Memcached expirations have a resolution of one second, so any fraction of a second is dropped. **Type**: `string` **Default**: `300s` ### `prefix` An optional string prepended to every item key, so that multiple caches can share one memcached cluster under different namespaces. **Type**: `string` ### `retries` Determine time intervals and cut offs for retry attempts. **Type**: `object` ### `retries.initial_interval` The initial period to wait between retry attempts. The retry interval increases for each failed attempt, up to the `max_interval` value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `1s` ```yaml # Examples: initial_interval: 50ms # --- initial_interval: 1s ``` ### `retries.max_elapsed_time` The maximum overall period of time to spend on retry attempts before the request is aborted. **Type**: `string` **Default**: `30s` ```yaml # Examples: max_elapsed_time: 1m # --- max_elapsed_time: 1h ``` ### `retries.max_interval` The maximum period to wait between retry attempts **Type**: `string` **Default**: `5s` ```yaml # Examples: max_interval: 5s # --- max_interval: 1m ``` --- # Page 28: memory **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/memory.md --- # memory Stores key/value pairs in a map held in memory. This cache is therefore reset every time the service restarts. Each item in the cache has a TTL set from the moment it was last edited, after which it will be removed during the next compaction. The compaction interval determines how often the cache is cleared of expired items, and this process is only triggered on writes to the cache. Access to the cache is blocked during this process. Item expiry can be disabled entirely by setting the `compaction_interval` to an empty string. The field `init_values` can be used to prepopulate the memory cache with any number of key/value pairs which are exempt from TTLs: ```yaml cache_resources: - label: foocache memory: default_ttl: 60s init_values: foo: bar ``` These values can be overridden during execution, at which point the configured TTL is respected as usual. #### Common ```yml cache: label: "" memory: default_ttl: 5m compaction_interval: 60s init_values: {} ``` #### Advanced ```yml cache: label: "" memory: default_ttl: 5m compaction_interval: 60s init_values: {} shards: 1 ``` ## Fields ### `compaction_interval` The period of time to wait before each compaction, at which point expired items are removed. This field can be set to an empty string in order to disable compactions/expiry entirely. **Type**: `string` **Default**: `60s` ### `default_ttl` The default TTL of each item. After this period an item will be eligible for removal during the next compaction. **Type**: `string` **Default**: `5m` ### `init_values` A table of key/value pairs that should be present in the cache on initialization. This can be used to create static lookup tables. **Type**: `object` **Default**: `{}` ```yaml # Examples: init_values: Nickelback: "1995" Spice Girls: "1994" The Human League: "1977" ``` ### `shards` A number of logical shards to spread keys across, increasing the shards can have a performance benefit when processing a large number of keys. **Type**: `int` **Default**: `1` --- # Page 29: mongodb **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/mongodb.md --- # mongodb Use a MongoDB instance as a cache. > 📝 **NOTE** > > If the service only accepts connections from allowlisted IP addresses, add your cluster’s egress addresses to its allowlist before you deploy the pipeline. On BYOC clusters, see [Allow Pipeline Traffic Through External Firewalls](https://docs.redpanda.com/cloud-data-platform/networking/connect-external-allowlist/) to find the addresses. For Dedicated or Serverless clusters, contact Redpanda support for the addresses. #### Common ```yml cache: label: "" mongodb: url: "" # No default (required) database: "" # No default (required) username: "" password: "" collection: "" # No default (required) key_field: "" # No default (required) value_field: "" # No default (required) ``` #### Advanced ```yml cache: label: "" mongodb: url: "" # No default (required) database: "" # No default (required) username: "" password: "" app_name: benthos aws: enabled: false region: "" # No default (optional) session_duration: 1h id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) roles: [] # No default (optional) collection: "" # No default (required) key_field: "" # No default (required) value_field: "" # No default (required) ``` ## Fields ### `app_name` The client application name. **Type**: `string` **Default**: `benthos` ### `aws` AWS IAM authentication using the `MONGODB-AWS` mechanism, for example against MongoDB Atlas. When enabled, IAM credentials are used instead of a static username and password. Role-derived session credentials are resolved when the component connects and are re-resolved whenever it reconnects. The `mongodb` processor and cache establish their client once at creation and cannot refresh expiring session credentials, so `role`, `roles` and session tokens are rejected for those components; use the ambient credential chain or long-lived access keys with them. For long-running pipelines, prefer the ambient credential chain (leave keys and roles unset), which the driver refreshes automatically. **Type**: `object` ### `aws.enabled` Enable AWS IAM authentication using the driver-native `MONGODB-AWS` mechanism. The MongoDB Atlas database user must be created with the AWS IAM authentication type, and connections require TLS. When no static credentials or roles are configured, the ambient AWS credential chain (environment variables, EC2 instance profile, EKS pod role) is used and expiring credentials are refreshed automatically. **Type**: `bool` **Default**: `false` ### `aws.id` The AWS access key ID to authenticate with. When empty, the default AWS credential chain is used. **Type**: `string` ### `aws.region` The AWS region used when assuming roles (for STS calls). Only used when `role` or `roles` are configured; the ambient and static-key paths ignore it. If no region is specified then the environment default is used. **Type**: `string` ### `aws.role` Optional AWS IAM role ARN to assume for authentication. Cannot be combined with `roles`; use the `roles` array instead when chaining multiple roles. **Type**: `string` ### `aws.role_external_id` Optional external ID to use when assuming the role set in `role`. Each entry in `roles` sets its own external ID. **Type**: `string` ### `aws.roles[]` Optional array of AWS IAM roles to assume for authentication. Roles are assumed in sequence, each using the credentials of the previous one, enabling chaining for purposes such as cross-account access. Each role can optionally specify an external ID. Cannot be combined with `role`. **Type**: `array` ### `aws.roles[].role` AWS IAM role ARN to assume. **Type**: `string` **Default**: `""` ### `aws.roles[].role_external_id` Optional external ID for the role assumption. **Type**: `string` **Default**: `""` ### `aws.secret` The AWS secret access key that pairs with `id`. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `aws.session_duration` The duration of the STS session requested when assuming roles. AWS requires at least 15 minutes and caps sessions created through role chaining at one hour. Only used when `role` or `roles` are configured. For long-running pipelines, prefer the ambient credential chain over a fixed session duration, since the driver refreshes ambient credentials automatically as they near expiry. **Type**: `string` **Default**: `1h` ### `aws.token` The AWS session token to use with `id` and `secret`. Required only when using short-term credentials. **Type**: `string` ### `collection` The name of the target collection. **Type**: `string` ### `database` The name of the target MongoDB database. **Type**: `string` ### `key_field` The field in the document that is used as the key. **Type**: `string` ### `password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `url` The URL of the target MongoDB server. **Type**: `string` ```yaml # Examples: url: mongodb://localhost:27017 ``` ### `username` The username to connect to the database. **Type**: `string` **Default**: `""` ### `value_field` The field in the document that is used as the value. **Type**: `string` --- # Page 30: multilevel **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/multilevel.md --- # multilevel Combines multiple caches as levels, performing read-through and write-through operations across them. ```yml cache: label: "" multilevel: [] ``` ## Examples ### Hot and cold cache The multilevel cache is useful for reducing traffic against a remote cache by routing it through a local cache. In the following example requests will only go through to the memcached server if the local memory cache is missing the key. ```yaml pipeline: processors: - branch: processors: - cache: resource: leveled operator: get key: ${! json("key") } - catch: - mapping: 'root = {"err":error()}' result_map: 'root.result = this' cache_resources: - label: leveled multilevel: [ hot, cold ] - label: hot memory: default_ttl: 60s - label: cold memcached: addresses: [ TODO:11211 ] default_ttl: 60s ``` --- # Page 31: nats_kv **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/nats_kv.md --- # nats_kv Caches key/value pairs in a NATS key-value bucket. ## Connection name When monitoring and managing a production [NATS system](https://docs.nats.io/nats-concepts/overview), it is often useful to know which connection a message was sent or received from. This can be achieved by setting the connection name option when creating a NATS connection. Redpanda Connect will automatically set the connection name based off the label of the given NATS component, so that monitoring tools between NATS and Redpanda Connect can stay in sync. ## Authentication There are several components within Redpanda Connect which uses NATS services. You will find that each of these components support optional advanced authentication parameters for [NKeys](https://docs.nats.io/nats-server/configuration/securing_nats/auth_intro/nkey_auth) and [User Credentials](https://docs.nats.io/using-nats/developer/connecting/creds). See an [in-depth tutorial](https://docs.nats.io/running-a-nats-service/nats_admin/security/jwt). ### NKey file The NATS server can use these NKeys in several ways for authentication. The simplest is for the server to be configured with a list of known public keys. The server then generates a challenge for each connection request from a client, and the client must respond to the challenge by signing it with its private NKey configured in the `nkey_file` or `nkey` field. [More details](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth). ### User credentials NATS server supports decentralized authentication based on JSON Web Tokens (JWT). Clients need an [user JWT](https://docs.nats.io/nats-server/configuration/securing_nats/jwt#json-web-tokens) and a corresponding [NKey secret](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth) when connecting to a server which is configured to use this authentication scheme. The `user_credentials_file` field should point to a file containing both the private key and the JWT and can be generated with the [nsc tool](https://docs.nats.io/nats-tools/nsc). Alternatively, the `user_jwt` field can contain a plain text JWT and the `user_nkey_seed` field can contain the plain text NKey Seed. [More details](https://docs.nats.io/using-nats/developer/connecting/creds). ### Token The `token` field can contain a plain text token string for [token-based authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/tokens). ### User and password The `user` and `password` fields can be used for [username/password authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/username_password). #### Common ```yml cache: label: "" nats_kv: urls: [] # No default (required) bucket: "" # No default (required) ``` #### Advanced ```yml cache: label: "" nats_kv: urls: [] # No default (required) max_reconnects: 0 # No default (optional) bucket: "" # No default (required) tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] tls_handshake_first: false auth: nkey_file: "" # No default (optional) nkey: "" # No default (optional) user_credentials_file: "" # No default (optional) user_jwt: "" # No default (optional) user_nkey_seed: "" # No default (optional) user: "" # No default (optional) password: "" # No default (optional) token: "" # No default (optional) ``` ## Fields ### `auth` Optional configuration of NATS authentication parameters. **Type**: `object` ### `auth.nkey` Your NKey seed (private key) for NATS authentication. NKeys provide cryptographic authentication without passwords. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: nkey: UDXU4RCSJNZOIQHZNWXHXORDPRTGNJAHAHFRGZNEEJCPQTT2M7NLCNF4 ``` ### `auth.nkey_file` An optional file containing a NKey seed. **Type**: `string` ```yaml # Examples: nkey_file: ./seed.nk ``` ### `auth.password` An optional plain text password (given along with the corresponding user name). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.token` An optional plain text token. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user` An optional plain text user name (given along with the corresponding user password). **Type**: `string` ### `auth.user_credentials_file` An optional file containing user credentials which consist of a user JWT and corresponding NKey seed. **Type**: `string` ```yaml # Examples: user_credentials_file: ./user.creds ``` ### `auth.user_jwt` An optional plaintext user JWT to use along with the corresponding user NKey seed. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user_nkey_seed` An optional plaintext user NKey seed to use along with the corresponding user JWT. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `bucket` The name of the KV bucket. **Type**: `string` ```yaml # Examples: bucket: my_kv_bucket ``` ### `max_reconnects` The maximum number of times to attempt to reconnect to the server. If negative, it will never stop trying to reconnect. **Type**: `int` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `tls_handshake_first` Whether to perform the initial TLS handshake before sending the NATS INFO protocol message. This is required when connecting to some NATS servers that expect TLS to be established immediately after connection, before any protocol negotiation. **Type**: `bool` **Default**: `false` ### `urls[]` A list of URLs to connect to. If a list item contains commas, it will be expanded into multiple URLs. **Type**: `array` ```yaml # Examples: urls: - "nats://127.0.0.1:4222" # --- urls: - "nats://username:password@127.0.0.1:4222" ``` --- # Page 32: noop **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/noop.md --- # noop Noop is a cache that stores nothing, all gets returns not found. Why? Sometimes doing nothing is the braver option. ```yml cache: label: "" noop: {} ``` --- # Page 33: redis **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/redis.md --- # redis Use a Redis instance as a cache. The expiration can be set to zero or an empty string in order to set no expiration. #### Common ```yml cache: label: "" redis: url: "" # No default (required) prefix: "" # No default (optional) ``` #### Advanced ```yml cache: label: "" redis: url: "" # No default (required) kind: simple master: "" client_name: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] prefix: "" # No default (optional) default_ttl: "" # No default (optional) retries: initial_interval: 500ms max_interval: 1s max_elapsed_time: 5s ``` ## Fields ### `client_name` Set the client name for the Redis connection. **Type**: `string` **Default**: `redpanda-connect` ### `default_ttl` An optional expiration applied to keys that are written without a TTL of their own. When unset or zero, such keys never expire. **Type**: `string` ### `kind` Specifies a simple, cluster-aware, or failover-aware redis client. **Type**: `string` **Default**: `simple` **Options**: `simple`, `cluster`, `failover` ### `master` Name of the redis master when `kind` is `failover` **Type**: `string` **Default**: `""` ```yaml # Examples: master: mymaster ``` ### `prefix` An optional string added to the start of every key that this cache reads, writes, or deletes, which keeps its keys separate from other data in the same Redis database. **Type**: `string` ### `retries` Determine time intervals and cut offs for retry attempts. **Type**: `object` ### `retries.initial_interval` The initial period to wait between retry attempts. The retry interval increases for each failed attempt, up to the `max_interval` value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `500ms` ```yaml # Examples: initial_interval: 50ms # --- initial_interval: 1s ``` ### `retries.max_elapsed_time` The maximum overall period of time to spend on retry attempts before the request is aborted. **Type**: `string` **Default**: `5s` ```yaml # Examples: max_elapsed_time: 1m # --- max_elapsed_time: 1h ``` ### `retries.max_interval` The maximum period to wait between retry attempts **Type**: `string` **Default**: `1s` ```yaml # Examples: max_interval: 5s # --- max_interval: 1m ``` ### `tls` Custom TLS settings can be used to override system defaults. **Troubleshooting** Some cloud hosted instances of Redis (such as Azure Cache) might need some hand holding in order to establish stable connections. Unfortunately, it is often the case that TLS issues will manifest as generic error messages such as "i/o timeout". If you’re using TLS and are seeing connectivity problems consider setting `enable_renegotiation` to `true`, and ensuring that the server supports at least TLS version 1.2. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL of the target Redis server. Database is optional and is supplied as the URL path. **Type**: `string` ```yaml # Examples: url: redis://:6379 # --- url: redis://localhost:6379 # --- url: redis://foousername:foopassword@redisplace:6379 # --- url: redis://:foopassword@redisplace:6379 # --- url: redis://localhost:6379/1 # --- url: redis://localhost:6379/1,redis://localhost:6380/1 ``` --- # Page 34: redpanda **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/redpanda.md --- # redpanda A Kafka cache implemented using the [Franz Kafka client library](https://github.com/twmb/franz-go). A cache that stores data in a Kafka topic. This cache is useful for data that is written frequently and queried infrequently. Reads from the cache require scanning the entire topic partition. If you expect frequent access, consider placing an in-memory caching layer in front of this one. Because only the latest values are needed, configure compaction for topics used as caches so that reads are less expensive when topics are rescanned. See [Compaction settings](https://docs.redpanda.com/streaming/current/manage/cluster-maintenance/compaction-settings/). The cache does not have any time-to-live (TTL) mechanism. Use the Kafka topic retention policies to manage TTL. #### Common ```yaml cache: label: "" redpanda: seed_brokers: [] # No default (required) topic: "" # No default (required) ``` #### Advanced ```yaml cache: label: "" redpanda: seed_brokers: [] # No default (required) client_id: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] sasl: [] # No default (optional) metadata_max_age: 1m request_timeout_overhead: 10s conn_idle_timeout: 20s tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s topic: "" # No default (required) allow_auto_topic_creation: true ``` ## Fields ### `allow_auto_topic_creation` Enables topics to be auto created if they do not exist when fetching their metadata. **Type**: `bool` **Default**: `true` ### `client_id` An identifier for the client connection. This identifier appears in broker logs and metrics, which helps you identify the Redpanda Connect instance that is connecting. **Type**: `string` **Default**: `redpanda-connect` ### `conn_idle_timeout` The approximate amount of time that connections can remain idle before they are closed. In the worst case, a connection can stay idle for up to twice this value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `20s` ### `metadata_max_age` The maximum period of time after which metadata is refreshed. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Lower values provide more responsive topic and partition discovery but may increase broker load. Higher values reduce broker queries but can delay detection of topology changes. This interval also controls how frequently regex topic patterns are re-evaluated to discover new matching topics. **Type**: `string` **Default**: `1m` ### `request_timeout_overhead` Additional time to apply as overhead when calculating request deadlines. For most requests, the deadline is this overhead alone. For requests that define their own timeout field, the overhead is added on top of that timeout, which helps prevent premature timeouts. This field is roughly equivalent to Apache Kafka’s `request.timeout.ms` parameter, but grants extra time to requests that have timeout fields. **Type**: `string` **Default**: `10s` ### `sasl[]` Specify one or more methods or mechanisms of SASL authentication. They are tried in order. If the broker supports the first SASL mechanism, all connections use it. If the first mechanism fails, the client picks the first supported mechanism. If the broker does not support any client mechanisms, all connections fail. **Type**: `array` ```yaml # Examples: sasl: - mechanism: SCRAM-SHA-512 password: bar username: foo ``` ### `sasl[].aws` Contains AWS-specific fields for when `sasl.mechanism` is set to `AWS_MSK_IAM`. **Type**: `object` ### `sasl[].aws.credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `sasl[].aws.credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `sasl[].aws.credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `sasl[].aws.credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `sasl[].aws.credentials.role` The ARN of the role to assume. **Type**: `string` ### `sasl[].aws.credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `sasl[].aws.credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `sasl[].aws.credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `sasl[].aws.endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `sasl[].aws.region` The AWS region in which your resources are hosted. **Type**: `string` ### `sasl[].aws.tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `sasl[].aws.tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].aws.tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `sasl[].aws.tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `sasl[].aws.tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].extensions` Key/value pairs to add to OAUTHBEARER authentication requests. **Type**: `object` ### `sasl[].mechanism` The SASL mechanism to use for authentication. **Type**: `string` | Option | Summary | | --- | --- | | `AWS_MSK_IAM` | AWS IAM based authentication as specified by the 'aws-msk-iam-auth' java library. | | `OAUTHBEARER` | OAuth Bearer based authentication. | | `PLAIN` | Plain text authentication. | | `REDPANDA_CLOUD_SERVICE_ACCOUNT` | Redpanda Cloud Service Account authentication when running in Redpanda Cloud. | | `SCRAM-SHA-256` | SCRAM based authentication as specified in RFC5802. | | `SCRAM-SHA-512` | SCRAM based authentication as specified in RFC5802. | | `none` | Disable sasl authentication | ### `sasl[].password` The password to use for PLAIN or SCRAM-* authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `sasl[].token` The token to use for a single session’s OAUTHBEARER authentication. **Type**: `string` **Default**: `""` ### `sasl[].username` The username to use for PLAIN or SCRAM-* authentication. **Type**: `string` **Default**: `""` ### `seed_brokers[]` A list of broker addresses used to establish connections. If an item of the list contains commas, it is expanded into multiple addresses. **Type**: `array` ```yaml # Examples: seed_brokers: - "localhost:9092" # --- seed_brokers: - "foo:9092" - "bar:9092" # --- seed_brokers: - "foo:9092,bar:9092" ``` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `topic` The topic to store data in. **Type**: `string` --- # Page 35: ristretto **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/ristretto.md --- # ristretto Stores key/value pairs in a map held in the memory-bound [Ristretto cache](https://github.com/dgraph-io/ristretto). This cache is more efficient and appropriate for high-volume use cases than the standard memory cache. However, the add command is non-atomic, and therefore this cache is not suitable for deduplication. #### Common ```yml cache: label: "" ristretto: default_ttl: "" ``` #### Advanced ```yml cache: label: "" ristretto: default_ttl: "" get_retries: enabled: false initial_interval: 1s max_interval: 5s max_elapsed_time: 30s ``` ## Fields ### `default_ttl` A default TTL to set for items, calculated from the moment the item is cached. Set to an empty string or zero duration to disable TTLs. **Type**: `string` **Default**: `""` ```yaml # Examples: default_ttl: 5m # --- default_ttl: 60s ``` ### `get_retries` Determines how and whether get attempts should be retried if the key is not found. Ristretto is a concurrent cache that does not immediately reflect writes, and so it can sometimes be useful to enable retries at the cost of speed in cases where the key is expected to exist. **Type**: `object` ### `get_retries.enabled` Whether retries should be enabled. **Type**: `bool` **Default**: `false` ### `get_retries.initial_interval` The initial period to wait between retry attempts. **Type**: `string` **Default**: `1s` ```yaml # Examples: initial_interval: 50ms # --- initial_interval: 1s ``` ### `get_retries.max_elapsed_time` The maximum overall period of time to spend on retry attempts before the request is aborted. **Type**: `string` **Default**: `30s` ```yaml # Examples: max_elapsed_time: 1m # --- max_elapsed_time: 1h ``` ### `get_retries.max_interval` The maximum period to wait between retry attempts **Type**: `string` **Default**: `5s` ```yaml # Examples: max_interval: 5s # --- max_interval: 1m ``` --- # Page 36: sql **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/sql.md --- # sql Uses an SQL database table as a destination for storing cache key/value items. Each cache key/value pair will exist as a row within the specified table. Currently only the key and value columns are set, and therefore any other columns present within the target table must allow NULL values if this cache is going to be used for set and add operations. Cache operations are translated into SQL statements as follows: ## Get All `get` operations are performed with a traditional `select` statement. ## Delete All `delete` operations are performed with a traditional `delete` statement. ## Set The `set` operation is performed with a traditional `insert` statement. This will behave as an `add` operation by default, and so ideally needs to be adapted in order to provide updates instead of failing on collision s. Since different SQL engines implement upserts differently it is necessary to specify a `set_suffix` that modifies an `insert` statement in order to perform updates on conflict. ## Add The `add` operation is performed with a traditional `insert` statement. ### Common ```yml cache: label: "" sql: driver: mysql # No default (required) dsn: "" # No default (required) table: "" # No default (required) key_column: "" # No default (required) value_column: "" # No default (required) set_suffix: "" # No default (optional) ``` ### Advanced ```yml cache: label: "" sql: driver: mysql # No default (required) dsn: "" # No default (required) table: "" # No default (required) key_column: "" # No default (required) value_column: "" # No default (required) set_suffix: "" # No default (optional) init_files: [] # No default (optional) init_statement: "" # No default (optional) conn_max_idle_time: "" # No default (optional) conn_max_life_time: "" # No default (optional) conn_max_idle: 2 conn_max_open: 0 # No default (optional) ``` ## Fields ### `conn_max_idle` An optional maximum number of connections in the idle connection pool. If conn_max_open is greater than 0 but less than the new conn_max_idle, then the new conn_max_idle will be reduced to match the conn_max_open limit. If `value ⇐ 0`, no idle connections are retained. The default max idle connections is currently 2. This may change in a future release. **Type**: `int` **Default**: `2` ### `conn_max_idle_time` An optional maximum amount of time a connection may be idle. Expired connections may be closed lazily before reuse. If `value ⇐ 0`, connections are not closed due to a connections idle time. **Type**: `string` ### `conn_max_life_time` An optional maximum amount of time a connection may be reused. Expired connections may be closed lazily before reuse. If `value ⇐ 0`, connections are not closed due to a connections age. **Type**: `string` ### `conn_max_open` An optional maximum number of open connections to the database. If conn_max_idle is greater than 0 and the new conn_max_open is less than conn_max_idle, then conn_max_idle will be reduced to match the new conn_max_open limit. If `value ⇐ 0`, then there is no limit on the number of open connections. The default is 0 (unlimited). **Type**: `int` ### `driver` The database driver to use. **Type**: `string` **Options**: `mysql`, `postgres`, `pgx`, `clickhouse`, `mssql`, `sqlite`, `oracle`, `snowflake`, `trino`, `gocosmos`, `spanner`, `databricks`, `hana` ### `dsn` A Data Source Name to identify the target database. #### Drivers The following table lists the supported drivers and their DSN formats: | Driver | Data Source Name Format | | --- | --- | | `clickhouse` | [`clickhouse://[username[:password]@][netloc][:port]/dbname[?param1=value1&…​¶mN=valueN]`](https://github.com/ClickHouse/clickhouse-go#dsn) | | `mysql` | `[username[:password]@][protocol[(address)]]/dbname[?param1=value1&…​¶mN=valueN]` | | `postgres` and `pgx` | `postgres://[user[:password]@][netloc][:port][/dbname][?param1=value1&…​]` | | `mssql` | `sqlserver://[user[:password]@][netloc][:port][?database=dbname¶m1=value1&…​]` | | `sqlite` | `file:/path/to/filename.db[?param&=value1&…​]` | | `oracle` | `oracle://[username[:password]@][netloc][:port]/service_name?server=server2&server=server3` | | `snowflake` | `username[:password]@account_identifier/dbname/schemaname[?param1=value&…​¶mN=valueN]` | | `trino` | [`http[s]://user[:pass]@host[:port][?parameters]`](https://github.com/trinodb/trino-go-client#dsn-data-source-name) | | `gocosmos` | [`AccountEndpoint=;AccountKey=[;TimeoutMs=][;Version=][;DefaultDb/Db=][;AutoId=][;InsecureSkipVerify=]`](https://pkg.go.dev/github.com/microsoft/gocosmos#readme-example-usage) | | `spanner` | projects/\[PROJECT\]/instances/\[INSTANCE\]/databases/\[DATABASE\] | | `databricks` | `token:@:/` | | `hana` | `hdb://[user[:password]@]host[:port][?param1=value1&…​]` | Please note that the `postgres` and `pgx` drivers enforce SSL by default, you can override this with the parameter `sslmode=disable` if required. The `pgx` driver is an alternative to the standard `postgres` (pq) driver and comes with extra functionality such as support for array insertion. The `snowflake` driver supports multiple DSN formats. Please consult [the docs](https://pkg.go.dev/github.com/snowflakedb/gosnowflake/v2#hdr-Connection_String) for more details. For [key pair authentication](https://docs.snowflake.com/en/user-guide/key-pair-auth.html#configuring-key-pair-authentication), the DSN has the following format: `@//?warehouse=&role=&authenticator=snowflake_jwt&privateKey=`, where the value for the `privateKey` parameter can be constructed from an unencrypted RSA private key file `rsa_key.p8` using `openssl enc -d -base64 -in rsa_key.p8 | basenc --base64url -w0` (you can use `gbasenc` instead of `basenc` on OSX if you install `coreutils` via Homebrew). If you have a password-encrypted private key, you can decrypt it using `openssl pkcs8 -in rsa_key_encrypted.p8 -out rsa_key.p8`. Also, make sure fields such as the username are URL-encoded. The [`gocosmos`](https://pkg.go.dev/github.com/microsoft/gocosmos) driver is still experimental, but it has support for [hierarchical partition keys](https://learn.microsoft.com/en-us/azure/cosmos-db/hierarchical-partition-keys) as well as [cross-partition queries](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-query-container#cross-partition-query). Please refer to the [SQL notes](https://github.com/microsoft/gocosmos/blob/main/SQL.md) for details. **Type**: `string` ```yaml # Examples: dsn: clickhouse://username:password@host1:9000,host2:9000/database?dial_timeout=200ms&max_execution_time=60 # --- dsn: foouser:foopassword@tcp(localhost:3306)/foodb # --- dsn: postgres://foouser:foopass@localhost:5432/foodb?sslmode=disable # --- dsn: oracle://foouser:foopass@localhost:1521/service_name # --- dsn: token:dapi1234567890ab@dbc-a1b2345c-d6e7.cloud.databricks.com:443/sql/1.0/warehouses/abc123def456 ``` ### `init_files[]` An optional list of file paths containing SQL statements to execute immediately upon the first connection to the target database. This is a useful way to initialise tables before processing data. Glob patterns are supported, including super globs (double star). Care should be taken to ensure that the statements are idempotent, and therefore would not cause issues when run multiple times after service restarts. If both `init_statement` and `init_files` are specified the `init_statement` is executed _after_ the `init_files`. If a statement fails for any reason a warning log will be emitted but the operation of this component will not be stopped. **Type**: `array` ```yaml # Examples: init_files: - ./init/*.sql # --- init_files: - ./foo.sql - ./bar.sql ``` ### `init_statement` An optional SQL statement to execute immediately upon the first connection to the target database. This is a useful way to initialise tables before processing data. Care should be taken to ensure that the statement is idempotent, and therefore would not cause issues when run multiple times after service restarts. If both `init_statement` and `init_files` are specified the `init_statement` is executed _after_ the `init_files`. If the statement fails for any reason a warning log will be emitted but the operation of this component will not be stopped. **Type**: `string` ```yaml # Examples: init_statement: | CREATE TABLE IF NOT EXISTS some_table ( foo varchar(50) not null, bar integer, baz varchar(50), primary key (foo) ) WITHOUT ROWID; ``` ### `key_column` The name of a column to be used for storing cache item keys. This column should support strings of arbitrary size. **Type**: `string` ```yaml # Examples: key_column: foo ``` ### `set_suffix` An optional suffix to append to each insert query for a cache `set` operation. This should modify an insert statement into an upsert appropriate for the given SQL engine. **Type**: `string` ```yaml # Examples: set_suffix: ON DUPLICATE KEY UPDATE bar=VALUES(bar) # --- set_suffix: ON CONFLICT (foo) DO UPDATE SET bar=excluded.bar # --- set_suffix: ON CONFLICT (foo) DO NOTHING ``` ### `table` The table to insert/read/delete cache items. **Type**: `string` ```yaml # Examples: table: foo ``` ### `value_column` The name of a column to be used for storing cache item values. This column should support strings of arbitrary size. **Type**: `string` ```yaml # Examples: value_column: bar ``` --- # Page 37: ttlru **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/ttlru.md --- # ttlru Stores key/value pairs in a ttlru in-memory cache. This cache is therefore reset every time the service restarts. The cache ttlru provides a simple, goroutine safe, cache with a fixed number of entries. Each entry has a per-cache defined TTL. This TTL is reset on both modification and access of the value. As a result, if the cache is full, and no items have expired, when adding a new item, the item with the soonest expiration will be evicted. It uses the package [`expirable`](https://pkg.go.dev/github.com/hashicorp/golang-lru/v2/expirable) The field init_values can be used to pre-populate the memory cache with any number of key/value pairs: ```yaml cache_resources: - label: foocache ttlru: default_ttl: '5m' cap: 1024 init_values: foo: bar ``` These values can be overridden during execution. #### Common ```yml cache: label: "" ttlru: cap: 1024 default_ttl: 5m0s init_values: {} ``` #### Advanced ```yml cache: label: "" ttlru: cap: 1024 default_ttl: 5m0s ttl: "" # No default (optional) init_values: {} optimistic: false ``` ## Fields ### `cap` The cache maximum capacity (number of entries) **Type**: `int` **Default**: `1024` ### `default_ttl` The cache ttl of each element **Type**: `string` **Default**: `5m0s` ### `init_values` A table of key/value pairs that should be present in the cache on initialization. This can be used to create static lookup tables. **Type**: `object` **Default**: `{}` ```yaml # Examples: init_values: Nickelback: "1995" Spice Girls: "1994" The Human League: "1977" ``` ### `optimistic` If true, we do not lock on read/write events. The ttlru package is thread-safe, however the ADD operation is not atomic. **Type**: `bool` **Default**: `false` ### `ttl` Deprecated. Please use `default_ttl` field **Type**: `string` --- # Page 38: Inputs **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/about.md --- # Inputs An input is a source of data piped through an array of optional [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/): ```yaml input: label: my_redis_input redis_streams: url: tcp://localhost:6379 streams: - benthos_stream body_key: body consumer_group: benthos_group # Optional list of processing steps processors: - mapping: | root.document = this.without("links") root.link_count = this.links.length() ``` Some inputs have a logical end, when this happens the input gracefully terminates and Redpanda Connect will shut itself down once all messages have been processed fully. It’s also possible to specify a logical end for an input that otherwise doesn’t have one with the [`read_until` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/read_until/), which checks a condition against each consumed message in order to determine whether it should be the last. ## Brokering Only one input is configured at the root of a Redpanda Connect config. However, the root input can be a [broker](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/broker/) which combines multiple inputs and merges the streams: ```yaml input: broker: inputs: - kafka: addresses: [ TODO ] topics: [ foo, bar ] consumer_group: foogroup - redis_streams: url: tcp://localhost:6379 streams: - benthos_stream body_key: body consumer_group: benthos_group ``` ## Labels Inputs have an optional field `label` that can uniquely identify them in observability data such as metrics and logs. This can be useful when running configs with multiple inputs, otherwise their metrics labels will be generated based on their composition. For more information check out the [metrics documentation](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/about/). ### Sequential reads Sometimes it’s useful to consume a sequence of inputs, where an input is only consumed once its predecessor is drained fully, you can achieve this with the [`sequence` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sequence/). ## Generating messages It’s possible to generate data with Redpanda Connect using the [`generate` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/generate/), which is also a convenient way to trigger scheduled pipelines. --- # Page 39: amqp_0_9 **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/amqp_0_9.md --- # amqp_0_9 Connects to an AMQP (0.91) queue. AMQP is a messaging protocol used by various message brokers, including RabbitMQ. TLS is automatic when connecting to an `amqps` URL, but custom settings can be enabled in the [`tls`](#tls) section. ## Metadata This input adds the following metadata fields to each message: - `amqp_content_type` - `amqp_content_encoding` - `amqp_delivery_mode` - `amqp_priority` - `amqp_correlation_id` - `amqp_reply_to` - `amqp_expiration` - `amqp_message_id` - `amqp_timestamp` - `amqp_type` - `amqp_user_id` - `amqp_app_id` - `amqp_consumer_tag` - `amqp_delivery_tag` - `amqp_redelivered` - `amqp_exchange` - `amqp_routing_key` - All existing message headers, including nested headers prefixed with the key of their respective parent. You can access these metadata fields using [function interpolations](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ### Common ```yml input: label: "" amqp_0_9: urls: [] # No default (required) queue: "" # No default (required) consumer_tag: "" prefetch_count: 10 ``` ### Advanced ```yml input: label: "" amqp_0_9: urls: [] # No default (required) queue: "" # No default (required) queue_declare: enabled: false durable: true auto_delete: false arguments: {} # No default (optional) bindings_declare: [] # No default (optional) consumer_tag: "" auto_ack: false nack_reject_patterns: [] prefetch_count: 10 prefetch_size: 0 tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] ``` ## Fields ### `auto_ack` Set to `true` to automatically acknowledge messages as soon as they are consumed rather than waiting for acknowledgments from downstream. This can improve throughput and prevent the pipeline from becoming blocked, but delivery guarantees are lost. **Type**: `bool` **Default**: `false` ### `bindings_declare[]` Declares the bindings of the target queue to make sure they exist and are configured correctly. **Type**: `array` ```yaml # Examples: bindings_declare: - exchange: foo key: bar ``` ### `bindings_declare[].exchange` The exchange of the declared binding. **Type**: `string` **Default**: `""` ### `bindings_declare[].key` The key of the declared binding. **Type**: `string` **Default**: `""` ### `consumer_tag` A consumer tag to uniquely identify the consumer. **Type**: `string` **Default**: `""` ### `nack_reject_patterns[]` A list of regular expression patterns to match against errors in messages that Redpanda Connect fails to deliver. When a message has an error that matches a pattern, it is dropped or delivered to a dead-letter queue (if a queue has been configured). By default, failed messages are negatively acknowledged (nacked) and requeued. **Type**: `array` **Default**: `[]` ```yaml # Examples: nack_reject_patterns: - "^reject me please:.+$" ``` ### `prefetch_count` The maximum number of pending messages at a given time. **Type**: `int` **Default**: `10` ### `prefetch_size` The maximum size (in bytes) of pending messages to have consumed at a time. **Type**: `int` **Default**: `0` ### `queue` An AMQP queue to consume from. **Type**: `string` ### `queue_declare` Declares the target queue (`queue`) to make sure a queue with the specified name exists and is configured correctly. If the queue does not exist, it is created. If the queue already exists, the declaration verifies that the fields specified in this object match its properties. **Type**: `object` ### `queue_declare.arguments` Arguments for server-specific implementations of the queue (optional). You can use arguments to configure additional parameters for queue types that require them. For more information about available arguments, see the [RabbitMQ Client Library](https://github.com/rabbitmq/amqp091-go/blob/b3d409fe92c34bea04d8123a136384c85e8dc431/types.go#L282-L362). > 📝 **NOTE** > > This input sends every argument value as a string. RabbitMQ requires `x-max-length`, `x-max-length-bytes`, `x-message-ttl`, `x-expires`, `x-consumer-timeout`, and `x-stream-max-segment-size-bytes` to be integers, and `x-single-active-consumer` to be a boolean, so declaring a queue with any of them fails. Only string arguments, such as `x-queue-type`, `x-overflow`, and `x-max-age`, work. | Argument | Description | Accepted values | | --- | --- | --- | | `x-queue-type` | Declares the type of queue. | Options: `classic` (default), `quorum`, and `stream`. | | `x-max-length` | The maximum number of messages in the queue. | A non-negative integer. | | `x-max-length-bytes` | The maximum size of messages (in bytes) in the queue. | A non-negative integer. | | `x-overflow` | Sets the queue’s overflow behavior. | Options: `drop-head` (default), `reject-publish`, `reject-publish-dlx`. | | `x-message-ttl` | The duration (in milliseconds) that messages remain in the queue before they expire and are discarded. | A string that represents the number of milliseconds. For example, `60000` retains messages for one minute. | | `x-expires` | The duration (in milliseconds) after which the queue automatically expires. | A positive integer that represents the number of milliseconds. | | `x-max-age` | The duration (in configurable units) that streamed messages are retained on disk before they are discarded. | Options: `Y`, `M`, `D`, `h`, `m`, `s`. For example, `7D` retains messages for a week. | | `x-stream-max-segment-size-bytes` | The maximum size (in bytes) of the segment files held on disk. | A positive integer. Default: `500000000` (approximately 500 MB). | | `x-queue-version` | The version of the classic queue to use. | Options: `2`. RabbitMQ 4.3.0 and later accept only `2`, and earlier versions also accept `1`. | | `x-consumer-timeout` | The duration (in milliseconds) that a consumer can remain idle before it is automatically canceled. | A positive integer that represents the number of milliseconds. For example, `60000` sets a timeout duration of one minute. | | `x-single-active-consumer` | When set to `true`, a single consumer receives messages from the queue even when multiple consumers are subscribed to it. | A boolean. | **Type**: `object` ```yaml # Examples: arguments: x-overflow: reject-publish x-queue-type: quorum ``` ### `queue_declare.auto_delete` Whether the declared queue auto-deletes when there are no active consumers. **Type**: `bool` **Default**: `false` ### `queue_declare.durable` Whether the declared queue is durable. **Type**: `bool` **Default**: `true` ### `queue_declare.enabled` Whether to enable queue declaration. **Type**: `bool` **Default**: `false` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `urls[]` A list of AMQP 0.9.1 broker URLs to connect to, in the form `amqp://user:password@host:port/vhost`. Each URL is tried in order until a connection is established, and that URL is then used until the connection is closed. When `tls` is enabled and a URL has no user credentials, the connection authenticates with the SASL `EXTERNAL` mechanism using the client certificate. If an item in the list contains commas, it is split into multiple URLs. **Type**: `array` ```yaml # Examples: urls: - "amqp://guest:guest@127.0.0.1:5672/" # --- urls: - "amqp://127.0.0.1:5672/,amqp://127.0.0.2:5672/" # --- urls: - "amqp://127.0.0.1:5672/" - "amqp://127.0.0.2:5672/" ``` --- # Page 40: aws_cloudwatch_logs **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_cloudwatch_logs.md --- # aws_cloudwatch_logs Consumes log events from AWS CloudWatch Logs. Polls CloudWatch Log Groups for log events. Supports filtering by log streams, CloudWatch filter patterns, and configurable start times. Each log event becomes a separate message with metadata including the log group name, log stream name, timestamp, and ingestion time. > ❗ **IMPORTANT** > > This input tracks its position in memory only. If the process restarts, it resumes from `start_time`, or from the beginning of the available logs if `start_time` is not set. With an RFC3339 `start_time`, or with none set, it can emit events it already delivered again (at-least-once). With `start_time: now`, it skips the events written while the pipeline was down. Make downstream processing idempotent or deduplicate the events. ## Credentials By default, Redpanda Connect uses a shared credentials file when connecting to AWS services. You can also set credentials explicitly at the component level, which allows you to transfer data across accounts. For more information, see [AWS credentials](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). ## Metadata This input adds the following metadata fields to each message: - `cloudwatch_log_group` - The name of the log group - `cloudwatch_log_stream` - The name of the log stream - `cloudwatch_timestamp` - The timestamp of the log event (Unix milliseconds) - `cloudwatch_ingestion_time` - The ingestion timestamp (Unix milliseconds) - `cloudwatch_event_id` - The unique event ID You can access these metadata fields using [Bloblang](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/). ### Common ```yml input: label: "" aws_cloudwatch_logs: log_group_name: "" # No default (required) log_stream_names: [] # No default (optional) log_stream_prefix: "" # No default (optional) filter_pattern: "" # No default (optional) start_time: "" # No default (optional) poll_interval: 5s auto_replay_nacks: true ``` ### Advanced ```yml input: label: "" aws_cloudwatch_logs: log_group_name: "" # No default (required) log_stream_names: [] # No default (optional) log_stream_prefix: "" # No default (optional) filter_pattern: "" # No default (optional) start_time: "" # No default (optional) poll_interval: 5s limit: 1000 structured_log: true api_timeout: 30s auto_replay_nacks: true region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) ``` ## Fields ### `api_timeout` The maximum time to wait for an API request to complete. **Type**: `string` **Default**: `30s` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `filter_pattern` An optional CloudWatch Logs filter pattern to apply when querying log events. For syntax details, see the [CloudWatch Logs filter and pattern syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html) documentation. **Type**: `string` ```yaml # Examples: filter_pattern: "[ERROR]" ``` ### `limit` The maximum number of log events to return in a single API call. Valid range: 1-10000. **Type**: `int` **Default**: `1000` ### `log_group_name` The name of the CloudWatch Log Group to consume from. **Type**: `string` ```yaml # Examples: log_group_name: my-app-logs ``` ### `log_stream_names[]` An optional list of log stream names to consume from. If not set, events from all streams in the log group will be consumed. **Type**: `array` ```yaml # Examples: log_stream_names: - stream-1 - stream-2 ``` ### `log_stream_prefix` An optional log stream name prefix to filter streams. Only streams starting with this prefix will be consumed. **Type**: `string` ```yaml # Examples: log_stream_prefix: prod- ``` ### `poll_interval` The interval at which to poll for new log events. **Type**: `string` **Default**: `5s` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `start_time` The time to start consuming log events from. Can be an RFC3339 timestamp (for example, `2024-01-01T00:00:00Z`) or the string `now` to start consuming from the current time. If not set, starts from the beginning of available logs. **Type**: `string` ```yaml # Examples: start_time: 2024-01-01T00:00:00Z # --- start_time: now ``` ### `structured_log` Whether to output log events as structured JSON objects with all metadata fields, or as plain text messages with metadata stored in Redpanda Connect message metadata. **Type**: `bool` **Default**: `true` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` --- # Page 41: aws_dynamodb_cdc **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_dynamodb_cdc.md --- # aws_dynamodb_cdc Reads change data capture (CDC) events from DynamoDB Streams. Consumes records from DynamoDB Streams with automatic checkpointing and shard management. DynamoDB Streams capture item-level changes in DynamoDB tables. This input supports: - Automatic shard discovery and management - Checkpoint-based resumption after restarts - Concurrent processing of multiple shards - Optional initial snapshot of existing table data - Multi-table streaming with auto-discovery by tags or explicit table lists ## Table discovery modes This input supports three table discovery modes: - `single` (default) - Stream from the tables specified in the `tables` field - `tag` - Auto-discover and stream from multiple tables based on DynamoDB table tags. Use `table_tag_filter` to filter tables (for example, `key:value`) - `includelist` - Stream from an explicit list of tables specified in the `tables` field. This mode is kept for backward compatibility. Use `single` instead. When the input streams from more than one table, it reads from all matching tables simultaneously. Each table maintains its own checkpoint state. In `tag` or `includelist` mode, use `table_discovery_interval` to periodically rescan for new tables (useful for dynamically tagged tables). ## Prerequisites The source DynamoDB table(s) must have [DynamoDB Streams](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html) enabled. You can enable streams with one of these view types: - `KEYS_ONLY` - Only the key attributes of the modified item - `NEW_IMAGE` - The entire item as it appears after the modification - `OLD_IMAGE` - The entire item as it appeared before the modification - `NEW_AND_OLD_IMAGES` - Both the new and old item images ## Snapshots When `snapshot_mode` is set to `snapshot_only` or `snapshot_and_cdc`, the input first scans the entire table before (or instead of) streaming changes. This is useful for: - Building a replica or cache with all existing data - Syncing historical data to a data warehouse - Populating a search index with existing records Snapshots are supported only when streaming from a single table. > ⚠️ **WARNING** > > Snapshots use the DynamoDB Scan API which consumes read capacity units (RCUs). For large tables, this can be expensive and take considerable time. Use `snapshot_segments` and `snapshot_throttle` to control RCU consumption. > 📝 **NOTE** > > Snapshots use eventually consistent reads and do not provide point-in-time consistency. Records modified during the snapshot may appear in both the snapshot and CDC stream (with different values). Use `snapshot_deduplicate` to minimize duplicates. ## Checkpointing Checkpoints are stored in a separate DynamoDB table (configured via `checkpoint_table`). This table is created automatically if it does not exist. On restart, the input resumes from the last checkpointed position for each shard. Snapshot progress is also checkpointed, allowing resumption mid-snapshot after failures. The principal needs `dynamodb:UpdateItem` on the checkpoint table, in addition to the read and write permissions it already uses. A closed shard that has been read to the end is marked completed in the checkpoint table and is skipped after a restart. A child shard is read only after its parent has been read to the end, so changes to an item are emitted in order across shard splits. There are three exceptions, where a child shard is read without waiting and an older change to an item can be emitted after a newer one: the first discovery under `start_from: latest`, where every shard starts at its latest position; a parent shard that fails to prepare on 5 consecutive shard refresh cycles (a warning is logged); and a parent shard the stream reports as not found. A child shard that keeps waiting for its parent is reported with a warning every 20 shard refresh cycles. If a stored checkpoint points at stream data that has already been trimmed (older than the 24 hour retention), the shard resumes from `TRIM_HORIZON` and a warning is logged. Without a namespace, checkpoints are keyed only by stream and shard (or by source table and shard when `global_table` is enabled). Multiple pipelines that read the same stream and share one `checkpoint_table` without a namespace overwrite each other’s positions, which causes skipped or duplicated events. Multiple independent pipelines can share a single checkpoint table by giving each one a distinct `checkpoint_namespace` (for example one namespace per developer or environment). Namespaces isolate checkpoints from each other: a pipeline only sees checkpoints written under its own namespace, so changing (or removing) the namespace causes the pipeline to restart from `start_from`. Namespaces do not coordinate consumers: two pipelines sharing the _same_ namespace still overwrite each other’s checkpoints. The namespace is prefixed to the checkpoint key. When a pipeline restarts under a namespace that has no checkpoints yet, it starts from `start_from`. With `start_from: trim_horizon`, this replays all records still available in the stream’s 24-hour retention window. Switching back to a previously used namespace resumes from that namespace’s last checkpoints. ## Alternative For better performance and longer retention (up to 1 year vs 24 hours), consider using Kinesis Data Streams for DynamoDB with the `aws_kinesis` input instead. ## Message format Each change event is a JSON object with the fields `tableName`, `eventID`, `eventName` (`INSERT`, `MODIFY`, or `REMOVE`), `eventVersion`, `eventSource`, and `awsRegion`, plus a `dynamodb` object. The `dynamodb` object contains `keys`, `newImage`, and `oldImage` when the stream view type provides them, along with `sequenceNumber`, `streamViewType`, and `sizeBytes`. Snapshot records have an `eventName` of `READ` and carry the whole item in `dynamodb.newImage`. Attribute values are converted from DynamoDB’s typed format, such as `{"S": "value"}`, to plain values, such as `"value"`. Number attributes stay strings, so convert them in a mapping if you need numeric values. ## Metadata This input adds the following metadata fields to each message: - `dynamodb_shard_id` - The shard ID from which the record was read (empty for snapshot records) - `dynamodb_sequence_number` - The sequence number of the record in the stream (empty for snapshot records) - `dynamodb_approximate_creation_time` - RFC3339 approximate creation time of the stream record (empty for snapshot records) - `dynamodb_event_name` - The type of change: `INSERT`, `MODIFY`, `REMOVE`, or `READ` (for snapshot records) - `dynamodb_table` - The name of the DynamoDB table ## Metrics This input emits the following metrics: - `dynamodb_cdc_shards_tracked` - Total number of shards being tracked (gauge) - `dynamodb_cdc_shards_active` - Number of shards currently being read from (gauge) - `dynamodb_cdc_snapshot_state` - Snapshot state: 0=`not_started`, 1=`in_progress`, 2=`complete` (gauge) - `dynamodb_cdc_snapshot_records_read` - Total records read during snapshot (counter) - `dynamodb_cdc_snapshot_segments_active` - Number of active snapshot scan segments (gauge) - `dynamodb_cdc_snapshot_buffer_overflow` - Incremented when the deduplication buffer exceeds its size limit, disabling dedup (counter) - `dynamodb_cdc_snapshot_segment_duration` - Time taken by each snapshot scan segment to complete (timer) - `dynamodb_cdc_checkpoint_failures` - Number of failed checkpoint writes to the checkpoint table (counter) - `dynamodb_cdc_failover_skipped` - Records skipped during global-table failover replay because they predate the resumed cutoff (counter) ## Global table checkpoints (multi-region failover) In active/active or active/passive multi-region deployments, set `global_table: true` and list the other regions in `global_table_replicas` so the auto-created checkpoint table is provisioned as a DynamoDB Global Table (v2). Checkpoints then replicate across regions: a failed-over pipeline resumes near the last committed position instead of replaying the whole stream. Because each region’s stream has its own sequence numbers, cross-region resume is time-based (at-least-once, replaying from the trim horizon up to the last replicated record time); same-region restarts still resume exactly. If the checkpoint table already exists, enabling `global_table` reconciles it towards the desired configuration: any missing replica regions are added via `UpdateTable`. The existing table must have been created in global mode (it must use a `TableId` hash key); pointing `global_table` at a pre-existing non-global checkpoint table fails fast with a clear error rather than mutating it. When `global_table` is enabled the principal additionally needs `dynamodb:CreateTable`, `dynamodb:UpdateTable`, `dynamodb:DescribeTable`, `dynamodb:DescribeLimits`, `iam:CreateServiceLinkedRole`, and create/describe permissions in each replica region. Use this reference to: - Look up configuration options for DynamoDB CDC streaming - Find metadata fields available for message processing - Identify checkpointing and performance tuning settings ### Common ```yml input: label: "" aws_dynamodb_cdc: tables: [] checkpoint_table: redpanda_dynamodb_checkpoints checkpoint_namespace: "" start_from: trim_horizon auto_replay_nacks: true snapshot_mode: none ``` ### Advanced ```yml input: label: "" aws_dynamodb_cdc: tables: [] table_discovery_mode: single table_tag_filter: "" table_discovery_interval: 5m checkpoint_table: redpanda_dynamodb_checkpoints checkpoint_namespace: "" global_table: false global_table_replicas: [] batch_size: 1000 poll_interval: 1s start_from: trim_horizon checkpoint_limit: 1000 max_tracked_shards: 10000 auto_replay_nacks: true throttle_backoff: 100ms snapshot_mode: none snapshot_segments: 1 snapshot_batch_size: 100 snapshot_throttle: 100ms snapshot_deduplicate: true snapshot_buffer_size: 100000 region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) ``` ## Message structure Each CDC event is delivered as a JSON message with the following structure. Use these fields in your Bloblang mappings with `this.`: ```json { "eventID": "abc123-", (1) "eventName": "INSERT | MODIFY | REMOVE", (2) "eventSource": "aws:dynamodb", "awsRegion": "us-east-1", "tableName": "my-table", (3) "dynamodb": { "keys": { (4) "pk": "user#123", "sk": "profile" }, "newImage": { (5) "pk": "user#123", "sk": "profile", "name": "Alice", "email": "alice@example.com" }, "oldImage": { (6) "pk": "user#123", "sk": "profile", "name": "Alice Smith" }, "sequenceNumber": "12345678901234567890", (7) "sizeBytes": 256, "streamViewType": "NEW_AND_OLD_IMAGES" } } ``` 1. Unique identifier for this change event. 2. Type of change: `INSERT` (new item), `MODIFY` (updated item), or `REMOVE` (deleted item). 3. Name of the source DynamoDB table. 4. Primary key attributes of the changed item. Always present. 5. Item state after the change. Present for `INSERT` and `MODIFY` events (requires `NEW_IMAGE` or `NEW_AND_OLD_IMAGES` stream view type). 6. Item state before the change. Present for `MODIFY` and `REMOVE` events (requires `OLD_IMAGE` or `NEW_AND_OLD_IMAGES` stream view type). 7. Position of this record in the shard, used for ordering and checkpointing. ### Example mapping ```yaml pipeline: processors: - mapping: | root.event_type = this.eventName root.table = this.tableName root.keys = this.dynamodb.keys root.new_data = this.dynamodb.newImage root.old_data = this.dynamodb.oldImage ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `batch_size` Maximum number of records to read per shard in a single request. Valid range: 1-1000. **Type**: `int` **Default**: `1000` ### `checkpoint_limit` Maximum number of unacknowledged messages before forcing a checkpoint update. Lower values provide better recovery guarantees but increase write overhead. **Type**: `int` **Default**: `1000` ### `checkpoint_namespace` Isolates this pipeline’s checkpoints within a shared `checkpoint_table` by prefixing the namespace to the checkpoint key. Use this so that multiple pipelines reading the same stream can share one checkpoint table without overwriting each other’s positions, for example per-developer or per-environment test pipelines. Leave empty (the default) to keep the original checkpoint keys unchanged. A namespace isolates readers but does not coordinate them: pipelines that share the same namespace still collide. Changing or removing the namespace changes the checkpoint key. If no checkpoints exist yet under the new key, the pipeline starts from `start_from`. Switching back to a previously used namespace resumes from that namespace’s last checkpoints. The value cannot contain a `#` character. **Type**: `string` **Default**: `""` ### `checkpoint_table` DynamoDB table name for storing checkpoints. Will be created if it doesn’t exist. **Type**: `string` **Default**: `redpanda_dynamodb_checkpoints` ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `global_table` Provision the checkpoint table as a DynamoDB Global Table (v2) so checkpoints replicate across regions. Requires `global_table_replicas`. When the table is auto-created it is created as a global table; when it already exists, its replicas are reconciled (missing regions are added by calling `UpdateTable`). The existing table must have been created in global mode (`TableId` hash key). Enabling this against a pre-existing non-global checkpoint table fails fast with a clear error. **Type**: `bool` **Default**: `false` ### `global_table_replicas[]` Regions other than this pipeline’s own region to replicate the checkpoint table to. The pipeline’s own region is always included. Required when `global_table` is true. Applied both when the checkpoint table is created and, for an existing global table, when reconciling replicas (missing regions are added; this list is not used to remove regions). **Type**: `array` **Default**: `[]` ### `max_tracked_shards` Maximum number of shards holding acknowledgement state at once. A shard is normally forgotten once it has been read to the end and its last batch has been acknowledged, so this bounds the shards being read concurrently, not the shards seen over the pipeline’s lifetime. Past this limit acknowledgements return an error. **Type**: `int` **Default**: `10000` ### `poll_interval` Time to wait between polling attempts when no records are available. **Type**: `string` **Default**: `1s` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `snapshot_batch_size` Records per scan request during snapshot. Maximum 1000. Lower values provide better backpressure control but require more API calls. **Type**: `int` **Default**: `100` ### `snapshot_buffer_size` Maximum CDC events to buffer for deduplication (approximately 100 bytes per entry). If exceeded, deduplication is disabled and duplicates may be emitted. **Type**: `int` **Default**: `100000` ### `snapshot_deduplicate` Deduplicate records that appear in both snapshot and CDC stream. Requires buffering CDC events during snapshot. If buffer is exceeded, deduplication is disabled to prevent data loss. **Type**: `bool` **Default**: `true` ### `snapshot_mode` `none`: Streams CDC events only (default). `snapshot_only`: Performs a one-time full table scan with no ongoing streaming. `snapshot_and_cdc`: Scans the entire table, then streams changes. **Type**: `string` **Default**: `none` **Options**: `none`, `snapshot_only`, `snapshot_and_cdc` ### `snapshot_segments` Number of parallel scan segments (1-10). Higher parallelism scans faster but consumes more Read Capacity Units (RCUs). A lower value is safer to start with. A snapshot that resumes from stored progress keeps the segment count it started with. A changed value applies to the next snapshot. **Type**: `int` **Default**: `1` ### `snapshot_throttle` Minimum time between scan requests per segment. Use this to limit Read Capacity Unit (RCU) consumption during snapshot. **Type**: `string` **Default**: `100ms` ### `start_from` Where to start reading on a genuinely fresh pipeline (no checkpoint state exists yet under this `checkpoint_namespace` for the stream). `trim_horizon` starts from the oldest available record, `latest` starts from new records. `latest` is honoured only on that first discovery: once any checkpoint state exists, shards discovered later - rotation children found by the periodic refresh, and any checkpoint-less shard after a restart - always start at `trim_horizon` so their backlog is never skipped. In practice a restart under `latest` therefore replays from each shard’s oldest retained record rather than only new records; at-least-once delivery takes precedence over the configured start position. **Type**: `string` **Default**: `trim_horizon` **Options**: `trim_horizon`, `latest` ### `table_discovery_interval` Interval for rescanning and discovering new tables when using `tag` or `includelist` mode. Set to 0 to disable periodic rescanning. **Type**: `string` **Default**: `5m` ### `table_discovery_mode` `single`: Streams from tables specified in the `tables` list. `tag`: Auto-discovers tables by tags (ignores the `tables` field). `includelist`: Streams from tables in the `tables` list. Use `single` instead; `includelist` is kept for backward compatibility. **Type**: `string` **Default**: `single` **Options**: `single`, `tag`, `includelist` ### `table_tag_filter` Multi-tag filter in the format `key1:v1,v2;key2:v3,v4`. Matches tables where (key1=v1 OR key1=v2) AND (key2=v3 OR key2=v4). Required when `table_discovery_mode` is `tag`. **Type**: `string` **Default**: `""` ### `tables[]` List of table names to stream from. For single table mode, provide one table. For multi-table mode, provide multiple tables. **Type**: `array` **Default**: `[]` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `throttle_backoff` Time to wait when applying backpressure due to too many in-flight messages. **Type**: `string` **Default**: `100ms` ## Examples ### Consume CDC events Read change events from a DynamoDB table with streams enabled. ```yaml input: aws_dynamodb_cdc: tables: [my-table] region: us-east-1 ``` ### Start from latest Only process new changes, ignoring existing stream data. ```yaml input: aws_dynamodb_cdc: tables: [orders] start_from: latest region: us-west-2 ``` ### Snapshot and CDC Scan all existing records, then stream ongoing changes. ```yaml input: aws_dynamodb_cdc: tables: [products] snapshot_mode: snapshot_and_cdc snapshot_segments: 5 region: us-east-1 ``` ### Auto-discover tables by tag Automatically discover and stream from all tables with a specific tag. ```yaml input: aws_dynamodb_cdc: table_discovery_mode: tag table_tag_filter: "stream-enabled:true" table_discovery_interval: 5m region: us-east-1 ``` ### Auto-discover tables by multiple tags Discover tables matching multiple tag criteria with OR logic per key, AND logic across keys. ```yaml input: aws_dynamodb_cdc: table_discovery_mode: tag table_tag_filter: "environment:prod,staging;team:data,analytics" table_discovery_interval: 5m region: us-east-1 # Matches tables with: (environment=prod OR environment=staging) AND (team=data OR team=analytics) ``` ### Share a checkpoint table across pipelines Give each pipeline that reads the same stream its own `checkpoint_namespace` so that they can share one checkpoint table without overwriting each other’s positions. A second pipeline uses the same configuration with a different namespace, such as `dev-bob`. ```yaml input: aws_dynamodb_cdc: tables: [orders] checkpoint_table: shared_dynamodb_checkpoints checkpoint_namespace: dev-alice start_from: trim_horizon region: us-east-1 ``` ### Stream from multiple specific tables Stream from an explicit list of tables simultaneously. ```yaml input: aws_dynamodb_cdc: table_discovery_mode: includelist tables: - orders - customers - products region: us-west-2 ``` ## Suggested reading For common patterns including filtering events, routing to Kafka or S3, and detecting changed fields, see the [DynamoDB CDC Patterns](https://docs.redpanda.com/connect/cookbooks/dynamodb_cdc/) cookbook. --- # Page 42: aws_kinesis **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_kinesis.md --- # aws_kinesis Receive messages from one or more Kinesis streams. Consumes messages from one or more Kinesis streams either by automatically balancing shards across other instances of this input, or by consuming shards listed explicitly. The latest message sequence consumed by this input is stored within a [DynamoDB table](#table-schema), which allows it to resume at the correct sequence of the shard during restarts. This table is also used for coordination across distributed inputs when shard balancing. Redpanda Connect will not store a consumed sequence unless it is acknowledged at the output level, which ensures at-least-once delivery guarantees. ## Ordering By default messages of a shard can be processed in parallel, up to a limit determined by the field `checkpoint_limit`. However, if strict ordered processing is required then this value must be set to 1 in order to process shard messages in lock-step. When doing so it is recommended that you perform batching at this component for performance as it will not be possible to batch lock-stepped messages at the output level. ## Enhanced fan-out Kinesis enforces a shared limit of 5 GetRecords calls per second per shard across all polling consumers of a stream. When multiple applications consume the same stream this budget is quickly exhausted and consumers receive ReadProvisionedThroughputExceeded errors. There are two remedies: - Set the `poll_period` field to bound how frequently this input polls each shard, leaving headroom for other consumers. - Enable `enhanced_fan_out`, which registers this pipeline as a dedicated stream consumer with its own 2MB/s per shard read throughput, delivered over HTTP/2 push rather than polling. Enhanced fan-out requires the IAM permissions `kinesis:DescribeStreamConsumer` and `kinesis:SubscribeToShard`, and incurs additional AWS charges per consumer-shard-hour plus data retrieval. The named consumer is registered automatically on first use and is never deregistered; that registration additionally requires `kinesis:RegisterStreamConsumer`, which may be omitted when a consumer with the configured name already exists on every stream (for example one provisioned through infrastructure-as-code). ## Table schema It’s possible to configure Redpanda Connect to create the DynamoDB table required for coordination if it does not already exist. However, if you wish to create this yourself (recommended) then create a table with a string HASH key `StreamID` and a string RANGE key `ShardID`. ## Batching Use the `batching` fields to configure an optional [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/#batch-policy). Each stream shard will be batched separately in order to ensure that acknowledgements aren’t contaminated. ### Common ```yml input: label: "" aws_kinesis: streams: [] # No default (required) dynamodb: table: "" create: false checkpoint_limit: 1024 auto_replay_nacks: true commit_period: 5s steal_grace_period: 2s start_from_oldest: true batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml input: label: "" aws_kinesis: streams: [] # No default (required) dynamodb: table: "" create: false billing_mode: PAY_PER_REQUEST read_capacity_units: 0 write_capacity_units: 0 region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) checkpoint_limit: 1024 poll_period: 0s enhanced_fan_out: enabled: false consumer_name: "" consumer_activation_timeout: 1m max_resubscribe_interval: 30s auto_replay_nacks: true commit_period: 5s steal_grace_period: 2s rebalance_period: 30s lease_period: 30s start_from_oldest: true region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `checkpoint_limit` The maximum gap between the in flight sequence versus the latest acknowledged sequence at a given time. Increasing this limit enables parallel processing and batching at the output level to work on individual shards. Any given sequence will not be committed unless all messages under that offset are delivered in order to preserve at least once delivery guarantees. **Type**: `int` **Default**: `1024` ### `commit_period` The period of time between each update to the checkpoint table. **Type**: `string` **Default**: `5s` ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `dynamodb` Determines the table used for storing and accessing the latest consumed sequence for shards, and for coordinating balanced consumers of streams. **Type**: `object` ### `dynamodb.billing_mode` When creating the table determines the billing mode. **Type**: `string` **Default**: `PAY_PER_REQUEST` **Options**: `PROVISIONED`, `PAY_PER_REQUEST` ### `dynamodb.create` Whether, if the table does not exist, it should be created. **Type**: `bool` **Default**: `false` ### `dynamodb.credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `dynamodb.credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `dynamodb.credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `dynamodb.credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `dynamodb.credentials.role` The ARN of the role to assume. **Type**: `string` ### `dynamodb.credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `dynamodb.credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `dynamodb.credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `dynamodb.endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `dynamodb.read_capacity_units` Set the provisioned read capacity when creating the table with a `billing_mode` of `PROVISIONED`. **Type**: `int` **Default**: `0` ### `dynamodb.region` The AWS region in which your resources are hosted. **Type**: `string` ### `dynamodb.table` The name of the table to access. **Type**: `string` **Default**: `""` ### `dynamodb.tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `dynamodb.tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `dynamodb.tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `dynamodb.tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `dynamodb.tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `dynamodb.tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `dynamodb.tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `dynamodb.write_capacity_units` Set the provisioned write capacity when creating the table with a `billing_mode` of `PROVISIONED`. **Type**: `int` **Default**: `0` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `enhanced_fan_out` Consume the stream using [enhanced fan-out](https://docs.aws.amazon.com/streams/latest/dev/enhanced-consumers.html), which provides this consumer dedicated read throughput of 2MB/s per shard via HTTP/2 push delivery, avoiding the 5 reads per second per shard limit that polling consumers share. The named consumer is registered on each stream automatically if it does not already exist (and is never deregistered). Requires the IAM permissions `kinesis:DescribeStreamConsumer` and `kinesis:SubscribeToShard`, plus `kinesis:RegisterStreamConsumer` unless a consumer with the configured name already exists on every stream (for example one provisioned through infrastructure-as-code). Note that AWS bills enhanced fan-out consumers per consumer-shard-hour plus data retrieval. When a shard has no stored checkpoint and `start_from_oldest` is `false`, consumption starts from a timestamp anchored to this host’s clock at claim time (rather than the server-side `LATEST` used by polling, which cannot be pinned across resubscribes without risking skipped records), so a clock running ahead can omit its offset’s worth of records after a fresh claim. **Type**: `object` ### `enhanced_fan_out.consumer_activation_timeout` The maximum amount of time to wait on connect for the registered consumer to become active before failing. Newly registered consumers on streams with many shards can take tens of seconds to activate. **Type**: `string` **Default**: `1m` ### `enhanced_fan_out.consumer_name` The name of the enhanced fan-out consumer to register. Required when `enabled` is true. Each distinct pipeline (application) consuming a stream must use its own consumer name, as Kinesis permits only one active subscription per consumer per shard. Instances of the same pipeline sharing a DynamoDB checkpoint table should share this name. **Type**: `string` **Default**: `""` ### `enhanced_fan_out.enabled` Whether to consume the stream using enhanced fan-out. **Type**: `bool` **Default**: `false` ### `enhanced_fan_out.max_resubscribe_interval` The ceiling on the exponential backoff between SubscribeToShard attempts after a subscription ends without delivering any events. This bounds how long a shard may sit unsubscribed after repeated failures. **Type**: `string` **Default**: `30s` ### `lease_period` The period of time after which a client that has failed to update a shard checkpoint is assumed to be inactive. **Type**: `string` **Default**: `30s` ### `poll_period` An optional minimum period between GetRecords calls made against each shard. Kinesis allows a shared budget of 5 GetRecords calls per second per shard across all consumers of a stream, so a value such as `250ms` bounds this consumer to roughly four reads per second per shard, leaving headroom for other consumers of the same stream. The default of `0s` polls as fast as records are consumed. This setting has no effect when `enhanced_fan_out` is enabled. A shard is polled at most once per period, so the committed sequence advances no faster than that; values above `lease_period` are rejected. **Type**: `string` **Default**: `0s` ### `rebalance_period` The period of time between each attempt to rebalance shards across clients. **Type**: `string` **Default**: `30s` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `start_from_oldest` Whether to consume from the oldest message when a sequence does not yet exist for the stream. **Type**: `bool` **Default**: `true` ### `steal_grace_period` Determines how long beyond the next commit period a client will wait when stealing a shard for the current owner to store a checkpoint. A longer value increases the time taken to balance shards but reduces the likelihood of processing duplicate messages. **Type**: `string` **Default**: `2s` ### `streams[]` One or more Kinesis data streams to consume from. Streams can either be specified by their name or full ARN. Shards of a stream are automatically balanced across consumers by coordinating through the provided DynamoDB table. Multiple comma separated streams can be listed in a single element. Shards are automatically distributed across consumers of a stream by coordinating through the provided DynamoDB table. Alternatively, it’s possible to specify an explicit shard to consume from with a colon after the stream name. For example `foo:0` would consume the shard `0` of the stream `foo`. **Type**: `array` ```yaml # Examples: streams: - foo - "arn:aws:kinesis:*:111122223333:stream/my-stream" ``` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` --- # Page 43: aws_s3 **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_s3.md --- # aws_s3 Downloads objects within an Amazon S3 bucket, optionally filtered by a prefix, either by walking the items in the bucket or by streaming upload notifications in realtime. ## Stream objects on upload with SQS A common pattern for consuming S3 objects is to emit upload notification events from the bucket either directly to an SQS queue, or to an SNS topic that is consumed by an SQS queue, and then have your consumer listen for events which prompt it to download the newly uploaded objects. More information about this pattern and how to set it up can be found at in the [Amazon S3 docs](https://docs.aws.amazon.com/AmazonS3/latest/dev/ways-to-add-notification-config-to-bucket.html). Redpanda Connect is able to follow this pattern when you configure an `sqs.url`, where it consumes events from SQS and only downloads object keys received within those events. In order for this to work Redpanda Connect needs to know where within the event the key and bucket names can be found, specified as [dot paths](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/field_paths/) with the fields `sqs.key_path` and `sqs.bucket_path`. The default values for these fields should already be correct when following the guide above. If your notification events are being routed to SQS via an SNS topic then the events will be enveloped by SNS, in which case you also need to specify the field `sqs.envelope_path`, which in the case of SNS to SQS will usually be `Message`. When using SQS please make sure you have sensible values for `sqs.max_messages` and also the visibility timeout of the queue itself. When Redpanda Connect consumes an S3 object the SQS message that triggered it is not deleted until the S3 object has been sent onwards. This ensures at-least-once crash resiliency, but also means that if the S3 object takes longer to process than the visibility timeout of your queue then the same objects might be processed multiple times. Amazon S3 sends an `s3:TestEvent` notification whenever a bucket’s event configuration is saved, to verify the queue is reachable. Redpanda Connect detects these (including via an SNS envelope) and deletes them automatically. Any other message with no extractable target key, for example due to a misconfigured `sqs.key_path`/`sqs.bucket_path`, is logged as a warning and left on the queue instead. ## Download large files When downloading large files it’s often necessary to process it in streamed parts in order to avoid loading the entire file in memory at a given time. In order to do this a [`scanner`](#scanner) can be specified that determines how to break the input into smaller individual messages. ## S3-compatible storage To consume from an S3-compatible storage service, such as Cloudflare R2, MinIO, or DigitalOcean Spaces, set `endpoint` to the URL of the service. Many of these services also require `force_path_style_urls` to be `true`. For example, to consume from Cloudflare R2, set `endpoint` to your account’s R2 endpoint URL, set `region` to `auto`, and enable `force_path_style_urls`: ```yaml input: aws_s3: bucket: r2-bucket endpoint: https://.r2.cloudflarestorage.com force_path_style_urls: true region: auto credentials: id: secret: ``` To find your account ID and generate R2 API credentials, see [Cloudflare R2 authentication](https://developers.cloudflare.com/r2/api/tokens/). ## Credentials By default Redpanda Connect will use a shared credentials file when connecting to AWS services. It’s also possible to set them explicitly at the component level, allowing you to transfer data across accounts. You can find out more in [AWS credentials](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). ## Metadata This input adds the following metadata fields to each message: - `s3_key` - `s3_bucket` - `s3_last_modified_unix` - `s3_last_modified` (RFC3339) - `s3_content_type` - `s3_content_encoding` - `s3_version_id` - All user defined metadata You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). Note that user defined metadata is case insensitive within AWS, and it is likely that the keys will be received in a capitalized form, if you wish to make them consistent you can map all metadata keys to lower or uppercase using a Bloblang mapping such as `meta = meta().map_each_key(key → key.lowercase())`. ### Common ```yml input: label: "" aws_s3: bucket: "" prefix: "" scanner: to_the_end: {} sqs: url: "" key_path: Records.*.s3.object.key bucket_path: Records.*.s3.bucket.name envelope_path: "" nack_visibility_timeout: 0 ``` ### Advanced ```yml input: label: "" aws_s3: bucket: "" prefix: "" region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) force_path_style_urls: false delete_objects: false scanner: to_the_end: {} sqs: url: "" endpoint: "" key_path: Records.*.s3.object.key bucket_path: Records.*.s3.bucket.name envelope_path: "" delay_period: "" max_messages: 10 wait_time_seconds: 0 nack_visibility_timeout: 0 zero_key_warn_interval: 30s ``` ## Bucket and prefix The `bucket` field accepts a bucket name only, not an ARN. For example, use `my-bucket`, not `arn:aws:s3:::my-bucket`. The `prefix` field accepts a single string. To consume from multiple prefixes in the same bucket, use multiple `aws_s3` inputs in a [`broker` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/broker/): ```yaml input: broker: inputs: - aws_s3: bucket: my-bucket prefix: logs/app1/ - aws_s3: bucket: my-bucket prefix: logs/app2/ ``` ## Fields ### `bucket` The name of the bucket to consume from, such as `my-bucket`. Use the bucket name, not its ARN. If the field `sqs.url` is specified this field is optional. **Type**: `string` **Default**: `""` ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `delete_objects` Whether to delete each object from its S3 bucket after all of its messages are acknowledged successfully. Objects whose messages fail to process are left in the bucket. **Type**: `bool` **Default**: `false` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `force_path_style_urls` Forces the client API to use path style URLs for downloading keys, which is often required when connecting to custom endpoints. **Type**: `bool` **Default**: `false` ### `prefix` An optional path prefix, if set only objects with the prefix are consumed when walking a bucket. This field accepts a single prefix. To consume objects under several prefixes in the same bucket, use one `aws_s3` input for each prefix in a [`broker` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/broker/). **Type**: `string` **Default**: `""` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `scanner` The [scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/about/) used to split the stream of bytes into individual messages. Scanners are useful for processing large data sources efficiently without holding the entire data set in memory. For example, the `csv` scanner processes individual rows in a CSV file without loading the entire file in memory. **Type**: `scanner` **Default**: ```yaml to_the_end: {} ``` ### `sqs` Consume SQS messages in order to trigger key downloads. **Type**: `object` ### `sqs.bucket_path` A [dot path](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/field_paths/) whereby the bucket name can be found in SQS messages. **Type**: `string` **Default**: `Records.*.s3.bucket.name` ### `sqs.delay_period` An optional period of time to wait from when a notification was originally sent to when the target key download is attempted. **Type**: `string` **Default**: `""` ```yaml # Examples: delay_period: 10s # --- delay_period: 5m ``` ### `sqs.endpoint` A custom endpoint to use when connecting to SQS. **Type**: `string` **Default**: `""` ### `sqs.envelope_path` A [dot path](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/field_paths/) of a field to extract an enveloped JSON payload for further extracting the key and bucket from SQS messages. This is specifically useful when subscribing an SQS queue to an SNS topic that receives bucket events. **Type**: `string` **Default**: `""` ```yaml # Examples: envelope_path: Message ``` ### `sqs.key_path` A [dot path](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/field_paths/) whereby object keys are found in SQS messages. **Type**: `string` **Default**: `Records.*.s3.object.key` ### `sqs.max_messages` The maximum number of SQS messages to consume from each request. **Type**: `int` **Default**: `10` ### `sqs.nack_visibility_timeout` Custom SQS Nack Visibility timeout in seconds. Default is 0 **Type**: `int` **Default**: `0` ### `sqs.url` An optional SQS URL to connect to. When specified this queue will control which objects are downloaded. **Type**: `string` **Default**: `""` ### `sqs.wait_time_seconds` Whether to set the wait time. Enabling this activates long-polling. Valid values: 0 to 20. **Type**: `int` **Default**: `0` ### `sqs.zero_key_warn_interval` A message from which no target key can be extracted (for example, due to a misconfigured `key_path`/`bucket_path`) is never deleted, so it’s redelivered and re-evaluated repeatedly until the underlying issue is fixed. This field limits how often that condition is logged as a warning, to avoid flooding the logs; every occurrence is still logged at debug level. Set to `0s` to warn on every occurrence. **Type**: `string` **Default**: `30s` ```yaml # Examples: zero_key_warn_interval: 10s # --- zero_key_warn_interval: 0s ``` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` --- # Page 44: aws_sqs **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_sqs.md --- # aws_sqs Consume messages from an AWS SQS URL. ## Credentials By default Redpanda Connect will use a shared credentials file when connecting to AWS services. It’s also possible to set them explicitly at the component level, allowing you to transfer data across accounts. You can find out more in [AWS credentials](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). ## Metadata This input adds the following metadata fields to each message: - `sqs_message_id` - `sqs_receipt_handle` - `sqs_approximate_receive_count` - All message attributes You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ### Common ```yml input: label: "" aws_sqs: url: "" # No default (required) max_outstanding_messages: 1000 ``` ### Advanced ```yml input: label: "" aws_sqs: url: "" # No default (required) delete_message: true reset_visibility: true max_number_of_messages: 10 max_outstanding_messages: 1000 wait_time_seconds: 0 message_timeout: 30s region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) ``` ## Fields ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `delete_message` Whether to delete the consumed message when it’s acknowledged. Set to `false` to handle the deletion using a different mechanism. **Type**: `bool` **Default**: `true` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `max_number_of_messages` The maximum number of messages that Redpanda Connect can return each time it polls the SQS queue. Enter a value from `1` to `10`. **Type**: `int` **Default**: `10` ### `max_outstanding_messages` The maximum number of pending messages that Redpanda Connect can have in flight at the same time. **Type**: `int` **Default**: `1000` ### `message_timeout` The maximum time allowed to process a received message before Redpanda Connect must refresh its [receipt handle](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html). If the handle is not refreshed in time, the message becomes visible in the queue again. Redpanda Connect attempts to refresh the receipt handle after half of the timeout has elapsed. This value sets the visibility timeout for each received message. **Type**: `string` **Default**: `30s` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `reset_visibility` Whether to set the visibility timeout of the consumed message to zero when Redpanda Connect receives a negative acknowledgement, which releases the message immediately for reprocessing. Set to `false` to honor the [queue’s visibility timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) instead. **Type**: `bool` **Default**: `true` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `url` The SQS URL to consume from. **Type**: `string` ### `wait_time_seconds` The wait time, in seconds, for each receive request. Valid values are `0` to `20`. Set a value from `1` to `20` to enable [long polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html) for queued messages. **Type**: `int` **Default**: `0` --- # Page 45: azure_blob_storage **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/azure_blob_storage.md --- # azure_blob_storage Downloads objects within an Azure Blob Storage container, optionally filtered by a prefix. Supports multiple authentication methods but only one of the following is required: - `storage_connection_string` - `storage_account` and `storage_access_key` - `storage_account` and `storage_sas_token` - `storage_account` to access via [DefaultAzureCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DefaultAzureCredential) If multiple are set then the `storage_connection_string` is given priority. If the `storage_connection_string` does not contain the `AccountName` parameter, please specify it in the `storage_account` field. ## Download large files When downloading large files it’s often necessary to process it in streamed parts in order to avoid loading the entire file in memory at a given time. In order to do this a [`scanner`](#scanner) can be specified that determines how to break the input into smaller individual messages. ## Stream new files By default this input will consume all files found within the target container and will then gracefully terminate. This is referred to as a "batch" mode of operation. However, it’s possible to instead configure a container as [an Event Grid source](https://learn.microsoft.com/en-gb/azure/event-grid/event-schema-blob-storage) and then use this as a [`targets_input`](#targets_input), in which case new files are consumed as they’re uploaded and Redpanda Connect will continue listening for and downloading files as they arrive. This is referred to as a "streamed" mode of operation. ## Metadata This input adds the following metadata fields to each message: - `blob_storage_key` - `blob_storage_container` - `blob_storage_last_modified` - `blob_storage_last_modified_unix` - `blob_storage_content_type` - `blob_storage_content_encoding` - All user defined metadata You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ### Common ```yml input: label: "" azure_blob_storage: storage_account: "" storage_access_key: "" storage_connection_string: "" storage_sas_token: "" container: "" # No default (required) prefix: "" scanner: to_the_end: {} targets_input: {} # No default (optional) ``` ### Advanced ```yml input: label: "" azure_blob_storage: storage_account: "" storage_access_key: "" storage_connection_string: "" storage_sas_token: "" container: "" # No default (required) prefix: "" scanner: to_the_end: {} delete_objects: false targets_input: {} # No default (optional) ``` ## Fields ### `container` The name of the container from which to download blobs. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `delete_objects` Whether to delete downloaded blobs from the container once they are processed. **Type**: `bool` **Default**: `false` ### `prefix` An optional path prefix, if set only objects with the prefix are consumed. **Type**: `string` **Default**: `""` ### `scanner` The [scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/about/) used to split the stream of bytes into individual messages. Scanners are useful for processing large data sources efficiently without holding the entire data set in memory. For example, the `csv` scanner processes individual rows in a CSV file without loading the entire file in memory. **Type**: `scanner` **Default**: ```yaml to_the_end: {} ``` ### `storage_access_key` The access key for the storage account. Use this field along with `storage_account` for authentication. This field is ignored when the `storage_connection_string` field is populated. **Type**: `string` **Default**: `""` ### `storage_account` The storage account to access. This field is ignored when the `storage_connection_string` field is populated, unless the connection string does not contain the `AccountName` parameter. **Type**: `string` **Default**: `""` ### `storage_connection_string` The connection string for the storage account. This field is required if `storage_account` is not set. > 📝 **NOTE** > > If the `storage_connection_string` field does not contain the `AccountName` parameter value, specify it in the `storage_account` field. **Type**: `string` **Default**: `""` ### `storage_sas_token` The SAS token for the storage account. Use this field along with `storage_account` for authentication. This field is ignored when either the `storage_connection_string` or `storage_access_key` fields are populated. **Type**: `string` **Default**: `""` ### `targets_input` > ⚠️ **CAUTION** > > This is an experimental field that provides an optional source of download targets, configured as a [regular Redpanda Connect input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/about/). Each message yielded by this input should be a single structured object containing a field `name`, which represents the blob to be downloaded. This requires setting up [Azure Blob Storage as an Event Grid source](https://learn.microsoft.com/en-gb/azure/event-grid/event-schema-blob-storage) and an associated event handler that a Redpanda Connect input can read from. For example, use either one of the following: - [Azure Event Hubs](https://learn.microsoft.com/en-gb/azure/event-grid/handler-event-hubs) using the `kafka` input - [Namespace topics](https://learn.microsoft.com/en-gb/azure/event-grid/handler-event-grid-namespace-topic) using the `mqtt` input **Type**: `input` ```yaml # Examples: targets_input: mqtt: topics: - some-topic urls: - example.westeurope-1.ts.eventgrid.azure.net:8883 processors: - unarchive: format: json_array - mapping: |- if this.eventType == "Microsoft.Storage.BlobCreated" { root.name = this.data.url.parse_url().path.trim_prefix("/foocontainer/") } else { root = deleted() } ``` --- # Page 46: azure_cosmosdb **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/azure_cosmosdb.md --- # azure_cosmosdb Executes a SQL query against [Azure CosmosDB](https://learn.microsoft.com/en-us/azure/cosmos-db/introduction) and creates a batch of messages from each page of items. ## Cross-partition queries Cross-partition queries are currently not supported by the underlying driver. For every query, the PartitionKey values must be known in advance and specified in the config. [See details](https://github.com/Azure/azure-sdk-for-go/issues/18578#issuecomment-1222510989). ## Credentials You can use one of the following authentication mechanisms: - Set the `endpoint` field and the `account_key` field - Set only the `endpoint` field to use [DefaultAzureCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DefaultAzureCredential) - Set the `connection_string` field ## Metadata This component adds the following metadata fields to each message: - `activity_id` - `request_charge` You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ### Common ```yml input: label: "" azure_cosmosdb: endpoint: "" # No default (optional) account_key: "" # No default (optional) connection_string: "" # No default (optional) database: "" # No default (required) container: "" # No default (required) partition_keys_map: "" # No default (required) query: "" # No default (required) args_mapping: "" # No default (optional) auto_replay_nacks: true ``` ### Advanced ```yml input: label: "" azure_cosmosdb: endpoint: "" # No default (optional) account_key: "" # No default (optional) connection_string: "" # No default (optional) database: "" # No default (required) container: "" # No default (required) partition_keys_map: "" # No default (required) query: "" # No default (required) args_mapping: "" # No default (optional) batch_count: -1 auto_replay_nacks: true ``` ## Examples ### Query container Execute a parametrized SQL query to select documents from a container. ```yaml input: azure_cosmosdb: endpoint: http://localhost:8080 account_key: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw== database: blobbase container: blobfish partition_keys_map: root = "AbyssalPlain" query: SELECT * FROM blobfish AS b WHERE b.species = @species args_mapping: | root = [ { "Name": "@species", "Value": "smooth-head" }, ] ``` ## Fields ### `account_key` Account key. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: account_key: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw== ``` ### `args_mapping` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that creates the list of parameters to use with the query. Each parameter is an object with a `Name` field, which matches a named parameter in the query such as `@name`, and a `Value` field. The input evaluates this mapping once, when the input is created, so the mapping cannot reference message contents or metadata. **Type**: `string` ```yaml # Examples: args_mapping: |- root = [ { "Name": "@name", "Value": "benthos" }, ] ``` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `batch_count` The maximum number of messages that should be accumulated into each batch. Use '-1' specify dynamic page size. **Type**: `int` **Default**: `-1` ### `connection_string` Connection string. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: connection_string: AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==; ``` ### `container` Container. **Type**: `string` ```yaml # Examples: container: testcontainer ``` ### `database` Database. **Type**: `string` ```yaml # Examples: database: testdb ``` ### `endpoint` CosmosDB endpoint. **Type**: `string` ```yaml # Examples: endpoint: https://localhost:8081 ``` ### `partition_keys_map` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) which should evaluate to a single partition key value or an array of partition key values of type string, integer or boolean. Currently, hierarchical partition keys are not supported so only one value may be provided. **Type**: `string` ```yaml # Examples: partition_keys_map: root = "blobfish" # --- partition_keys_map: root = 41 # --- partition_keys_map: root = true # --- partition_keys_map: root = null # --- partition_keys_map: root = now().ts_format("2006-01-02") ``` ### `query` The query to execute **Type**: `string` ```yaml # Examples: query: SELECT c.foo FROM testcontainer AS c WHERE c.bar = "baz" AND c.timestamp < @timestamp ``` ## CosmosDB emulator If you wish to run the CosmosDB emulator that is referenced in the documentation [here](https://learn.microsoft.com/en-us/azure/cosmos-db/linux-emulator), the following Docker command should do the trick: ```bash > docker run --rm -it -p 8081:8081 --name=cosmosdb -e AZURE_COSMOS_EMULATOR_PARTITION_COUNT=10 -e AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE=false mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator ``` Note: `AZURE_COSMOS_EMULATOR_PARTITION_COUNT` controls the number of partitions that will be supported by the emulator. The bigger the value, the longer it takes for the container to start up. Additionally, instead of installing the container self-signed certificate which is exposed via `https://localhost:8081/_explorer/emulator.pem`, you can run [mitmproxy](https://mitmproxy.org/) like so: ```bash > mitmproxy -k --mode "reverse:https://localhost:8081" ``` Then you can access the CosmosDB UI via `http://localhost:8080/_explorer/index.html` and use `http://localhost:8080` as the CosmosDB endpoint. --- # Page 47: azure_queue_storage **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/azure_queue_storage.md --- # azure_queue_storage Dequeue objects from an Azure Storage Queue. This input adds the following metadata fields to each message: ```none - queue_storage_insertion_time - queue_storage_queue_name - queue_storage_message_lag (if 'track_properties' set to true) - All user defined queue metadata ``` Only one authentication method is required, `storage_connection_string` or `storage_account` and `storage_access_key`. If both are set then the `storage_connection_string` is given priority. #### Common ```yml input: label: "" azure_queue_storage: storage_account: "" storage_access_key: "" storage_connection_string: "" queue_name: "" # No default (required) ``` #### Advanced ```yml input: label: "" azure_queue_storage: storage_account: "" storage_access_key: "" storage_connection_string: "" queue_name: "" # No default (required) dequeue_visibility_timeout: 30s max_in_flight: 10 track_properties: false ``` ## Fields ### `dequeue_visibility_timeout` The timeout duration until a dequeued message gets visible again, 30s by default **Type**: `string` **Default**: `30s` ### `max_in_flight` The maximum number of unprocessed messages to fetch at a given time. **Type**: `int` **Default**: `10` ### `queue_name` The name of the source storage queue. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: queue_name: foo_queue ``` ### `storage_access_key` The access key for the storage account. Use this field along with `storage_account` for authentication. This field is ignored when the `storage_connection_string` field is populated. **Type**: `string` **Default**: `""` ### `storage_account` The storage account to access. This field is ignored when the `storage_connection_string` field is populated, unless the connection string does not contain the `AccountName` parameter. **Type**: `string` **Default**: `""` ### `storage_connection_string` The connection string for the storage account. This field is required if `storage_account` is not set. > 📝 **NOTE** > > If the `storage_connection_string` field does not contain the `AccountName` parameter value, specify it in the `storage_account` field. **Type**: `string` **Default**: `""` ### `track_properties` If set to `true` the queue is polled on each read request for information such as the queue message lag. These properties are added to consumed messages as metadata, but will also have a negative performance impact. **Type**: `bool` **Default**: `false` --- # Page 48: azure_table_storage **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/azure_table_storage.md --- # azure_table_storage Queries an Azure Storage Account Table, optionally with multiple filters. Queries an Azure Storage Account Table, optionally with multiple filters. ## Metadata This input adds the following metadata fields to each message: - `table_storage_name` - `row_num` You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ### Common ```yml input: label: "" azure_table_storage: storage_account: "" storage_access_key: "" storage_connection_string: "" storage_sas_token: "" table_name: "" # No default (required) ``` ### Advanced ```yml input: label: "" azure_table_storage: storage_account: "" storage_access_key: "" storage_connection_string: "" storage_sas_token: "" table_name: "" # No default (required) filter: "" select: "" page_size: 1000 ``` ## Fields ### `filter` OData filter expression. Is not set all rows are returned. Valid operators are `eq, ne, gt, lt, ge and le` **Type**: `string` **Default**: `""` ```yaml # Examples: filter: PartitionKey eq 'foo' and RowKey gt '1000' ``` ### `page_size` Maximum number of records to return on each page. **Type**: `int` **Default**: `1000` ### `select` Select expression using OData notation. Limits the columns on each record to just those requested. **Type**: `string` **Default**: `""` ```yaml # Examples: select: PartitionKey,RowKey,Foo,Bar,Timestamp ``` ### `storage_access_key` The access key for the storage account. Use this field along with `storage_account` for authentication. This field is ignored when the `storage_connection_string` field is populated. **Type**: `string` **Default**: `""` ### `storage_account` The storage account to access. This field is ignored when the `storage_connection_string` field is populated, unless the connection string does not contain the `AccountName` parameter. **Type**: `string` **Default**: `""` ### `storage_connection_string` The connection string for the storage account. This field is required if `storage_account` is not set. > 📝 **NOTE** > > If the `storage_connection_string` field does not contain the `AccountName` parameter value, specify it in the `storage_account` field. **Type**: `string` **Default**: `""` ### `storage_sas_token` The SAS token for the storage account. Use this field along with `storage_account` for authentication. This field is ignored when either the `storage_connection_string` or `storage_access_key` fields are populated. **Type**: `string` **Default**: `""` ### `table_name` The table to read messages from. **Type**: `string` ```yaml # Examples: table_name: Foo ``` --- # Page 49: batched **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/batched.md --- # batched Consumes data from a child input and applies a batching policy to the stream. Batching at the input level is sometimes useful for processing across micro-batches, and can also sometimes be a useful performance trick. However, most inputs are fine without it so unless you have a specific plan for batching this component is not worth using. #### Common ```yml input: label: "" batched: child: {} # No default (required) policy: count: 0 byte_size: 0 period: "" check: "" ``` #### Advanced ```yml input: label: "" batched: child: {} # No default (required) policy: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `child` The child input. **Type**: `input` ### `policy` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: policy: byte_size: 5000 count: 0 period: 1s # --- policy: count: 10 period: 1s # --- policy: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `policy.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `policy.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `policy.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `policy.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `policy.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` --- # Page 50: broker **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/broker.md --- # broker Allows you to combine multiple inputs into a single stream of data, where each input will be read in parallel. A broker type is configured with its own list of input configurations and a field to specify how many copies of the list of inputs should be created. Adding more input types allows you to combine streams from multiple sources into one. For example, reading from both RabbitMQ and Kafka: ```yaml input: broker: copies: 1 inputs: - amqp_0_9: urls: - amqp://guest:guest@localhost:5672/ consumer_tag: benthos-consumer queue: benthos-queue # Optional list of input specific processing steps processors: - mapping: | root.message = this root.meta.link_count = this.links.length() root.user.age = this.user.age.number() - kafka: addresses: - localhost:9092 client_id: benthos_kafka_input consumer_group: benthos_consumer_group topics: [ benthos_stream:0 ] ``` If the number of copies is greater than zero the list will be copied that number of times. For example, if your inputs were of type foo and bar, with 'copies' set to '2', you would end up with two 'foo' inputs and two 'bar' inputs. ## Batching It’s possible to configure a [batch policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/#batch-policy) with a broker using the `batching` fields. When doing this the feeds from all child inputs are combined. Some inputs do not support broker based batching and specify this in their documentation. ## Processors It is possible to configure [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) at the broker level, where they will be applied to _all_ child inputs, as well as on the individual child inputs. If you have processors at both the broker level _and_ on child inputs then the broker processors will be applied _after_ the child nodes processors. ### Common ```yml input: label: "" broker: inputs: [] # No default (required) batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml input: label: "" broker: copies: 1 inputs: [] # No default (required) batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `copies` Whatever is specified within `inputs` will be created this many times. **Type**: `int` **Default**: `1` ### `inputs[]` A list of inputs to create. **Type**: `array` --- # Page 51: gateway **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gateway.md --- # gateway Receive messages delivered over HTTP. The `gateway` input is a Cloud-only component that receives messages over HTTP and injects them into a running Redpanda Connect pipeline. Use this input to: - Receive webhook events from third-party services - Accept real-time telemetry or sensor data over HTTP - Build lightweight ingest endpoints for client apps For on-premises or self-managed deployments, use the [`http_server`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/http_server/) input instead. This component is fully managed and available in the following Redpanda Cloud deployment types: - **Serverless** - **Dedicated** - **Bring Your Own Cloud (BYOC)** When you deploy a pipeline with a `gateway` input, Redpanda Cloud provisions a secure URL that you can use to send HTTP requests. You can post raw payloads, JSON messages, or stream events in real time. Authentication and access control use standard Redpanda Cloud API tokens. For more information, see [Redpanda Cloud API authentication](https://docs.redpanda.com/api/doc/cloud-controlplane/authentication). Network access depends on the cluster type: - On **public clusters** (Serverless and Dedicated), the gateway URL is accessible over the public internet. - On **private clusters** (BYOC), the gateway is accessible only from within your configured VPC. ## Rate limiting The `rate_limit` field lets you specify an optional [rate limit resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/about/), which is applied to each HTTP request received. When the rate limit is breached, the input returns a 429 response with a `Retry-After` header. ## Responses You can return a response for each message received using [synchronous responses](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/sync_responses/). When doing so, you can customize headers using the `sync_response.headers` field, which supports [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries) in the value based on the response message contents. ## Metadata This input adds the following metadata fields to each message: - `http_server_user_agent` - `http_server_request_path` - `http_server_verb` - `http_server_remote_ip` - All headers (only first values are taken) - All query parameters - All path parameters - All cookies You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ### Common ```yml input: label: "" gateway: path: / rate_limit: "" ``` ### Advanced ```yml input: label: "" gateway: path: / rate_limit: "" sync_response: status: "200" headers: Content-Type: "application/octet-stream" metadata_headers: include_prefixes: [] include_patterns: [] tcp: reuse_addr: false reuse_port: false ``` ## Fields ### `path` The endpoint path to listen for data delivery requests. **Type**: `string` **Default**: `/` ### `rate_limit` The name of an optional [rate limit resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/about/) that the gateway applies to each request it receives. When the rate limit is reached, the gateway rejects the request with a `429` response and a `Retry-After` header. **Type**: `string` **Default**: `""` ### `sync_response` Customize messages returned using [synchronous responses](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/sync_responses/). **Type**: `object` ### `sync_response.headers` The headers that the gateway adds to synchronous responses. Header values are interpolated against the first response message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` **Default**: ```yaml Content-Type: "application/octet-stream" ``` ### `sync_response.metadata_headers` Selects which metadata values of the response messages the gateway adds to the synchronous response as headers. **Type**: `object` ### `sync_response.metadata_headers.include_patterns[]` A list of explicit metadata key regular expression (re2) patterns to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_patterns: - .* # --- include_patterns: - _timestamp_unix$ ``` ### `sync_response.metadata_headers.include_prefixes[]` A list of explicit metadata key prefixes to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_prefixes: - foo_ - bar_ # --- include_prefixes: - kafka_ # --- include_prefixes: - content- ``` ### `sync_response.status` The HTTP status code that the gateway returns when the pipeline produces a synchronous response. The value is interpolated against the first response message, so the code can depend on its contents and metadata. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `200` ```yaml # Examples: status: ${! json("status") } # --- status: ${! meta("status") } ``` ### `tcp` TCP listener socket configuration. **Type**: `object` ### `tcp.reuse_addr` Enable SO_REUSEADDR, allowing binding to ports in TIME_WAIT state. Useful for graceful restarts and config reloads where the server needs to rebind to the same port immediately after shutdown. **Type**: `bool` **Default**: `false` ### `tcp.reuse_port` Enable SO_REUSEPORT, allowing multiple sockets to bind to the same port for load balancing across multiple processes/threads. **Type**: `bool` **Default**: `false` ## Examples ### Ingest a real-time stream of sensor data Use the `gateway` input to stream telemetry data from edge devices or browser clients that connect over HTTP. Suppose a client connects and sends JSON-encoded sensor readings like this: ```json { "sensor_id": "temp-001", "value": 22.5, "unit": "C" } { "sensor_id": "temp-001", "value": 22.8, "unit": "C" } { "sensor_id": "temp-001", "value": 23.1, "unit": "C" } ``` Redpanda Connect treats each line as an individual message. The following pipeline sets up a `gateway` input to handle these connections and logs each message: ```yaml input: label: sensor_stream gateway: path: /ws/sensors rate_limit: "" pipeline: processors: - log: level: INFO message: "Received reading from ${! json(\"sensor_id\") }: ${! json(\"value\") } ${! json(\"unit\") }" ``` This configuration: - Accepts HTTP connections on `/ws/sensors` - Receives a stream of messages over a single connection - Logs each message using Bloblang interpolation You can replace the `log` processor with any downstream output, such as Redpanda or Amazon S3, to persist or analyze the data in real time. --- # Page 52: gcp_bigquery_select **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gcp_bigquery_select.md --- # gcp_bigquery_select Executes a `SELECT` query against BigQuery and creates a message for each row received. Once the rows from the query are exhausted, this input shuts down, allowing the pipeline to gracefully terminate (or the next input in a [sequence](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sequence/) to execute). ```yml input: label: "" gcp_bigquery_select: project: "" # No default (required) credentials_json: "" table: "" # No default (required) columns: [] # No default (required) where: "" # No default (optional) auto_replay_nacks: true job_labels: {} priority: "" args_mapping: "" # No default (optional) prefix: "" # No default (optional) suffix: "" # No default (optional) ``` ## Examples ### Word counts Here we query the public corpus of Shakespeare’s works to generate a stream of the top 10 words that are 3 or more characters long: ```yaml input: gcp_bigquery_select: project: sample-project table: bigquery-public-data.samples.shakespeare columns: - word - sum(word_count) as total_count where: length(word) >= ? suffix: | GROUP BY word ORDER BY total_count DESC LIMIT 10 args_mapping: | root = [ 3 ] ``` ## Fields ### `args_mapping` An optional [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that evaluates to an array of values for the `?` placeholders in the `where` field, in order. Each value is sent to BigQuery as a positional query parameter. **Type**: `string` ```yaml # Examples: args_mapping: root = [ "article", now().ts_format("2006-01-02") ] ``` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `columns[]` A list of columns to query. **Type**: `array` ### `credentials_json` The Google Service Account credentials in JSON format (optional). Provide the contents of the credentials file as plain JSON, not Base64-encoded. Use this field to authenticate with Google Cloud services. If this field is empty, the component uses [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials). For more information about creating service account credentials, see [Google’s service account documentation](https://developers.google.com/workspace/guides/create-credentials#create_credentials_for_a_service_account). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `job_labels` A map of labels to add to the query job. **Type**: `object` **Default**: `{}` ### `prefix` Optional GoogleSQL text to add before the `SELECT` keyword of the generated query, for example a `WITH` clause. **Type**: `string` ### `priority` The priority with which to schedule the query. **Type**: `string` **Default**: `""` ### `project` The GCP project where the query job runs. **Type**: `string` ### `suffix` Optional GoogleSQL text to append after the generated query, for example `GROUP BY`, `ORDER BY`, or `LIMIT` clauses. **Type**: `string` ### `table` The fully-qualified name of the BigQuery table to query. **Type**: `string` ```yaml # Examples: table: bigquery-public-data.samples.shakespeare ``` ### `where` An optional `WHERE` clause to add to the query. The `args_mapping` field populates the placeholder arguments. Placeholders must always be question marks (`?`). **Type**: `string` ```yaml # Examples: where: type = ? and created_at > ? # --- where: user_id = ? ``` --- # Page 53: gcp_cloud_storage **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gcp_cloud_storage.md --- # gcp_cloud_storage Downloads objects within a Google Cloud Storage bucket, optionally filtered by a prefix. ## Metadata This input adds the following metadata fields to each message: - `gcs_key` - `gcs_bucket` - `gcs_last_modified` - `gcs_last_modified_unix` - `gcs_content_type` - `gcs_content_encoding` - All user defined metadata You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ## Credentials By default Redpanda Connect will use a shared credentials file when connecting to GCP services. You can find out more in [GCP credentials](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/gcp/). ### Common ```yml input: label: "" gcp_cloud_storage: bucket: "" # No default (required) prefix: "" credentials_json: "" scanner: to_the_end: {} ``` ### Advanced ```yml input: label: "" gcp_cloud_storage: bucket: "" # No default (required) prefix: "" credentials_json: "" scanner: to_the_end: {} delete_objects: false ``` ## Fields ### `bucket` The name of the bucket from which to download objects. **Type**: `string` ### `credentials_json` The Google Service Account credentials in JSON format (optional). Provide the contents of the credentials file as plain JSON, not Base64-encoded. Use this field to authenticate with Google Cloud services. If this field is empty, the component uses [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials). For more information about creating service account credentials, see [Google’s service account documentation](https://developers.google.com/workspace/guides/create-credentials#create_credentials_for_a_service_account). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `delete_objects` Whether to remove objects from the Cloud Storage bucket once the messages read from them are delivered without error. An object is kept if delivery fails. **Type**: `bool` **Default**: `false` ### `prefix` Optional path prefix, if set only objects with the prefix are consumed. **Type**: `string` **Default**: `""` ### `scanner` The [scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/about/) used to split the stream of bytes into individual messages. Scanners are useful for processing large data sources efficiently without holding the entire data set in memory. For example, the `csv` scanner processes individual rows in a CSV file without loading the entire file in memory. **Type**: `scanner` **Default**: ```yaml to_the_end: {} ``` --- # Page 54: gcp_pubsub **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gcp_pubsub.md --- # gcp_pubsub Consumes messages from a GCP Cloud Pub/Sub subscription. For information on how to set up credentials see [this guide](https://cloud.google.com/docs/authentication/production). ## Metadata This input adds the following metadata fields to each message: - `gcp_pubsub_publish_time_unix` - The time at which the message was published to the topic. - `gcp_pubsub_delivery_attempt` - When dead lettering is enabled, this is set to the number of times Pub/Sub has attempted to deliver a message. - `gcp_pubsub_message_id` - The unique identifier of the message. - `gcp_pubsub_ordering_key` - The ordering key of the message. - All message attributes You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ### Common ```yml input: label: "" gcp_pubsub: project: "" # No default (required) credentials_json: "" subscription: "" # No default (required) endpoint: "" sync: false max_outstanding_messages: 1000 max_outstanding_bytes: 1000000000 ``` ### Advanced ```yml input: label: "" gcp_pubsub: project: "" # No default (required) credentials_json: "" subscription: "" # No default (required) endpoint: "" sync: false max_outstanding_messages: 1000 max_outstanding_bytes: 1000000000 create_subscription: enabled: false topic: "" ``` ## Fields ### `create_subscription` Allows you to configure the input subscription and creates if it doesn’t exist. **Type**: `object` ### `create_subscription.enabled` Whether to configure subscription or not. **Type**: `bool` **Default**: `false` ### `create_subscription.topic` Defines the topic that the subscription should be vinculated to. **Type**: `string` **Default**: `""` ### `credentials_json` The Google Service Account credentials in JSON format (optional). Provide the contents of the credentials file as plain JSON, not Base64-encoded. Use this field to authenticate with Google Cloud services. If this field is empty, the component uses [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials). For more information about creating service account credentials, see [Google’s service account documentation](https://developers.google.com/workspace/guides/create-credentials#create_credentials_for_a_service_account). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `endpoint` An optional endpoint that overrides the default of `pubsub.googleapis.com:443`. Use this field to connect to a region-specific Pub/Sub endpoint. For a list of valid values, see [Pub/Sub regional endpoints](https://cloud.google.com/pubsub/docs/reference/service_apis_overview#list_of_regional_endpoints). **Type**: `string` **Default**: `""` ```yaml # Examples: endpoint: us-central1-pubsub.googleapis.com:443 # --- endpoint: us-west3-pubsub.googleapis.com:443 ``` ### `max_outstanding_bytes` The maximum number of outstanding pending messages to be consumed measured in bytes. **Type**: `int` **Default**: `1000000000` ### `max_outstanding_messages` The maximum number of outstanding pending messages to be consumed at a given time. **Type**: `int` **Default**: `1000` ### `project` The project ID of the target subscription. **Type**: `string` ### `subscription` The target subscription ID. **Type**: `string` ### `sync` Enable synchronous pull mode. **Type**: `bool` **Default**: `false` --- # Page 55: gcp_spanner_cdc **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gcp_spanner_cdc.md --- # gcp_spanner_cdc Consumes change records from a Google Cloud Spanner change stream. Consumes change records from a Google Cloud Spanner change stream. This input allows you to track and process database changes in real time, making it useful for data replication, event-driven architectures, and maintaining derived data stores. The input reads from a specified change stream within a Spanner database and converts each change record into a message. The message payload contains the change records in JSON format, and metadata is added with details about the Spanner instance, database, and stream. Change streams provide a way to track mutations to your Spanner database tables. For more information about Spanner change streams, refer to the [Google Cloud documentation](https://cloud.google.com/spanner/docs/change-streams). #### Common ```yaml input: label: "" gcp_spanner_cdc: credentials_json: "" project_id: "" # No default (required) instance_id: "" # No default (required) database_id: "" # No default (required) stream_id: "" # No default (required) start_timestamp: "" end_timestamp: "" batching: count: 0 byte_size: 0 period: "" check: "" checkpoint_limit: 1024 auto_replay_nacks: true ``` #### Advanced ```yaml input: label: "" gcp_spanner_cdc: credentials_json: "" project_id: "" # No default (required) instance_id: "" # No default (required) database_id: "" # No default (required) stream_id: "" # No default (required) start_timestamp: "" end_timestamp: "" heartbeat_interval: 10s metadata_table: "" min_watermark_cache_ttl: 5s allowed_mod_types: [] # No default (optional) batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) checkpoint_limit: 1024 auto_replay_nacks: true ``` ## Fields ### `allowed_mod_types[]` List of modification types to process. If not specified, all modification types are processed. Allowed values: INSERT, UPDATE, DELETE **Type**: `array` ```yaml # Examples: allowed_mod_types: - INSERT - UPDATE - DELETE ``` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `checkpoint_limit` The maximum number of messages that can be processed at a given time per partition. Increasing this limit enables parallel processing and batching at the output level. Any given partition watermark will not be committed unless all messages under that offset are delivered in order to preserve at least once delivery guarantees. **Type**: `int` **Default**: `1024` ### `credentials_json` Base64-encoded JSON credentials file for authenticating to GCP with a service account. If not provided, Application Default Credentials (ADC) is used. For more information about how to create a service account and obtain the credentials JSON, see the [Google Cloud documentation](https://cloud.google.com/docs/authentication/getting-started). **Type**: `string` **Default**: `""` ### `database_id` The ID of the Spanner database to read from. This is the name of the database as it appears in the Spanner console or API. For more information about how to create a Spanner database, see the [Google Cloud documentation](https://cloud.google.com/spanner/docs/create-manage-databases). **Type**: `string` ### `end_timestamp` The timestamp at which to stop reading change records from the change stream. This optional field lets you limit the range of change records processed by the input. The timestamp is exclusive. The timestamp must be in RFC3339 format, such as `2023-10-01T00:00:00Z`. If not set, the input streams change records indefinitely. **Type**: `string` **Default**: `""` ```yaml # Examples: end_timestamp: 2022-01-01T00:00:00Z ``` ### `heartbeat_interval` The interval at which Spanner emits heartbeat records on the change stream when a partition has no data changes. The input uses heartbeat records to advance partition watermarks. Heartbeat records are not emitted as messages. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. For example, `1s` requests a heartbeat record every second. **Type**: `string` **Default**: `10s` ### `instance_id` The ID of the Spanner instance to read from. This is the name of the instance as it appears in the Spanner console or API. For more information about how to create a Spanner instance, see the [Google Cloud documentation](https://cloud.google.com/spanner/docs/create-manage-instances). **Type**: `string` ### `metadata_table` The table to store metadata in (default: `cdc_metadata_`). **Type**: `string` **Default**: `""` ### `min_watermark_cache_ttl` How frequently to query Spanner for the minimum watermark, as a duration string. **Type**: `string` **Default**: `5s` ### `project_id` The ID of the GCP project that contains the Spanner instance and database. This is the name of the project as it appears in the GCP console or API. For more information about how to create a GCP project, see the [Google Cloud documentation](https://cloud.google.com/resource-manager/docs/creating-managing-projects). **Type**: `string` ### `start_timestamp` The timestamp at which to start reading change records from the change stream. This optional field lets you limit the range of change records processed by the input. The timestamp is inclusive. The timestamp must be in RFC3339 format, such as `2023-10-01T00:00:00Z`. If not set, the input starts reading from the current time. **Type**: `string` **Default**: `""` ```yaml # Examples: start_timestamp: 2022-01-01T00:00:00Z ``` ### `stream_id` The name of the change stream to track. The stream must exist in the Spanner database. To create a change stream, follow the [Google Cloud documentation](https://cloud.google.com/spanner/docs/change-streams/manage). **Type**: `string` --- # Page 56: generate **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/generate.md --- # generate Generates messages at a given interval using a [Bloblang](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) mapping executed without a context. This allows you to generate messages for testing your pipeline configs. #### Common ```yml input: label: "" generate: mapping: "" # No default (required) interval: 1s count: 0 batch_size: 1 auto_replay_nacks: true ``` #### Advanced ```yml input: label: "" generate: mapping: "" # No default (required) interval: 1s count: 0 batch_size: 1 auto_replay_nacks: true ``` ## Examples ### Cron Scheduled Processing A common use case for the generate input is to trigger processors on a schedule so that the processors themselves can behave similarly to an input. The following configuration reads rows from a PostgreSQL table every 5 minutes. ```yaml input: generate: interval: '@every 5m' mapping: 'root = {}' processors: - sql_select: driver: postgres dsn: postgres://foouser:foopass@localhost:5432/testdb?sslmode=disable table: foo columns: [ "*" ] ``` ### Generate 100 Rows The generate input can be used as a convenient way to generate test data. The following example generates 100 rows of structured data by setting an explicit count. The interval field is set to empty, which means data is generated as fast as the downstream components can consume it. ```yaml input: generate: count: 100 interval: "" mapping: | root = if random_int() % 2 == 0 { { "type": "foo", "foo": "is yummy" } } else { { "type": "bar", "bar": "is gross" } } ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `batch_size` The number of generated messages that should be accumulated into each batch flushed at the specified interval. **Type**: `int` **Default**: `1` ### `count` An optional number of messages to generate, if set above 0 the specified number of messages is generated and then the input will shut down. **Type**: `int` **Default**: `0` ### `interval` The time interval at which messages should be generated, expressed either as a duration string or as a cron expression. If set to an empty string messages will be generated as fast as downstream services can process them. Cron expressions can specify a timezone by prefixing the expression with `TZ=`, where the location name corresponds to a file within the IANA Time Zone database. **Type**: `string` **Default**: `1s` ```yaml # Examples: interval: 5s # --- interval: 1m # --- interval: 1h # --- interval: "@every 1s" # --- interval: 0,30 */2 * * * * # --- interval: TZ=Europe/London 30 3-6,20-23 * * * ``` ### `mapping` A [Bloblang](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) mapping to use for generating messages. **Type**: `string` ```yaml # Examples: mapping: root = "hello world" # --- mapping: root = {"test":"message","id":uuid_v4()} ``` --- # Page 57: git **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/git.md --- # git Clones a Git repository, reads its contents, then polls for new commits at a configurable interval. The git input clones the specified repository (or pulls updates if already cloned) and reads the content of the specified file. It periodically polls the repository for new commits and emits a message when changes are detected. ## Metadata This input adds the following metadata fields to each message: - `git_file_path` - `git_file_size` - `git_file_mode` - `git_file_modified` - `git_commit` - `git_mime_type` - `git_is_binary` - `git_encoding` (present if the file was base64 encoded) - `git_deleted` (only present if the file was deleted) You can access these metadata fields using function interpolation. ```yml input: label: "" git: repository_url: "" # No default (required) branch: main poll_interval: 10s include_patterns: [] exclude_patterns: [] max_file_size: 10485760 checkpoint_cache: "" # No default (optional) checkpoint_key: git_last_commit auth: basic: username: "" password: "" ssh_key: private_key_path: "" private_key: "" passphrase: "" token: value: "" auto_replay_nacks: true ``` ## Fields ### `auth` Options for authenticating with your Git repository. **Type**: `object` ### `auth.basic` Allows you to specify basic authentication. **Type**: `object` ### `auth.basic.password` A password to authenticate with. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `auth.basic.username` The username to use for authentication. **Type**: `string` **Default**: `""` ### `auth.ssh_key` Allows you to specify SSH key authentication. **Type**: `object` ### `auth.ssh_key.passphrase` The passphrase for your SSH private key. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `auth.ssh_key.private_key` Your private SSH key content. When using encrypted keys, you must also set a value for `passphrase`. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `auth.ssh_key.private_key_path` The path to your private SSH key file. When using encrypted keys, you must also set a value for `passphrase`. **Type**: `string` **Default**: `""` ### `auth.token` Allows you to specify token-based authentication. **Type**: `object` ### `auth.token.value` The token value to use for token-based authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `branch` The repository branch to check out. **Type**: `string` **Default**: `main` ### `checkpoint_cache` Specify a [`cache`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) resource to store the last processed commit hash. After a restart, Redpanda Connect can then continue processing changes from where it left off, avoiding the need to reprocess all detected updates. **Type**: `string` ### `checkpoint_key` The key to use when storing the last processed commit hash in the cache. **Type**: `string` **Default**: `git_last_commit` ### `exclude_patterns[]` A list of file patterns to exclude. For example, you could choose not to read content from certain Git directories or image files: `'.git/**', '**/*.png'`. These patterns take precedence over `include_patterns`. The following patterns are supported: - Glob patterns: `*`, `/**/`, `?` - Character ranges: `[a-z]`. Escape any character with a special meaning using a backslash. **Type**: `array` **Default**: `[]` ### `include_patterns[]` A list of file patterns to read from. For example, you could read content from only Markdown and YAML files: `'**/*.md', 'configs/*.yaml'`. The following patterns are supported: - Glob patterns: `*`, `/**/`, `?` - Character ranges: `[a-z]`. Escape any character with a special meaning using a backslash. If this field is left empty, all files are read. **Type**: `array` **Default**: `[]` ### `max_file_size` The maximum size of files to read from (in bytes). Files that exceed this limit are skipped. Set to `0` for unlimited file sizes. **Type**: `int` **Default**: `10485760` ### `poll_interval` How frequently this input polls the Git repository for changes, as a duration between polling attempts. **Type**: `string` **Default**: `10s` ```yaml # Examples: poll_interval: 10s ``` ### `repository_url` The URL of the Git repository to clone. **Type**: `string` ```yaml # Examples: repository_url: https://github.com/username/repo.git ``` --- # Page 58: http_client **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/http_client.md --- # http_client Connects to a server and continuously performs requests for a single message. The URL and header values of this type can be dynamically set using function interpolations described [here](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ## Streaming If you enable streaming then Redpanda Connect will consume the body of the response as a continuous stream of data, breaking messages out following a chosen scanner. This allows you to consume APIs that provide long-lived streamed data feeds (such as stock market feeds). ## Pagination This input supports interpolation functions in the `url` and `headers` fields where data from the previous successfully consumed message (if there was one) can be referenced. This can be used in order to support basic levels of pagination. However, in cases where pagination depends on logic it is recommended that you use an [`http` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/http/) instead, often combined with a [`generate` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/generate/) in order to schedule the processor. ### Common ```yml input: label: "" http_client: url: "" # No default (required) verb: GET headers: {} rate_limit: "" # No default (optional) timeout: 5s payload: "" # No default (optional) stream: enabled: false reconnect: true scanner: lines: {} auto_replay_nacks: true ``` ### Advanced ```yml input: label: "" http_client: url: "" # No default (required) verb: GET headers: {} metadata: include_prefixes: [] include_patterns: [] dump_request_log_level: "" oauth: enabled: false consumer_key: "" consumer_secret: "" access_token: "" access_token_secret: "" oauth2: enabled: false client_key: "" client_secret: "" token_url: "" scopes: [] endpoint_params: {} basic_auth: enabled: false username: "" password: "" jwt: enabled: false private_key_file: "" signing_method: "" claims: {} headers: {} tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] extract_headers: include_prefixes: [] include_patterns: [] rate_limit: "" # No default (optional) timeout: 5s retry_period: 1s max_retry_backoff: 300s retries: 3 follow_redirects: true backoff_on: - 429 drop_on: [] successful_on: [] proxy_url: "" # No default (optional) disable_http2: false payload: "" # No default (optional) drop_empty_bodies: true stream: enabled: false reconnect: true scanner: lines: {} auto_replay_nacks: true ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `backoff_on[]` A list of status codes that indicate a request failure and trigger retries with an increasing backoff period between attempts. **Type**: `array` **Default**: ```yaml - 429 ``` ### `basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `disable_http2` Whether to disable HTTP/2. By default, HTTP/2 is enabled. **Type**: `bool` **Default**: `false` ### `drop_empty_bodies` Whether to drop empty payloads received from the target server. **Type**: `bool` **Default**: `true` ### `drop_on[]` A list of status codes that indicate a request failure where retries should not be attempted. This helps avoid unnecessary retries for requests that are unlikely to succeed. > 📝 **NOTE** > > In these cases, the _request_ is dropped, but the _message_ that triggered the request is retained. **Type**: `array` **Default**: `[]` ### `dump_request_log_level` EXPERIMENTAL: Set the logging level for the request and response payloads of each HTTP request. **Type**: `string` **Default**: `""` **Options**: `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL`, `""` ### `extract_headers` Specify which response headers to add to the resulting messages as metadata. Header keys are automatically converted to lowercase before matching, so make sure that your patterns target the lowercase versions of the expected header keys. **Type**: `object` ### `extract_headers.include_patterns[]` A list of explicit metadata key regular expression (re2) patterns to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_patterns: - .* # --- include_patterns: - _timestamp_unix$ ``` ### `extract_headers.include_prefixes[]` A list of explicit metadata key prefixes to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_prefixes: - foo_ - bar_ # --- include_prefixes: - kafka_ # --- include_prefixes: - content- ``` ### `follow_redirects` Whether to transparently follow redirects, that is, responses with HTTP status codes in the 300-399 range. If set to `false`, the response message includes the body, status, and headers from the redirect response, and the component does not make a request to the URL specified in the `Location` header. **Type**: `bool` **Default**: `true` ### `headers` A map of headers to add to the request. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` **Default**: `{}` ```yaml # Examples: headers: Content-Type: application/octet-stream traceparent: ${! tracing_span().traceparent } ``` ### `jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `max_retry_backoff` The maximum period to wait between failed requests. **Type**: `string` **Default**: `300s` ### `metadata` Specify matching rules that determine which metadata keys should be added to the HTTP request as headers. **Type**: `object` ### `metadata.include_patterns[]` A list of explicit metadata key regular expression (re2) patterns to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_patterns: - .* # --- include_patterns: - _timestamp_unix$ ``` ### `metadata.include_prefixes[]` A list of explicit metadata key prefixes to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_prefixes: - foo_ - bar_ # --- include_prefixes: - kafka_ # --- include_prefixes: - content- ``` ### `oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `oauth2` Configures authentication with OAuth version 2 using the client credentials token flow. To exchange a refresh token instead, add a `grant_type` parameter with the value `refresh_token` and a `refresh_token` parameter with the token to `endpoint_params`. **Type**: `object` ### `oauth2.client_key` A value used to identify the client to the token provider. **Type**: `string` **Default**: `""` ### `oauth2.client_secret` The secret used to establish ownership of the client key. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth2.enabled` Whether to use OAuth version 2 in requests. **Type**: `bool` **Default**: `false` ### `oauth2.endpoint_params` A map of optional parameters to send to the token provider with client credentials token requests. Each value must be an array of strings. **Type**: `object` **Default**: `{}` ```yaml # Examples: endpoint_params: audience: - https://example.com resource: - https://api.example.com ``` ### `oauth2.scopes[]` A list of requested permissions (optional). **Type**: `array` **Default**: `[]` ### `oauth2.token_url` The URL of the token provider. **Type**: `string` **Default**: `""` ### `payload` A payload to deliver for each request (optional). This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `proxy_url` An HTTP proxy URL (optional). **Type**: `string` ### `rate_limit` A [rate limit](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/about/) to throttle requests by (optional). **Type**: `string` ### `retries` The maximum number of retry attempts to make. **Type**: `int` **Default**: `3` ### `retry_period` The period to wait between failed requests before retrying. For status codes listed in `backoff_on`, this is the starting period, which increases with each attempt up to `max_retry_backoff`. **Type**: `string` **Default**: `1s` ### `stream` Configure streaming mode, where the HTTP connection remains open and messages are processed line-by-line. Set `stream.enabled` to `true` to turn it on. **Type**: `object` ### `stream.enabled` Enables streaming mode. **Type**: `bool` **Default**: `false` ### `stream.reconnect` Whether to automatically reestablish the HTTP connection if it is lost. **Type**: `bool` **Default**: `true` ### `stream.scanner` The [scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/about/) used to split the stream of bytes into individual messages. Scanners are useful for processing large data sources efficiently without holding the entire data set in memory. For example, the `csv` scanner processes individual rows in a CSV file without loading the entire file in memory. **Type**: `scanner` **Default**: ```yaml lines: {} ``` ### `successful_on[]` A list of HTTP status codes that should be considered successful, even if they are not 2XX codes. This is useful for handling cases where non-2XX codes indicate that the request was processed successfully, such as `303 See Other` or `409 Conflict`. By default, all 2XX codes are considered successful unless they are specified in the `backoff_on` or `drop_on` fields, regardless of this field. **Type**: `array` **Default**: `[]` ### `timeout` A static timeout to apply to requests. **Type**: `string` **Default**: `5s` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL to connect to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `verb` A verb to connect with. **Type**: `string` **Default**: `GET` ```yaml # Examples: verb: POST # --- verb: GET # --- verb: DELETE ``` ## Examples ### Basic Pagination Interpolation functions within the `url` and `headers` fields can be used to reference the previously consumed message, which allows simple pagination. ```yaml input: http_client: url: >- https://api.example.com/search?query=allmyfoos&start_time=${! ( (timestamp_unix()-300).ts_format("2006-01-02T15:04:05Z","UTC").escape_url_query() ) }${! ("&next_token="+this.meta.next_token.not_null()) | "" } verb: GET rate_limit: foo_searches oauth2: enabled: true token_url: https://api.example.com/oauth2/token client_key: "${EXAMPLE_KEY}" client_secret: "${EXAMPLE_SECRET}" rate_limit_resources: - label: foo_searches local: count: 1 interval: 30s ``` --- # Page 59: http_server **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/http_server.md --- # http_server Receive messages sent over HTTP using POST requests. HTTP 2.0 is supported when using TLS, which is enabled when key and cert files are specified. #### Common ```yml input: label: "" http_server: address: "" path: /post ws_path: /post/ws allowed_verbs: - "POST" timeout: 5s rate_limit: "" ``` #### Advanced ```yml input: label: "" http_server: address: "" path: /post ws_path: /post/ws ws_welcome_message: "" ws_rate_limit_message: "" allowed_verbs: - "POST" timeout: 5s rate_limit: "" cert_file: "" key_file: "" cors: enabled: false allowed_origins: [] sync_response: status: "200" headers: Content-Type: "application/octet-stream" metadata_headers: include_prefixes: [] include_patterns: [] tcp: reuse_addr: false reuse_port: false ``` The field `rate_limit` allows you to specify an optional [`rate_limit` resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/about/), which will be applied to each HTTP request made and each websocket payload received. When the rate limit is breached HTTP requests will have a 429 response returned with a Retry-After header. Websocket payloads will be dropped and an optional response payload will be sent as per `ws_rate_limit_message`. ## Responses It’s possible to return a response for each message received using [synchronous responses](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/sync_responses/). When doing so you can customize headers with the `sync_response` field `headers`, which can also use [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries) in the value based on the response message contents. ## Endpoints The following fields specify endpoints that are registered for sending messages, and support path parameters of the form `/{foo}`, which are added to ingested messages as metadata. A path ending in `/` will match against all extensions of that path: ### `path` (defaults to `/post`) This endpoint expects POST requests where the entire request body is consumed as a single message. If the request contains a multipart `content-type` header as per [RFC1341](https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html) then the multiple parts are consumed as a batch of messages, where each body part is a message of the batch. ### `ws_path` (defaults to `/post/ws`) Creates a websocket connection, where payloads received on the socket are passed through the pipeline as a batch of one message. > ⚠️ **CAUTION: Endpoint caveats** > > Endpoint caveats > > Components within a Redpanda Connect config will register their respective endpoints in a non-deterministic order. This means that establishing precedence of endpoints that are registered via multiple `http_server` inputs or outputs (either within brokers or from cohabiting streams) is not possible in a predictable way. > > This ambiguity makes it difficult to ensure that paths which are both a subset of a path registered by a separate component, and end in a slash (`/`) and will therefore match against all extensions of that path, do not prevent the more specific path from matching against requests. > > It is therefore recommended that you ensure paths of separate components do not collide unless they are explicitly non-competing. > > For example, if you were to deploy two separate `http_server` inputs, one with a path `/foo/` and the other with a path `/foo/bar`, it would not be possible to ensure that the path `/foo/` does not swallow requests made to `/foo/bar`. You may specify an optional `ws_welcome_message`, which is a static payload to be sent to all clients once a websocket connection is first established. It’s also possible to specify a `ws_rate_limit_message`, which is a static payload to be sent to clients that have triggered the servers rate limit. ## Metadata This input adds the following metadata fields to each message: - `http_server_user_agent` - `http_server_request_path` - `http_server_verb` - `http_server_remote_ip` - All headers (only first values are taken) - All query parameters - All path parameters - All cookies If HTTPS is enabled, the following fields are added as well: - `http_server_tls_version` - `http_server_tls_subject` - `http_server_tls_cipher_suite` You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ## Examples ### Path Switching This example shows an `http_server` input that captures all requests and processes them by switching on that path: ```yaml input: http_server: path: / allowed_verbs: [ GET, POST ] sync_response: headers: Content-Type: application/json processors: - switch: - check: '@http_server_request_path == "/foo"' processors: - mapping: | root.title = "You Got Fooed!" root.result = content().string().uppercase() - check: '@http_server_request_path == "/bar"' processors: - mapping: 'root.title = "Bar Is Slow"' - sleep: # Simulate a slow endpoint duration: 1s ``` ### Mock OAuth 2.0 Server This example shows an `http_server` input that mocks an OAuth 2.0 Client Credentials flow server at the endpoint `/oauth2_test`: ```yaml input: http_server: path: /oauth2_test allowed_verbs: [ GET, POST ] sync_response: headers: Content-Type: application/json processors: - log: message: "Received request" level: INFO fields_mapping: | root = @ root.body = content().string() - mapping: | root.access_token = "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" root.token_type = "Bearer" root.expires_in = 3600 - sync_response: {} - mapping: 'root = deleted()' ``` ## Fields ### `address` An alternative address to host from. If left empty the service wide address is used. **Type**: `string` **Default**: `""` ### `allowed_verbs[]` An array of verbs that are allowed for the `path` endpoint. **Type**: `array` **Default**: ```yaml - "POST" ``` ### `cert_file` Enable TLS by specifying a certificate and key file. Only valid with a custom `address`. **Type**: `string` **Default**: `""` ### `cors` Adds Cross-Origin Resource Sharing headers. Only valid with a custom `address`. **Type**: `object` ### `cors.allowed_origins[]` An explicit list of origins that are allowed for CORS requests. **Type**: `array` **Default**: `[]` ### `cors.enabled` Whether to allow CORS requests. **Type**: `bool` **Default**: `false` ### `key_file` Enable TLS by specifying a certificate and key file. Only valid with a custom `address`. **Type**: `string` **Default**: `""` ### `path` The endpoint path to listen for POST requests. **Type**: `string` **Default**: `/post` ### `rate_limit` An optional [rate limit](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/about/) to throttle requests by. **Type**: `string` **Default**: `""` ### `sync_response` Customize messages returned via [synchronous responses](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/sync_responses/). **Type**: `object` ### `sync_response.headers` Specify headers to return with synchronous responses. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` **Default**: ```yaml Content-Type: "application/octet-stream" ``` ### `sync_response.metadata_headers` Specify criteria for which metadata values are added to the response as headers. **Type**: `object` ### `sync_response.metadata_headers.include_patterns[]` A list of explicit metadata key regular expression (re2) patterns to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_patterns: - .* # --- include_patterns: - _timestamp_unix$ ``` ### `sync_response.metadata_headers.include_prefixes[]` A list of explicit metadata key prefixes to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_prefixes: - foo_ - bar_ # --- include_prefixes: - kafka_ # --- include_prefixes: - content- ``` ### `sync_response.status` Specify the status code to return with synchronous responses. This is a string value, which allows you to customize it based on resulting payloads and their metadata. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `200` ```yaml # Examples: status: ${! json("status") } # --- status: ${! meta("status") } ``` ### `tcp` TCP listener configuration for the HTTP server. Only valid with a custom `address`. **Type**: `object` ### `tcp.reuse_addr` Enable SO_REUSEADDR, allowing binding to ports in TIME_WAIT state. Useful for graceful restarts and config reloads where the server needs to rebind to the same port immediately after shutdown. **Type**: `bool` **Default**: `false` ### `tcp.reuse_port` Enable SO_REUSEPORT, allowing multiple sockets to bind to the same port for load balancing across multiple processes/threads. **Type**: `bool` **Default**: `false` ### `timeout` Timeout for requests. If a consumed messages takes longer than this to be delivered the connection is closed, but the message may still be delivered. **Type**: `string` **Default**: `5s` ### `ws_path` The endpoint path to create websocket connections from. **Type**: `string` **Default**: `/post/ws` ### `ws_rate_limit_message` An optional message to delivery to websocket connections that are rate limited. **Type**: `string` **Default**: `""` ### `ws_welcome_message` An optional message to deliver to fresh websocket connections. **Type**: `string` **Default**: `""` --- # Page 60: inproc **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/inproc.md --- # inproc ```yml input: label: "" inproc: "" ``` Directly connect to an output within a Redpanda Connect process by referencing it by a chosen ID. It is possible to connect multiple inputs to the same inproc ID, resulting in messages dispatching in a round-robin fashion to connected inputs. However, only one output can assume an inproc ID, and will replace existing outputs if a collision occurs. --- # Page 61: jira **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/jira.md --- # jira Streams Jira issues, comments, or changelog entries via JQL with incremental polling. Periodically queries Jira’s REST API using a JQL filter and emits one message per resource. The cursor (max issue `updated` timestamp, plus the set of issue versions already emitted at the boundary) is persisted via the configured cache resource after every fully-acknowledged page, so progress survives restarts (including mid-backfill), and boundary issues are not re-emitted on every poll. Set `base_url` to the URL of your Jira instance, for example `https://your-domain.atlassian.net`. Authentication uses API token (email + token) basic auth. The `backoff` settings govern the adaptive backoff applied to 429 responses; retries of 502/503/504 responses use a fixed three-attempt policy. Each message body is the raw JSON of the resource. Metadata fields: - `jira_id` - issue key (issues) / comment ID / changelog history ID - `jira_issue_key` - parent issue key (omitted for resource=issues) - `jira_project` - project key - `jira_updated` - RFC 3339 timestamp of the resource - `jira_event_type` - "issue" / "comment" / "changelog" - `jira_self` - Jira API URL of the resource Limitations (v1): OAuth and the worklogs resource are not yet supported. For resource=comments and resource=changelog, only the first page of child resources (up to ~50 comments or ~100 changelog entries per issue update) is emitted; a WARN is logged when truncation is detected. To fetch the full child set for issues that exceed this limit, query the Jira REST API directly. > 📝 **NOTE** > > This component isn’t available in [GPU-enabled pipelines](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/resource-management/). #### Common ```yml input: label: "" jira: auth: email: "" # No default (required) api_token: "" # No default (required) resource: issues jql: "" fields: - "*all" expand: [] page_size: 50 poll_interval: 60s cursor: cache: "" # No default (required) key: "" overlap: 60s auto_replay_nacks: true base_url: "" # No default (required) timeout: 5s ``` #### Advanced ```yml input: label: "" jira: auth: email: "" # No default (required) api_token: "" # No default (required) resource: issues jql: "" fields: - "*all" expand: [] page_size: 50 poll_interval: 60s cursor: cache: "" # No default (required) key: "" overlap: 60s auto_replay_nacks: true base_url: "" # No default (required) timeout: 5s tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] proxy_url: "" disable_http2: false tps_limit: 0 tps_burst: 1 backoff: initial_interval: 1s max_interval: 30s max_retries: 3 tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s http: max_idle_conns: 100 max_idle_conns_per_host: 0 max_conns_per_host: 64 idle_conn_timeout: 1m30s tls_handshake_timeout: 10s expect_continue_timeout: 1s response_header_timeout: 0s disable_keep_alives: false disable_compression: false max_response_header_bytes: 1048576 max_response_body_bytes: 10485760 write_buffer_size: 4096 read_buffer_size: 4096 h2: strict_max_concurrent_requests: false max_decoder_header_table_size: 4096 max_encoder_header_table_size: 4096 max_read_frame_size: 16384 max_receive_buffer_per_connection: 1048576 max_receive_buffer_per_stream: 1048576 send_ping_timeout: 0s ping_timeout: 15s write_byte_timeout: 0s access_log_level: "" access_log_body_limit: 0 ``` ## Fields ### `access_log_body_limit` Maximum bytes of request/response body to include in logs. 0 to skip body logging. **Type**: `int` **Default**: `0` ### `access_log_level` Log level for HTTP request/response logging. Empty disables logging. **Type**: `string` **Default**: `""` **Options**: `""`, `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR` ### `auth` API token authentication. **Type**: `object` ### `auth.api_token` Jira API token. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.email` Email or username of the Jira account. **Type**: `string` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `backoff` Adaptive backoff configuration for 429 (Too Many Requests) responses. Always active. **Type**: `object` ### `backoff.initial_interval` Initial interval between retries on 429 responses. **Type**: `string` **Default**: `1s` ### `backoff.max_interval` Maximum interval between retries on 429 responses. **Type**: `string` **Default**: `30s` ### `backoff.max_retries` Maximum number of retries on 429 responses. **Type**: `int` **Default**: `3` ### `base_url` The base URL of the target service (for example, `https://api.example.com`). TLS is enabled automatically for `https` URLs. **Type**: `string` ### `cursor` Cursor checkpoint storage. **Type**: `object` ### `cursor.cache` Name of a cache resource used to persist the cursor. **Type**: `string` ### `cursor.key` Cache key. Defaults to `redpanda_connect_jira_input_`. **Type**: `string` **Default**: `""` ### `cursor.overlap` Widens `updated >= cursor - overlap` to absorb minute-boundary effects. Jira JQL’s `updated` operator has minute precision, so this should be set to at least 1m to have an effect. **Type**: `string` **Default**: `60s` ### `disable_http2` Disable HTTP/2 and force HTTP/1.1. **Type**: `bool` **Default**: `false` ### `expand[]` Jira `expand` query parameter. The input automatically adds `changelog` when resource=changelog. **Type**: `array` **Default**: `[]` ### `fields[]` Jira `fields` query parameter - narrow this for throughput. **Type**: `array` **Default**: ```yaml - "*all" ``` ### `http` HTTP transport settings controlling connection pooling, timeouts, and HTTP/2. **Type**: `object` ### `http.disable_compression` Disable automatic decompression of gzip responses. **Type**: `bool` **Default**: `false` ### `http.disable_keep_alives` Disable HTTP keep-alive connections; each request uses a new connection. **Type**: `bool` **Default**: `false` ### `http.expect_continue_timeout` Maximum time to wait for a server’s 100-continue response before sending the body. 0 means the body is sent immediately. **Type**: `string` **Default**: `1s` ### `http.h2` HTTP/2-specific transport settings. Only applied when HTTP/2 is enabled. **Type**: `object` ### `http.h2.max_decoder_header_table_size` Upper limit in bytes for the HPACK header table used to decode headers from the peer. Must be less than 4 MiB. **Type**: `int` **Default**: `4096` ### `http.h2.max_encoder_header_table_size` Upper limit in bytes for the HPACK header table used to encode headers sent to the peer. Must be less than 4 MiB. **Type**: `int` **Default**: `4096` ### `http.h2.max_read_frame_size` Largest HTTP/2 frame this endpoint will read. Valid range: 16 KiB to 16 MiB. **Type**: `int` **Default**: `16384` ### `http.h2.max_receive_buffer_per_connection` Maximum flow-control window size in bytes for data received on a connection. Must be at least 64 KiB and less than 4 MiB. **Type**: `int` **Default**: `1048576` ### `http.h2.max_receive_buffer_per_stream` Maximum flow-control window size in bytes for data received on a single stream. Must be less than 4 MiB. **Type**: `int` **Default**: `1048576` ### `http.h2.ping_timeout` Timeout waiting for a PING response before closing the connection. **Type**: `string` **Default**: `15s` ### `http.h2.send_ping_timeout` Idle timeout after which a PING frame is sent to verify connection health. 0 disables health checks. **Type**: `string` **Default**: `0s` ### `http.h2.strict_max_concurrent_requests` When true, new requests block when a connection’s concurrency limit is reached instead of opening a new connection. **Type**: `bool` **Default**: `false` ### `http.h2.write_byte_timeout` Timeout for writing data to a connection. The timer resets whenever bytes are written. 0 disables the timeout. **Type**: `string` **Default**: `0s` ### `http.idle_conn_timeout` How long an idle connection remains in the pool before being closed. 0 disables the timeout. **Type**: `string` **Default**: `1m30s` ### `http.max_conns_per_host` Maximum total connections (active + idle) per host. 0 means unlimited. **Type**: `int` **Default**: `64` ### `http.max_idle_conns` Maximum total number of idle (keep-alive) connections across all hosts. 0 means unlimited. **Type**: `int` **Default**: `100` ### `http.max_idle_conns_per_host` Maximum idle connections to keep per host. 0 (the default) uses GOMAXPROCS+1. **Type**: `int` **Default**: `0` ### `http.max_response_body_bytes` Maximum bytes of response body the client will read. The response body is wrapped with a limit reader; reads beyond this cap return EOF. 0 disables the limit. **Type**: `int` **Default**: `10485760` ### `http.max_response_header_bytes` Maximum bytes of response headers to allow. **Type**: `int` **Default**: `1048576` ### `http.read_buffer_size` Size in bytes of the per-connection read buffer. **Type**: `int` **Default**: `4096` ### `http.response_header_timeout` Maximum time to wait for response headers after writing the full request. 0 disables the timeout. **Type**: `string` **Default**: `0s` ### `http.tls_handshake_timeout` Maximum time to wait for a TLS handshake to complete. 0 disables the timeout. **Type**: `string` **Default**: `10s` ### `http.write_buffer_size` Size in bytes of the per-connection write buffer. **Type**: `int` **Default**: `4096` ### `jql` Jira JQL filter. The input appends an `updated >= cursor` predicate and `ORDER BY updated ASC, key ASC`. Empty means all issues visible to the principal. **Type**: `string` **Default**: `""` ### `page_size` Issues per Jira page (Jira max 100). **Type**: `int` **Default**: `50` ### `poll_interval` Time to wait between polls once the input has caught up. Minimum 10s. **Type**: `string` **Default**: `60s` ### `proxy_url` HTTP proxy URL. Empty string disables proxying. **Type**: `string` **Default**: `""` ### `resource` Which Jira resource to emit. **Type**: `string` **Default**: `issues` **Options**: `issues`, `comments`, `changelog` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `timeout` HTTP request timeout. **Type**: `string` **Default**: `5s` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `tps_burst` Maximum burst size for rate limiting. **Type**: `int` **Default**: `1` ### `tps_limit` Rate limit in requests per second. 0 disables rate limiting. **Type**: `float` **Default**: `0` --- # Page 62: kafka_franz **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/kafka_franz.md --- # kafka_franz > ⚠️ **WARNING** > > This component is deprecated and will be removed in a future version. A Kafka input using the [Franz Kafka client library](https://github.com/twmb/franz-go). This input is deprecated as of version 4.68.0. Use the [`redpanda` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda/) instead. When a consumer group is specified this input consumes one or more topics where partitions will automatically balance across any other connected clients with the same consumer group. When a consumer group is not specified topics can either be consumed in their entirety or with explicit partitions. This input often out-performs the traditional `kafka` input as well as providing more useful logs and error messages. ## Metadata This input adds the following metadata fields to each message: - `kafka_key` - `kafka_topic` - `kafka_partition` - `kafka_offset` - `kafka_lag` - `kafka_timestamp_ms` - `kafka_timestamp_unix` - `kafka_tombstone_message` - All record headers ### Common ```yml input: label: "" kafka_franz: seed_brokers: [] # No default (required) topics: [] # No default (optional) regexp_topics_include: [] # No default (optional) regexp_topics_exclude: [] # No default (optional) transaction_isolation_level: read_uncommitted consumer_group: "" # No default (optional) auto_replay_nacks: true ``` ### Advanced ```yml input: label: "" kafka_franz: seed_brokers: [] # No default (required) client_id: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] sasl: [] # No default (optional) metadata_max_age: 1m request_timeout_overhead: 10s conn_idle_timeout: 20s tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s topics: [] # No default (optional) regexp_topics_include: [] # No default (optional) regexp_topics_exclude: [] # No default (optional) rack_id: "" instance_id: "" rebalance_timeout: 45s session_timeout: 1m heartbeat_interval: 3s start_offset: earliest fetch_max_bytes: 50MiB fetch_max_wait: 5s fetch_min_bytes: 1B fetch_max_partition_bytes: 1MiB transaction_isolation_level: read_uncommitted consumer_group: "" # No default (optional) checkpoint_limit: 1024 commit_period: 5s multi_header: false batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) topic_lag_refresh_period: 5s auto_replay_nacks: true timely_nacks_maximum_wait: "" # No default (optional) ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/) that applies to individual topic partitions, so that the input batches messages together before flushing them for processing. Batching can improve performance and is useful for windowed processing. Batching this way preserves the ordering of topic partitions. **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `checkpoint_limit` The maximum number of messages that are processed in parallel inside the same partition before back pressure is applied. When a message with a specific offset is delivered to the output, the offset is only committed when all messages of previous offsets have also been delivered. This behavior ensures at-least-once delivery guarantees. However, in the event of crashes or server faults, it also increases the likelihood of duplicates. To decrease this risk, reduce the `checkpoint_limit` value. **Type**: `int` **Default**: `1024` ### `client_id` An identifier for the client connection. This identifier appears in broker logs and metrics, which helps you identify the Redpanda Connect instance that is connecting. **Type**: `string` **Default**: `redpanda-connect` ### `commit_period` The period of time between each commit of the current partition offsets to the consumer group. Offsets are always committed during shutdown. **Type**: `string` **Default**: `5s` ### `conn_idle_timeout` The approximate amount of time that connections can remain idle before they are closed. In the worst case, a connection can stay idle for up to twice this value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `20s` ### `consumer_group` An optional consumer group. When you specify this value: - The partitions of any topics specified in the `topics` field are automatically distributed across consumers that share the consumer group. - Partition offsets are automatically committed and resumed under this name. Consumer groups are not supported when you specify explicit partitions to consume from in the `topics` field. **Type**: `string` ### `fetch_max_bytes` The maximum number of bytes that a broker tries to send during a fetch. If individual records are larger than the `fetch_max_bytes` value, brokers still send them. This field is equivalent to the Java setting `fetch.max.bytes`. **Type**: `string` **Default**: `50MiB` ### `fetch_max_partition_bytes` The maximum number of bytes that are consumed from a single partition in a fetch request. This field is equivalent to the Java setting `fetch.max.partition.bytes`. If a single batch is larger than the `fetch_max_partition_bytes` value, the batch is still sent so that the client can make progress. **Type**: `string` **Default**: `1MiB` ### `fetch_max_wait` The maximum period of time a broker can wait for a fetch response to reach the required minimum number of bytes (`fetch_min_bytes`). This field is equivalent to the Java setting `fetch.max.wait.ms`. **Type**: `string` **Default**: `5s` ### `fetch_min_bytes` The minimum number of bytes that a broker tries to send during a fetch. This field is equivalent to the Java setting `fetch.min.bytes`. **Type**: `string` **Default**: `1B` ### `heartbeat_interval` When you specify a `consumer_group`, `heartbeat_interval` sets how frequently a consumer group member should send heartbeats to Apache Kafka. Apache Kafka uses heartbeats to make sure that a group member’s session is active. This value must be lower than `session_timeout`, and should be no higher than one-third of `session_timeout`. This field is equivalent to the Java `heartbeat.interval.ms` setting and accepts Go duration format strings such as `10s` or `2m`. **Type**: `string` **Default**: `3s` ### `instance_id` When you specify a `consumer_group`, set `instance_id` to define the group’s static membership, which can prevent unnecessary rebalances during reconnections. The value must be unique per consumer within the group. When you assign an instance ID, the client does not leave the consumer group when it closes. To remove the client from the group, you must use an external admin command on behalf of the instance ID. **Type**: `string` **Default**: `""` ### `metadata_max_age` The maximum period of time after which metadata is refreshed. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Lower values provide more responsive topic and partition discovery but may increase broker load. Higher values reduce broker queries but can delay detection of topology changes. This interval also controls how frequently regex topic patterns are re-evaluated to discover new matching topics. **Type**: `string` **Default**: `1m` ### `multi_header` Decode headers into lists to allow the handling of multiple values with the same key. **Type**: `bool` **Default**: `false` ### `rack_id` A rack specifies where the client is physically located, and changes fetch requests to consume from the closest replica as opposed to the leader replica. **Type**: `string` **Default**: `""` ### `rebalance_timeout` When you specify a `consumer_group`, `rebalance_timeout` sets how long consumer group members can take to complete their work and commit offsets after a rebalance has begun. The time that a member takes to detect the rebalance (from a heartbeat) counts against this timeout. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `45s` ### `regexp_topics_exclude[]` A list of regular expression patterns for excluding topics when regex mode is enabled (using `regexp_topics_include` or the deprecated `regexp_topics` boolean). Topics matching any of these patterns will be excluded from consumption, even if they match include patterns. Each pattern is a full regular expression evaluated against the complete topic name. Patterns are not anchored by default, so use `^` and `$` for exact matching. Exclude patterns are applied after include patterns, providing fine-grained control over topic selection. Example: `regexp_topics_exclude: ["^_", ".*-temp$", ".*-test.*"]` excludes topics starting with underscore, ending with `-temp`, or containing `-test`. **Type**: `array` ### `regexp_topics_include[]` A list of regular expression patterns for matching topics to consume from. When specified, the client will periodically refresh the list of matching topics based on the `metadata_max_age` interval. Each pattern is a full regular expression evaluated against the complete topic name. Patterns are not anchored by default, so `logs_.*` matches `my-logs_events` and `logs_errors`. Use `^logs_.*$` to match only topics starting with `logs_`. This field enables regex mode (replacing the deprecated `regexp_topics` boolean) and cannot be used together with explicit `topics` lists. Use `regexp_topics_exclude` to filter out specific patterns from the matched topics. Example: `regexp_topics_include: ["events_.*", "logs_.*"]` consumes from all topics starting with `events_` or `logs_`. **Type**: `array` ```yaml # Examples: regexp_topics_include: - logs_.* - metrics_.* # --- regexp_topics_include: - "events_[0-9]+" ``` ### `request_timeout_overhead` Additional time to apply as overhead when calculating request deadlines. For most requests, the deadline is this overhead alone. For requests that define their own timeout field, the overhead is added on top of that timeout, which helps prevent premature timeouts. This field is roughly equivalent to Apache Kafka’s `request.timeout.ms` parameter, but grants extra time to requests that have timeout fields. **Type**: `string` **Default**: `10s` ### `sasl[]` Specify one or more methods or mechanisms of SASL authentication. They are tried in order. If the broker supports the first SASL mechanism, all connections use it. If the first mechanism fails, the client picks the first supported mechanism. If the broker does not support any client mechanisms, all connections fail. **Type**: `array` ```yaml # Examples: sasl: - mechanism: SCRAM-SHA-512 password: bar username: foo ``` ### `sasl[].aws` Contains AWS-specific fields for when `sasl.mechanism` is set to `AWS_MSK_IAM`. **Type**: `object` ### `sasl[].aws.credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `sasl[].aws.credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `sasl[].aws.credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `sasl[].aws.credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `sasl[].aws.credentials.role` The ARN of the role to assume. **Type**: `string` ### `sasl[].aws.credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `sasl[].aws.credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `sasl[].aws.credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `sasl[].aws.endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `sasl[].aws.region` The AWS region in which your resources are hosted. **Type**: `string` ### `sasl[].aws.tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `sasl[].aws.tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].aws.tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `sasl[].aws.tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `sasl[].aws.tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].extensions` Key/value pairs to add to OAUTHBEARER authentication requests. **Type**: `object` ### `sasl[].mechanism` The SASL mechanism to use for authentication. **Type**: `string` | Option | Summary | | --- | --- | | `AWS_MSK_IAM` | AWS IAM based authentication as specified by the 'aws-msk-iam-auth' java library. | | `OAUTHBEARER` | OAuth Bearer based authentication. | | `PLAIN` | Plain text authentication. | | `REDPANDA_CLOUD_SERVICE_ACCOUNT` | Redpanda Cloud Service Account authentication when running in Redpanda Cloud. | | `SCRAM-SHA-256` | SCRAM based authentication as specified in RFC5802. | | `SCRAM-SHA-512` | SCRAM based authentication as specified in RFC5802. | | `none` | Disable sasl authentication | ### `sasl[].password` The password to use for PLAIN or SCRAM-* authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `sasl[].token` The token to use for a single session’s OAUTHBEARER authentication. **Type**: `string` **Default**: `""` ### `sasl[].username` The username to use for PLAIN or SCRAM-* authentication. **Type**: `string` **Default**: `""` ### `seed_brokers[]` A list of broker addresses used to establish connections. If an item of the list contains commas, it is expanded into multiple addresses. **Type**: `array` ```yaml # Examples: seed_brokers: - "localhost:9092" # --- seed_brokers: - "foo:9092" - "bar:9092" # --- seed_brokers: - "foo:9092,bar:9092" ``` ### `session_timeout` When you specify a `consumer_group`, `session_timeout` sets the maximum interval between heartbeats sent by a consumer group member to the broker. If a broker doesn’t receive a heartbeat from a group member before the timeout expires, it removes the member from the consumer group and initiates a rebalance. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `1m` ### `start_offset` Specify the offset from which this input starts or restarts consuming messages. Restarts occur when the `OffsetOutOfRange` error is seen during a fetch. **Type**: `string` **Default**: `earliest` | Option | Summary | | --- | --- | | `committed` | Prevents consuming a partition in a group if the partition has no prior commits. Corresponds to Kafka’s `auto.offset.reset=none` option | | `earliest` | Start from the earliest offset. Corresponds to Kafka’s `auto.offset.reset=earliest` option. | | `latest` | Start from the latest offset. Corresponds to Kafka’s `auto.offset.reset=latest` option. | ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `timely_nacks_maximum_wait` EXPERIMENTAL: Specify a maximum period of time in which each message can be consumed and awaiting either acknowledgement or rejection before rejection is instead forced. This can be useful for avoiding situations where certain downstream components can result in blocked confirmation of delivery that exceeds SLAs. Accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `topic_lag_refresh_period` The interval between consumer lag refreshes. During each cycle, this input asks the brokers for the consumer group’s committed offsets and the partition end offsets, and records the difference (the number of unread messages) for each topic partition in the consumer lag metric and the `kafka_lag` metadata field. Lag is only refreshed when `consumer_group` is set. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `5s` ### `topics[]` A list of topics to consume from. You can list multiple comma-separated topics in a single element. If you specify a `consumer_group`, partitions are automatically distributed across consumers of a topic. Otherwise, all partitions are consumed. Alternatively, add a colon after the topic name to set the explicit partitions to consume. For example, `foo:0` consumes the partition `0` of the topic `foo`. This syntax also supports ranges. For example, `foo:0-10` consumes all partitions from `0` through to `10` inclusive. Finally, add another colon after the partition to set an explicit offset to consume from. For example, `foo:0:10` consumes the partition `0` of the topic `foo` starting from the offset `10`. If the offset is not present (or remains unspecified) then the field `start_offset` determines which offset to start from. **Type**: `array` ```yaml # Examples: topics: - foo - bar # --- topics: - things.* # --- topics: - "foo,bar" # --- topics: - "foo:0" - "bar:1" - "bar:3" # --- topics: - "foo:0,bar:1,bar:3" # --- topics: - "foo:0-5" ``` ### `transaction_isolation_level` The isolation level for handling transactional messages. This setting determines how transactions are processed and affects data consistency guarantees. **Type**: `string` **Default**: `read_uncommitted` | Option | Summary | | --- | --- | | `read_committed` | If set, only committed transactional records are processed. | | `read_uncommitted` | If set, then uncommitted records are processed. | --- # Page 63: kafka **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/kafka.md --- # kafka > ⚠️ **WARNING** > > This component is deprecated and will be removed in a future version. Connects to Kafka brokers and consumes one or more topics. This input is deprecated as of version 4.68.0. Use the [`redpanda` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda/) instead. Offsets are managed within Kafka under the specified consumer group, and partitions for each topic are automatically balanced across members of the consumer group. The Kafka input allows parallel processing of messages from different topic partitions, and messages of the same topic partition are processed with a maximum parallelism determined by the field [`checkpoint_limit`](#checkpoint_limit). In order to enforce ordered processing of partition messages set the [`checkpoint_limit`](#checkpoint_limit) to `1` and this will force partitions to be processed in lock-step, where a message will only be processed once the prior message is delivered. Batching messages before processing can be enabled using the [`batching`](#batching) field, and this batching is performed per-partition such that messages of a batch will always originate from the same partition. This batching mechanism is capable of creating batches of greater size than the [`checkpoint_limit`](#checkpoint_limit), in which case the next batch will only be created upon delivery of the current one. ## Metadata This input adds the following metadata fields to each message: - `kafka_key` - `kafka_topic` - `kafka_partition` - `kafka_offset` - `kafka_lag` - `kafka_timestamp_ms` - `kafka_timestamp_unix` - `kafka_tombstone_message` - All existing message headers (version 0.11+) The field `kafka_lag` is the calculated difference between the high water mark offset of the partition at the time of ingestion and the current message offset. You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ## Ordering By default messages of a topic partition can be processed in parallel, up to a limit determined by the field `checkpoint_limit`. However, if strict ordered processing is required then this value must be set to 1 in order to process shard messages in lock-step. When doing so it is recommended that you perform batching at this component for performance as it will not be possible to batch lock-stepped messages at the output level. ## Troubleshooting - I’m seeing logs that report `Failed to connect to kafka: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)`, but the brokers are definitely reachable. Unfortunately this error message will appear for a wide range of connection problems even when the broker endpoint can be reached. Double check your authentication configuration and also ensure that you have [enabled TLS](#tls-enabled) if applicable. ### Common ```yml input: label: "" kafka: addresses: [] # No default (required) topics: [] # No default (required) target_version: "" # No default (optional) consumer_group: "" checkpoint_limit: 1024 auto_replay_nacks: true ``` ### Advanced ```yml input: label: "" kafka: addresses: [] # No default (required) topics: [] # No default (required) target_version: "" # No default (optional) tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] sasl: mechanism: none user: "" password: "" access_token: "" token_cache: "" token_key: "" consumer_group: "" client_id: benthos instance_id: "" # No default (optional) rack_id: "" start_from_oldest: true checkpoint_limit: 1024 auto_replay_nacks: true timely_nacks_maximum_wait: "" # No default (optional) commit_period: 1s max_processing_period: 100ms extract_tracing_map: "" # No default (optional) group: session_timeout: 10s heartbeat_interval: 3s rebalance_timeout: 60s fetch_buffer_cap: 256 multi_header: false batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `addresses[]` A list of broker addresses to connect to. List items that contain commas are expanded into multiple addresses. **Type**: `array` ```yaml # Examples: addresses: - "localhost:9092" # --- addresses: - "localhost:9041,localhost:9042" # --- addresses: - "localhost:9041" - "localhost:9042" ``` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `checkpoint_limit` The maximum number of messages of the same topic and partition that can be processed at a given time. Increasing this limit enables parallel processing and batching at the output level to work on individual partitions. Any given offset will not be committed unless all messages under that offset are delivered in order to preserve at least once delivery guarantees. **Type**: `int` **Default**: `1024` ### `client_id` The client ID sent to brokers with every request, which lets brokers attribute requests to this client in their logs, metrics, and client quotas. **Type**: `string` **Default**: `benthos` ### `commit_period` The period of time between each commit of the current partition offsets to the consumer group. Offsets are always committed during shutdown. **Type**: `string` **Default**: `1s` ### `consumer_group` An identifier for the consumer group of the connection. This field can be explicitly made empty in order to disable stored offsets for the consumed topic partitions. **Type**: `string` **Default**: `""` ### `extract_tracing_map` EXPERIMENTAL: A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that attempts to extract an object containing tracing propagation information, which is then used as the root tracing span for the message. The specification of the extracted fields must match the format used by the service wide tracer. **Type**: `string` ```yaml # Examples: extract_tracing_map: root = @ # --- extract_tracing_map: root = this.meta.span ``` ### `fetch_buffer_cap` The maximum number of unprocessed messages to fetch at a given time. **Type**: `int` **Default**: `256` ### `group` Tuning parameters for consumer group synchronization. **Type**: `object` ### `group.heartbeat_interval` A period in which heartbeats should be sent out. **Type**: `string` **Default**: `3s` ### `group.rebalance_timeout` A period after which rebalancing is abandoned if unresolved. **Type**: `string` **Default**: `60s` ### `group.session_timeout` A period after which a consumer of the group is kicked after no heartbeats. **Type**: `string` **Default**: `10s` ### `instance_id` When you specify a `consumer_group`, assign a unique value to `instance_id` for each input so that brokers can identify it across restarts of this process and avoid unnecessary rebalances. **Type**: `string` ### `max_processing_period` A maximum estimate for the time taken to process a message, this is used for tuning consumer group synchronization. **Type**: `string` **Default**: `100ms` ### `multi_header` Decode headers into lists to allow handling of multiple values with the same key **Type**: `bool` **Default**: `false` ### `rack_id` A rack identifier for this client. **Type**: `string` **Default**: `""` ### `sasl` Enables SASL authentication. **Type**: `object` ### `sasl.access_token` A static OAUTHBEARER access token **Type**: `string` **Default**: `""` ### `sasl.mechanism` The SASL authentication mechanism, if left empty SASL authentication is not used. **Type**: `string` **Default**: `none` | Option | Summary | | --- | --- | | `OAUTHBEARER` | OAuth Bearer based authentication. | | `PLAIN` | Plain text authentication. NOTE: When using plain text auth it is extremely likely that you’ll also need to [enable TLS](#tls-enabled). | | `SCRAM-SHA-256` | Authentication using the SCRAM-SHA-256 mechanism. | | `SCRAM-SHA-512` | Authentication using the SCRAM-SHA-512 mechanism. | | `none` | Default, no SASL authentication. | ### `sasl.password` A PLAIN password. It is recommended that you use environment variables to populate this field. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: ${PASSWORD} ``` ### `sasl.token_cache` Instead of using a static `access_token` allows you to query a [`cache`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) resource to fetch OAUTHBEARER tokens from **Type**: `string` **Default**: `""` ### `sasl.token_key` Required when using a `token_cache`, the key to query the cache with for tokens. **Type**: `string` **Default**: `""` ### `sasl.user` A PLAIN username. It is recommended that you use environment variables to populate this field. **Type**: `string` **Default**: `""` ```yaml # Examples: user: ${USER} ``` ### `start_from_oldest` Determines whether to consume from the oldest available offset, otherwise messages are consumed from the latest offset. The setting is applied when creating a new consumer group or the saved offset no longer exists. **Type**: `bool` **Default**: `true` ### `target_version` The version of the Kafka protocol to use. This limits the capabilities used by the client and should ideally match the version of your brokers. Defaults to the oldest supported stable version. **Type**: `string` ```yaml # Examples: target_version: 2.8.0 # --- target_version: 3.1.0 ``` ### `timely_nacks_maximum_wait` EXPERIMENTAL: Specify a maximum period of time in which each message can be consumed and awaiting either acknowledgement or rejection before rejection is instead forced. This can be useful for avoiding situations where certain downstream components can result in blocked confirmation of delivery that exceeds SLAs. Accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `topics[]` A list of topics to consume from. Multiple comma separated topics can be listed in a single element. Partitions are automatically distributed across consumers of a topic. Alternatively, it’s possible to specify explicit partitions to consume from with a colon after the topic name. For example `foo:0` would consume the partition 0 of the topic foo. This syntax supports ranges. For example `foo:0-10` would consume partitions 0 through to 10 inclusive. **Type**: `array` ```yaml # Examples: topics: - foo - bar # --- topics: - "foo,bar" # --- topics: - "foo:0" - "bar:1" - "bar:3" # --- topics: - "foo:0,bar:1,bar:3" # --- topics: - "foo:0-5" ``` --- # Page 64: microsoft_sql_server_cdc **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/microsoft_sql_server_cdc.md --- # microsoft_sql_server_cdc Enables Change Data Capture by consuming from Microsoft SQL Server’s change tables. Streams changes from a Microsoft SQL Server database for Change Data Capture (CDC). Additionally, if `stream_snapshot` is set to true, then the existing data in the database is also streamed too. ## Metadata This input adds the following metadata fields to each message: - `database_schema` (The database schema for the table where the message originates from) - `schema` (The table schema in benthos common schema format, compatible with processors like `parquet_encode`) - `table` (Name of the table that the message originated from) - `operation` (Type of operation that generated the message: `read`, `delete`, `insert`, or `update_before` and `update_after`. `read` is from messages that are read in the initial snapshot phase.) - `lsn` (The commit Log Sequence Number of the change, from the change table column `__$start_lsn`. Not present on snapshot (`read`) messages.) - `seqval` (The position of the change in the transaction log, from the change table column `__$seqval`, as a hexadecimal string with a `0x` prefix. Not present on snapshot (`read`) messages.) - `command_id` (The order of the statement within its transaction, from the change table column `__$command_id`. Not present on snapshot (`read`) messages.) ## Ordering Change messages are emitted in the order SQL Server recorded them: by `lsn` first, then by `command_id`. All rows of one transaction share one `lsn`, so `lsn` alone does not order changes inside a transaction. Use `command_id` for that. The `update_before` and `update_after` rows of one `UPDATE` statement share `lsn`, `seqval` and `command_id`. Use `operation` to tell them apart: `update_before` is always emitted first. ## Permissions When using the default Microsoft SQL Server based cache, the Connect user requires permission to create tables and stored procedures. The `rpcn` schema must also already exist. Refer to [`checkpoint_cache_table_name`](#checkpoint_cache_table_name) for more information. When `stream_snapshot` is `true`, the database must allow snapshot isolation, because each table is snapshotted in a transaction at `SNAPSHOT` isolation so that its rows are read as one consistent view. Enable it with `ALTER DATABASE SET ALLOW_SNAPSHOT_ISOLATION ON`, which requires `ALTER` permission on the database. Otherwise the snapshot fails with an error such as `Snapshot isolation transaction failed accessing database …​ because snapshot isolation is not allowed in this database`. This setting is separate from `READ_COMMITTED_SNAPSHOT` and does not change the isolation level of other sessions, but SQL Server then keeps row versions in `tempdb` for updates and deletes. Streaming from the change tables does not need it. ## Performance This input does not read the transaction log directly: SQL Server’s CDC capture job scans the log asynchronously and publishes rows into per-table change tables, which this input polls. The capture job is an upstream throughput ceiling shared by every CDC consumer. Delivery is inherently bursty: short idle periods followed by large batches are normal under heavy write load. This reflects the capture job’s publication cadence, not this input. Under sustained load the practical ceiling is usually the database server’s storage bandwidth rather than CPU. CDC multiplies physical write volume several times over across the base table, transaction log, change tables and checkpoints. The input itself needs very little CPU to keep pace with the capture job. Operational notes: - `TRUNCATE TABLE` is rejected on a CDC-enabled table. To clear one, disable CDC on the table, truncate, then re-enable. - On AWS RDS, enable CDC with `msdb.dbo.rds_cdc_enable_db`: `sys.sp_cdc_enable_db` requires sysadmin, which RDS does not grant. - Do not stop the CDC capture job (`cdc._capture`): while it is stopped nothing is published to the change tables, so this input reads nothing and reports no error. ### Common ```yaml input: label: "" microsoft_sql_server_cdc: connection_string: "" # No default (required) stream_snapshot: false max_parallel_snapshot_tables: 1 snapshot_max_batch_size: 1000 include: [] # No default (required) exclude: [] # No default (optional) checkpoint_cache: "" # No default (optional) checkpoint_cache_table_name: rpcn.CdcCheckpointCache checkpoint_cache_connection_string: "" # No default (optional) checkpoint_cache_key: microsoft_sql_server_cdc checkpoint_limit: 1024 stream_backoff_interval: 5s auto_replay_nacks: true batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yaml input: label: "" microsoft_sql_server_cdc: connection_string: "" # No default (required) stream_snapshot: false max_parallel_snapshot_tables: 1 snapshot_max_batch_size: 1000 include: [] # No default (required) exclude: [] # No default (optional) checkpoint_cache: "" # No default (optional) checkpoint_cache_table_name: rpcn.CdcCheckpointCache checkpoint_cache_connection_string: "" # No default (optional) checkpoint_cache_key: microsoft_sql_server_cdc checkpoint_limit: 1024 stream_backoff_interval: 5s auto_replay_nacks: true batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `checkpoint_cache` A [cache resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) to store the current Log Sequence Number (LSN) position. The cache stores the highest LSN that has been successfully delivered downstream, which allows Redpanda Connect to resume from the last processed position after a restart, rather than consume the entire state of the change table. If not set, the default Microsoft SQL Server based cache is used. See `checkpoint_cache_table_name` for more information. **Type**: `string` ### `checkpoint_cache_connection_string` An optional connection string for a remote Microsoft SQL Server to use for the checkpoint cache. When set, this creates the checkpoint cache table on the remote server instead of the source database. If `checkpoint_cache` is also set, that takes precedence. **Type**: `string` ```yaml # Examples: checkpoint_cache_connection_string: sqlserver://username:password@remotehost/instance?param1=value¶m2=value ``` ### `checkpoint_cache_key` The key to use to store the snapshot position in `checkpoint_cache`. An alternative key can be provided if multiple CDC inputs share the same cache. **Type**: `string` **Default**: `microsoft_sql_server_cdc` ### `checkpoint_cache_table_name` The multipart identifier for the checkpoint cache table name. If no `checkpoint_cache` field is specified, this input will automatically create a table and stored procedure under the `rpcn` schema to act as a checkpoint cache. This table stores the latest processed Log Sequence Number (LSN) that has been successfully delivered, allowing Redpanda Connect to resume from that point upon restart rather than reconsume the entire change table. **Type**: `string` **Default**: `rpcn.CdcCheckpointCache` ```yaml # Examples: checkpoint_cache_table_name: dbo.checkpoint_cache ``` ### `checkpoint_limit` The maximum number of messages that can be processed concurrently before applying back pressure. Higher values enable more parallel processing and batching at the output level, but increase memory usage. To preserve at-least-once delivery guarantees, a given Log Sequence Number (LSN) is only acknowledged after all messages under that offset are delivered. **Type**: `int` **Default**: `1024` ### `connection_string` The connection string for the Microsoft SQL Server database. Use the format `sqlserver://username:password@host/instance?param1=value¶m2=value`. For Windows Authentication, use `sqlserver://host/instance?trusted_connection=yes`. Include additional parameters like `TrustServerCertificate=true` for self-signed certificates or `encrypt=disable` to disable encryption. **Type**: `string` ```yaml # Examples: connection_string: sqlserver://username:password@host/instance?param1=value¶m2=value ``` ### `exclude[]` Regular expressions for tables to exclude from CDC streaming. Use this to filter out specific tables from the include patterns. Table names should follow the `schema.table` format. Exclude patterns are applied after include patterns, allowing you to include broad patterns while excluding specific tables. **Type**: `array` ```yaml # Examples: exclude: dbo.privatetable ``` ### `include[]` Regular expressions for tables to include in CDC streaming. Specify table names using the format `schema.table` (such as `dbo.orders`, `sales.customers`). Each pattern is treated as a regular expression, allowing wildcards and pattern matching. All specified tables must have CDC enabled in SQL Server. **Type**: `array` ```yaml # Examples: include: dbo.products ``` ### `max_parallel_snapshot_tables` The maximum number of snapshot readers that run in parallel during the initial snapshot. Each table is read by its own reader. **Type**: `int` **Default**: `1` ### `snapshot_max_batch_size` The maximum number of rows to stream in a single batch during the initial snapshot phase. Larger batch sizes can improve throughput for initial data loads but may increase memory usage. This setting only applies when `stream_snapshot` is enabled. **Type**: `int` **Default**: `1000` ### `stream_backoff_interval` The interval to wait before checking for new changes after a pass over the change tables completes. Each pass drains changes up to the maximum LSN observed as the pass began, then waits for this interval while SQL Server’s capture job continues to publish changes. For low-traffic tables, increasing this value reduces query load on the server. For high-traffic tables, a longer interval directly reduces throughput, because the input sits idle for the full interval between passes. Consider lowering it towards `500ms`, which matches the default poll interval of comparable CDC systems. Use Go duration format such as `500ms`, `5s`, or `1m`. **Type**: `string` **Default**: `5s` ```yaml # Examples: stream_backoff_interval: 500ms # --- stream_backoff_interval: 5s # --- stream_backoff_interval: 1m ``` ### `stream_snapshot` Whether to stream a snapshot of all existing data before streaming CDC changes. When set to `true`, the connector first queries all existing table data, then switches to streaming incremental changes from the change tables. When set to `false`, no snapshot is taken and, on first run, streaming begins from the start of each table’s existing change table: every change retained by SQL Server’s CDC capture and cleanup jobs (three days by default) is replayed, not only changes from the current LSN onward. To begin from the present on a table that already holds change history, disable and re-enable CDC on the table immediately before starting the pipeline so that its change table starts empty. The snapshot reads each table in a transaction at `SNAPSHOT` isolation, so the database must allow it: run `ALTER DATABASE SET ALLOW_SNAPSHOT_ISOLATION ON` before enabling this field. **Type**: `bool` **Default**: `false` ```yaml # Examples: stream_snapshot: true ``` --- # Page 65: mongodb_cdc **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/mongodb_cdc.md --- # mongodb_cdc Streams changes from a MongoDB replica set. Read from a MongoDB replica set using [change streams](https://www.mongodb.com/docs/manual/changeStreams/). It’s only possible to watch for changes when using a sharded MongoDB or a MongoDB cluster running as a replica set. Use [`collections`](#collections) to choose which collections in the database to stream changes from. If a stored resume position can no longer be resumed (for example it has aged out of the oplog), the input clears its checkpoint and re-runs the snapshot rather than retrying a dead position. After 2 such recoveries in a row without the change stream ever advancing in between - which usually means the snapshot is taking longer than the oplog window - the next failure keeps the checkpoint and the input fails on every reconnect with an actionable error instead of re-snapshotting forever; after addressing the cause, restart the pipeline (or delete the checkpoint cache entry) to resume recovery. With neither `stream_snapshot` nor `incremental_snapshot.enabled` set, there is no snapshot to re-run, so recovery would have to skip the changes between the lost position and now. The input refuses to do that silently: by default it fails with an error on every reconnect and preserves the checkpoint, and skipping the gap has to be opted into with `on_unresumable_position: reset`. By default MongoDB does not propagate changes in all cases. In order to capture all changes (including deletes) in a MongoDB cluster one needs to enable pre and post image saving and the [collections](#collections) also need to enable saving these pre and post images. For more information see [MongoDB documentation](https://www.mongodb.com/docs/manual/changeStreams/#change-streams-with-document-pre—​and-post-images) and the [`document_mode`](#document_mode) options. ## Snapshot and streaming modes When `stream_snapshot` is `true` and `checkpoint_cache` holds no stream position, this input records the current change stream position, reads all documents in the selected collections using `snapshot_parallelism` connections, and then streams the changes made since the recorded position. Snapshot progress is not checkpointed, so if the pipeline restarts before the snapshot completes, the snapshot runs again from the start. Once the snapshot completes and is acknowledged, its position is stored in `checkpoint_cache`, so later restarts resume the stream without another snapshot. When `snapshot_parallelism` is greater than `1`, this input reads the snapshot in parallel by splitting each collection into chunks with the `splitVector` command. In environments where `splitVector` is not available, such as MongoDB Atlas, set [`snapshot_auto_bucket_sharding`](#snapshot_auto_bucket_sharding) to `true` to compute the chunks with the `$bucketAuto` aggregation stage instead. When `stream_snapshot` is `false` and no position is stored, this input starts streaming from the latest position in the [operations log (oplog)](https://www.mongodb.com/docs/manual/core/replica-set-oplog/). In both modes, a restart resumes streaming from the position stored in `checkpoint_cache`. ## Incremental snapshots With `incremental_snapshot.enabled: true` the snapshot no longer holds back streaming. This is mutually exclusive with `stream_snapshot`: both read the same documents, so enabling both would deliver everything twice. On a first start the input streams changes immediately and reads every collection in `incremental_snapshot.chunk_size` chunks, in `_id` order, between them. Each chunk is released once the change stream has caught up with the moment it was read, and any document the stream changed meanwhile is dropped from the chunk, so a document is never emitted older than a change already streamed for it. Chunks are read from the primary whatever the read preference in `url`, which still applies to the change stream: a lagging secondary could return documents older than changes already streamed. Progress is stored in `checkpoint_cache` under `incremental_snapshot.checkpoint_cache_key`, so a restart, for example after a credential expiry, continues from the last acknowledged chunk rather than starting over. The progress is written again with every stream position, so a cache with a TTL expires both together. A collection added to `collections` is read on the next start, while the others carry on streaming. Turning on `incremental_snapshot.enabled` in a pipeline that already has a stream position stored, whether it ran with `stream_snapshot` or without it, reads nothing: with a stored position and no stored snapshot progress, every collection counts as read. To backfill such a pipeline, set `signal_collection_name` and send a `snapshot-execute` signal. A `snapshot-execute` [signal](#signals) reads a collection on request, in every snapshot mode: the same chunked read also serves pipelines running with `stream_snapshot` or with no snapshot at all. Documents from a chunk have the operation set to "read" and the operation time of the chunk read. Collections are read one at a time, so `snapshot_parallelism` and `snapshot_auto_bucket_sharding` do not apply. Chunks are bounded by index ranges rather than comparisons, so a collection whose `_id` values mix BSON types is read in full. A document can be delivered twice, once streamed and once in a chunk: when it is inserted after streaming starts and before its chunk is read. Treat documents as idempotent upserts keyed by `_id`, as is standard CDC practice. With `document_mode: partial_update`, an update streamed while its document is buffered replaces the chunk’s full document with the update description alone, so a consumer that has not seen the document before receives only the delta; prefer `update_lookup` or `pre_and_post_images` with incremental snapshots. On sharded collections documents are matched on `_id` alone. MongoDB does not enforce a unique `_id` across shards unless `_id` is the shard key, so make sure your application keeps it unique. Otherwise the snapshot can skip documents that share an `_id`. A chunk can only be released once the change stream has passed the moment it was read. On a busy deployment that happens almost at once, and on a quiet replica set the input releases several chunks per poll. A quiet sharded cluster is slower: its change stream only advances as far as its least active shard, which moves on with its periodic no-op write, every 10 seconds by default (the shards' `periodicNoopIntervalSecs`). Expect about one chunk per interval there, and raise `incremental_snapshot.chunk_size` to compensate, with `checkpoint_limit` raised to at least twice that. Progress is reported through metrics: `mongodb_cdc_incremental_snapshot_collections_remaining` counts the collections still to read, `mongodb_cdc_incremental_snapshot_documents_released` and `mongodb_cdc_incremental_snapshot_chunks_released` count what has been released per collection, and `mongodb_cdc_incremental_snapshot_chunks_deferred` counts chunk reads deferred after a transient failure. The start and end of each collection’s read are logged at info level. ## Signals When `signal_collection_name` is set, documents inserted into that collection control the input while it runs. Each signal has a `type` and a `data` field, which may be an embedded document or a JSON string: - `log`: logs `data.message` at info level, for example `{"type": "log", "data": {"message": "hello"}}`. - `snapshot-execute`: reads the named collections incrementally, alongside streaming, for example `{"type": "snapshot-execute", "data": {"collections": ["orders"]}}` (`tables` is accepted as an alias of `collections`). Each named collection must also be in `collections`, because the input only watches those for changes. If a signal names any other collection, the input skips the whole signal and logs an error. A collection already read is read again, which makes the signal a way to re-read a collection on demand; one still queued or being read is not queued twice. The read works the same in every snapshot mode. It does not need `incremental_snapshot.enabled`: with `stream_snapshot`, or with no snapshot at all, the named collections are read in `incremental_snapshot.chunk_size` chunks between change events, exactly as described under [incremental snapshots](#incremental-snapshots), and the same `retry_cooldown` and duplicate-delivery notes apply. Nothing is read until a signal asks for it, a collection added to `collections` later included: only `incremental_snapshot.enabled` reads one on the next start. Progress is stored under `incremental_snapshot.checkpoint_cache_key` alongside the stream position, so a restart continues a requested read from the last acknowledged chunk rather than losing the request. Malformed signals and unknown types are logged and skipped. Updates and deletes in the signal collection are ignored. Signal inserts are emitted as regular messages (`operation=insert`, `collection=`), the same as `postgres_cdc` and `aws_dynamodb_cdc` emit their signals. To keep them out of the output, filter on the `collection` metadata field: ```yaml pipeline: processors: - mapping: | root = if @collection == "rpcn_signals" { deleted() } else { this } ``` ## Scaling All configured collections are consumed through a single database-level change stream: the collection list is a server-side filter on that one stream, not a set of independent streams. Because a change stream is one totally-ordered cursor over the replica set’s oplog, throughput does not increase with additional collections, and CPU beyond roughly two cores is not used. This is a property of MongoDB change streams rather than of this input. To scale beyond the single-stream ceiling, shard the cluster: a change stream against a sharded cluster merges parallel per-shard cursors on the server side. Size the oplog for consumer lag: a change stream resumes from a position in the oplog, so if this input falls behind, or is stopped, for longer than the oplog retains data, the resume position is lost and the stream is invalidated. Ensure the oplog window comfortably exceeds the longest expected lag or downtime under peak write load. ## Metadata Each message emitted by this plugin has the following metadata: - `operation`: Either `insert`, `replace`, `delete`, or `update` for changes streamed. Documents from a snapshot have the operation set to `read`. - `collection`: The collection the document was written to. - `operation_time`: The oplog time for when this operation occurred. - `schema`: The collection schema in benthos common schema format (set as immutable metadata). Extracted from the collection’s `$jsonSchema` validator if available, otherwise inferred from the first document seen. Not present on messages where no schema could be determined (for example, deletes without pre-images when no prior schema is cached). ## Schema Detection Schema metadata is discovered using a two-tier strategy: 1. **$jsonSchema validators** are preferred and queried at startup for each watched collection. When a validator exists, the schema provides accurate type information and required/optional field classification. 2. When no validator exists, schema is **inferred from the first document** received per collection. All fields are marked optional. **Change detection:** when a document’s top-level field set differs from the cached schema, the schema is re-inferred from that document. This applies to both validator-sourced and inference-sourced schemas. **Limitations:** type changes within existing fields and structural changes inside nested subdocuments are not detected automatically. Restart the input to force a full schema refresh. **Fields with null values, unknown BSON types, or mixed-type arrays** are mapped to the `Any` schema type. The `parquet_encode` processor does not support `Any` and will error if it encounters one. Add an upstream processor (for example, `mapping`) to convert or remove these fields before `parquet_encode`. **Schema stability:** MongoDB collections may contain documents with varying field sets. When this occurs, the schema updates on each structural change, which can cause frequent schema version bumps in schema registries with compatibility modes. For schema registry targets, configuring a `$jsonSchema` validator on the collection is strongly recommended. ### Common ```yml input: label: "" mongodb_cdc: url: "" # No default (required) database: "" # No default (required) username: "" password: "" collections: [] # No default (required) checkpoint_key: mongodb_cdc_checkpoint checkpoint_cache: "" # No default (required) checkpoint_interval: 5s checkpoint_limit: 1000 read_batch_size: 1000 read_max_wait: 1s stream_snapshot: false snapshot_parallelism: 1 signal_collection_name: "" # No default (optional) auto_replay_nacks: true ``` ### Advanced ```yml input: label: "" mongodb_cdc: url: "" # No default (required) database: "" # No default (required) username: "" password: "" aws: enabled: false region: "" # No default (optional) session_duration: 1h id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) roles: [] # No default (optional) collections: [] # No default (required) checkpoint_key: mongodb_cdc_checkpoint checkpoint_cache: "" # No default (required) checkpoint_interval: 5s checkpoint_limit: 1000 checkpoint_write_timeout: 10s on_unresumable_position: fail read_batch_size: 1000 read_max_wait: 1s stream_snapshot: false snapshot_parallelism: 1 snapshot_auto_bucket_sharding: false incremental_snapshot: enabled: false chunk_size: 500 checkpoint_cache_key: "" retry_cooldown: 5s signal_collection_name: "" # No default (optional) document_mode: update_lookup json_marshal_mode: canonical app_name: benthos auto_replay_nacks: true ``` ## Prerequisites - MongoDB version 6 or later - Network access from the cluster where your Redpanda Connect pipeline is running to the source database environment. For detailed networking information, including how to set up a VPC peering connection, see [Redpanda Cloud Networking](https://docs.redpanda.com/cloud-data-platform/networking/). - A MongoDB database running as a [replica set](https://www.mongodb.com/docs/manual/replication/#replication-in-mongodb) or in a [sharded cluster](https://www.mongodb.com/docs/manual/sharding/) using replica set [protocol version 1](https://www.mongodb.com/docs/manual/reference/replica-configuration/#rsconf.protocolVersion). - A MongoDB database using the [WiredTiger](https://www.mongodb.com/docs/manual/core/wiredtiger/#storage-wiredtiger) storage engine. ## Enable connectivity from cloud-based data sources (BYOC) To establish a secure connection between a cloud-based data source and Redpanda Connect, you must add the NAT Gateway IP address of your Redpanda cluster to the allowlist of your data source. See [Allow Pipeline Traffic Through External Firewalls](https://docs.redpanda.com/cloud-data-platform/networking/connect-external-allowlist/). ## Fields ### `app_name` The client application name. **Type**: `string` **Default**: `benthos` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `aws` AWS IAM authentication using the `MONGODB-AWS` mechanism, for example against MongoDB Atlas. When enabled, IAM credentials are used instead of a static username and password. Role-derived session credentials are resolved when the component connects and are re-resolved whenever it reconnects. The `mongodb` processor and cache establish their client once at creation and cannot refresh expiring session credentials, so `role`, `roles` and session tokens are rejected for those components; use the ambient credential chain or long-lived access keys with them. For long-running pipelines, prefer the ambient credential chain (leave keys and roles unset), which the driver refreshes automatically. **Type**: `object` ### `aws.enabled` Enable AWS IAM authentication using the driver-native `MONGODB-AWS` mechanism. The MongoDB Atlas database user must be created with the AWS IAM authentication type, and connections require TLS. When no static credentials or roles are configured, the ambient AWS credential chain (environment variables, EC2 instance profile, EKS pod role) is used and expiring credentials are refreshed automatically. **Type**: `bool` **Default**: `false` ### `aws.id` The AWS access key ID to authenticate with. When empty, the default AWS credential chain is used. **Type**: `string` ### `aws.region` The AWS region used when assuming roles (for STS calls). Only used when `role` or `roles` are configured; the ambient and static-key paths ignore it. If no region is specified then the environment default is used. **Type**: `string` ### `aws.role` Optional AWS IAM role ARN to assume for authentication. Cannot be combined with `roles`; use the `roles` array instead when chaining multiple roles. **Type**: `string` ### `aws.role_external_id` Optional external ID to use when assuming the role set in `role`. Each entry in `roles` sets its own external ID. **Type**: `string` ### `aws.roles[]` Optional array of AWS IAM roles to assume for authentication. Roles are assumed in sequence, each using the credentials of the previous one, enabling chaining for purposes such as cross-account access. Each role can optionally specify an external ID. Cannot be combined with `role`. **Type**: `array` ### `aws.roles[].role` AWS IAM role ARN to assume. **Type**: `string` **Default**: `""` ### `aws.roles[].role_external_id` Optional external ID for the role assumption. **Type**: `string` **Default**: `""` ### `aws.secret` The AWS secret access key that pairs with `id`. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `aws.session_duration` The duration of the STS session requested when assuming roles. AWS requires at least 15 minutes and caps sessions created through role chaining at one hour. Only used when `role` or `roles` are configured. For long-running pipelines, prefer the ambient credential chain over a fixed session duration, since the driver refreshes ambient credentials automatically as they near expiry. When using role assumption with this input, credentials are freshly resolved after the initial snapshot completes, so the streaming phase starts with a full session. With `stream_snapshot`, the snapshot itself must still complete within a single session duration: snapshot progress is not checkpointed, so a credential expiry mid-snapshot restarts the snapshot from scratch after reconnecting. With `incremental_snapshot.enabled`, snapshot progress is checkpointed, so a credential expiry does not restart the snapshot: after reconnecting, the input continues from the last acknowledged chunk. Once the snapshot completes and is fully acknowledged, its position is checkpointed, so later restarts resume the stream without re-running the snapshot. **Type**: `string` **Default**: `1h` ### `aws.token` The AWS session token to use with `id` and `secret`. Required only when using short-term credentials. **Type**: `string` ### `checkpoint_cache` Specify a [`cache` resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) to store the oplog position for the most recent data update streamed to Redpanda Connect. After a restart, Redpanda Connect can continue processing changes from this position, avoiding the need to reprocess all collection updates. **Type**: `string` ### `checkpoint_interval` The interval between writing checkpoints to the cache. **Type**: `string` **Default**: `5s` ### `checkpoint_key` The key identifier used to store the stream’s resume position in `checkpoint_cache`. If you have multiple `mongodb_cdc` inputs sharing the same cache, you can provide an alternative key. **Type**: `string` **Default**: `mongodb_cdc_checkpoint` ### `checkpoint_limit` The maximum number of in-flight messages emitted from this input. Increasing this limit enables parallel processing, and batching at the output level. To preserve at-least-once guarantees, the stream’s resume position is only checkpointed once all messages before it are delivered. **Type**: `int` **Default**: `1000` ### `checkpoint_write_timeout` Bounds the checkpoint writes that run outside the normal read loop - storing the position a completed snapshot reached, and clearing a position that can no longer be resumed from - so that a shutdown racing either of them is not extended indefinitely by a slow cache. Raise this for slow remote caches (for example `redis` or `dynamodb`), where losing the post-snapshot write costs a full re-snapshot on the next start. **Type**: `string` **Default**: `10s` ### `collections[]` A list of collections to stream changes from. Specify each collection name as a separate item. **Type**: `array` ### `database` The name of the MongoDB database to stream changes from. **Type**: `string` ### `document_mode` The mode in which MongoDB emits document changes to Redpanda Connect, specifically updates and deletes. **Type**: `string` **Default**: `update_lookup` | Option | Summary | | --- | --- | | `partial_update` | In this mode update operations only have a description of the update operation, which follows the following schema: { "\_id": , "operations": \[ # type == set means that the value was updated like so: # root.foo."bar.baz" = "world" {"path": \["foo", "bar.baz"\], "type": "set", "value":"world"}, # type == unset means that the value was deleted like so: # root.qux = deleted() {"path": \["qux"\], "type": "unset", "value": null}, # type == truncatedArray means that the array at that path was truncated to value number of elements # root.array = this.array.slice(2) {"path": \["array"\], "type": "truncatedArray", "value": 2} \] } | | `pre_and_post_images` | Uses pre and post image collection to emit the full documents for update and delete operations. To use and configure this mode see the setup steps in the [MongoDB documentation](https://www.mongodb.com/docs/manual/changeStreams/#change-streams-with-document-pre—​and-post-images). | | `update_lookup` | In this mode insert, replace and update operations have the full document emitted and deletes only have the \_id field populated. Documents updates lookup the full document. This corresponds to the updateLookup option, see the [MongoDB documentation](https://www.mongodb.com/docs/manual/changeStreams/#std-label-change-streams-updateLookup) for more information. | ### `incremental_snapshot` Configures chunked snapshotting that runs alongside change streaming. With `enabled` every collection is read this way on the first start; the other settings also govern the reads a `snapshot-execute` signal requests through `signal_collection_name`, which work in every snapshot mode. **Type**: `object` ### `incremental_snapshot.checkpoint_cache_key` The key used to store the incremental snapshot’s progress in `checkpoint_cache`, alongside the stream position. Defaults to `checkpoint_key` with `_incremental_snapshot` appended, so inputs with distinct `checkpoint_key` values never share progress. If you delete the stored progress, or change this key, while a stream position is stored, a restart treats every collection as read. To read a collection again, send a `snapshot-execute` signal. Unlike `postgres_cdc`, a new key does not cause a new read. The reads a signal requests store their progress here too, whether or not `enabled` is set. While `enabled` is `false` and no `signal_collection_name` is set, nothing keeps the progress current, so the input discards what is left under this key and enabling either later never resumes a read the stream has long since moved past. **Type**: `string` **Default**: `""` ### `incremental_snapshot.chunk_size` The number of documents read per chunk. A released chunk is in flight as a whole, so it must not exceed `checkpoint_limit`, and keeping it well below leaves room for streamed changes and the next chunk alongside it. **Type**: `int` **Default**: `500` ### `incremental_snapshot.enabled` Streams changes from the start and reads the collections in `chunk_size` chunks, in `_id` order, alongside them. Each chunk is released once the change stream has caught up with the moment it was read, and progress is stored in `checkpoint_cache`, so a restart continues from the last acknowledged chunk. Unlike `stream_snapshot` this needs no up-front snapshot phase and does not delay streaming. The two are mutually exclusive: both read the same documents, so enabling both would deliver everything twice. **Type**: `bool` **Default**: `false` ### `incremental_snapshot.retry_cooldown` How long the snapshot waits before retrying a chunk read that failed transiently, for example during a replica set election or after a dropped connection. Change events keep streaming meanwhile. Setting it to `0s` retries on the next streamed change. **Type**: `string` **Default**: `5s` ### `json_marshal_mode` Controls the format used to convert a message from BSON to JSON when it is received by Redpanda Connect. **Type**: `string` **Default**: `canonical` | Option | Summary | | --- | --- | | `canonical` | A string format that emphasizes type preservation at the expense of readability and interoperability. That is, conversion from canonical to BSON will generally preserve type information except in certain specific cases. | | `relaxed` | A string format that emphasizes readability and interoperability at the expense of type preservation.That is, conversion from relaxed format to BSON can lose type information. | ### `on_unresumable_position` What to do when the stored stream position can no longer be resumed from (for example it has aged out of the oplog) and no snapshot is enabled, so there is no snapshot to recover with: `fail` stops the input with an error, preserving the checkpoint for inspection; `reset` clears the checkpoint and restarts streaming from the current oplog position, skipping the changes between the lost position and now. When `stream_snapshot` or `incremental_snapshot.enabled` is enabled this field has no effect: recovery re-runs the snapshot. This recovers the current state of every document, but not the deletes between the lost position and now. **Type**: `string` **Default**: `fail` **Options**: `fail`, `reset` ### `password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `read_batch_size` The number of documents to fetch in each message batch from MongoDB. **Type**: `int` **Default**: `1000` ### `read_max_wait` The maximum duration MongoDB waits to accumulate `read_batch_size` documents on a change stream before returning the batch to Redpanda Connect. **Type**: `string` **Default**: `1s` ### `signal_collection_name` A collection in `database` to watch for signals, documents that control the input while it runs. Each signal has a `type` and a `data` field: `log` logs `data.message`, and `snapshot-execute` reads the collections named in `data.collections` in `incremental_snapshot.chunk_size` chunks alongside streaming, for example `{"type": "snapshot-execute", "data": {"collections": ["orders"]}}`, in every snapshot mode: `incremental_snapshot.enabled` is not required. Signal inserts are also emitted as regular messages with the `collection` metadata set to this collection, so filter them out downstream if they are not wanted. **Type**: `string` ### `snapshot_auto_bucket_sharding` If set to `true`, uses the [`$bucketAuto`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/bucketAuto/) aggregation stage instead of the default `splitVector` command to split the snapshot data into chunks for processing. This allows parallel collection reading in environments where privileged access to the MongoDB cluster is not allowed, such as MongoDB Atlas, where the `splitVector` command is not available. To enable parallel processing in these environments: - Set this field to `true`. - Set `stream_snapshot` to `true`. - Increase `snapshot_parallelism` to a value greater than `1`. **Type**: `bool` **Default**: `false` ### `snapshot_parallelism` Specifies the number of connections to use when reading the initial snapshot from one or more collections. Increase this number to enable parallel processing of the snapshot. This feature uses the `splitVector` command to split snapshot data into chunks for more efficient processing. This field is only applicable when `stream_snapshot` is set to `true`. **Type**: `int` **Default**: `1` ### `stream_snapshot` When set to `true`, this input streams a snapshot of all existing data in the source collections before streaming data changes. Mutually exclusive with `incremental_snapshot.enabled`, which reads them alongside the changes instead. **Type**: `bool` **Default**: `false` ### `url` The URL of the target MongoDB server. **Type**: `string` ```yaml # Examples: url: mongodb://localhost:27017 ``` ### `username` The username to connect to the database. **Type**: `string` **Default**: `""` --- # Page 66: mongodb **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/mongodb.md --- # mongodb Executes a query and creates a message for each document received. Once the documents from the query are exhausted, this input shuts down, allowing the pipeline to gracefully terminate (or the next input in a [sequence](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sequence/) to execute). > 📝 **NOTE** > > If the service only accepts connections from allowlisted IP addresses, add your cluster’s egress addresses to its allowlist before you deploy the pipeline. On BYOC clusters, see [Allow Pipeline Traffic Through External Firewalls](https://docs.redpanda.com/cloud-data-platform/networking/connect-external-allowlist/) to find the addresses. For Dedicated or Serverless clusters, contact Redpanda support for the addresses. #### Common ```yml input: label: "" mongodb: url: "" # No default (required) database: "" # No default (required) username: "" password: "" collection: "" # No default (required) query: "" # No default (required) auto_replay_nacks: true batch_size: 0 # No default (optional) sort: {} # No default (optional) limit: 0 # No default (optional) ``` #### Advanced ```yml input: label: "" mongodb: url: "" # No default (required) database: "" # No default (required) username: "" password: "" app_name: benthos aws: enabled: false region: "" # No default (optional) session_duration: 1h id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) roles: [] # No default (optional) collection: "" # No default (required) operation: find json_marshal_mode: canonical query: "" # No default (required) auto_replay_nacks: true batch_size: 0 # No default (optional) sort: {} # No default (optional) limit: 0 # No default (optional) ``` ## Fields ### `app_name` The client application name. **Type**: `string` **Default**: `benthos` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `aws` AWS IAM authentication using the `MONGODB-AWS` mechanism, for example against MongoDB Atlas. When enabled, IAM credentials are used instead of a static username and password. Role-derived session credentials are resolved when the component connects and are re-resolved whenever it reconnects. The `mongodb` processor and cache establish their client once at creation and cannot refresh expiring session credentials, so `role`, `roles` and session tokens are rejected for those components; use the ambient credential chain or long-lived access keys with them. For long-running pipelines, prefer the ambient credential chain (leave keys and roles unset), which the driver refreshes automatically. **Type**: `object` ### `aws.enabled` Enable AWS IAM authentication using the driver-native `MONGODB-AWS` mechanism. The MongoDB Atlas database user must be created with the AWS IAM authentication type, and connections require TLS. When no static credentials or roles are configured, the ambient AWS credential chain (environment variables, EC2 instance profile, EKS pod role) is used and expiring credentials are refreshed automatically. **Type**: `bool` **Default**: `false` ### `aws.id` The AWS access key ID to authenticate with. When empty, the default AWS credential chain is used. **Type**: `string` ### `aws.region` The AWS region used when assuming roles (for STS calls). Only used when `role` or `roles` are configured; the ambient and static-key paths ignore it. If no region is specified then the environment default is used. **Type**: `string` ### `aws.role` Optional AWS IAM role ARN to assume for authentication. Cannot be combined with `roles`; use the `roles` array instead when chaining multiple roles. **Type**: `string` ### `aws.role_external_id` Optional external ID to use when assuming the role set in `role`. Each entry in `roles` sets its own external ID. **Type**: `string` ### `aws.roles[]` Optional array of AWS IAM roles to assume for authentication. Roles are assumed in sequence, each using the credentials of the previous one, enabling chaining for purposes such as cross-account access. Each role can optionally specify an external ID. Cannot be combined with `role`. **Type**: `array` ### `aws.roles[].role` AWS IAM role ARN to assume. **Type**: `string` **Default**: `""` ### `aws.roles[].role_external_id` Optional external ID for the role assumption. **Type**: `string` **Default**: `""` ### `aws.secret` The AWS secret access key that pairs with `id`. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `aws.session_duration` The duration of the STS session requested when assuming roles. AWS requires at least 15 minutes and caps sessions created through role chaining at one hour. Only used when `role` or `roles` are configured. For long-running pipelines, prefer the ambient credential chain over a fixed session duration, since the driver refreshes ambient credentials automatically as they near expiry. **Type**: `string` **Default**: `1h` ### `aws.token` The AWS session token to use with `id` and `secret`. Required only when using short-term credentials. **Type**: `string` ### `batch_size` A explicit number of documents to batch up before flushing them for processing. Must be greater than `0`. Operations: `find`, `aggregate` **Type**: `int` ```yaml # Examples: batch_size: 1000 ``` ### `collection` The collection to select from. **Type**: `string` ### `database` The name of the target MongoDB database. **Type**: `string` ### `json_marshal_mode` The json_marshal_mode setting is optional and controls the format of the output message. **Type**: `string` **Default**: `canonical` | Option | Summary | | --- | --- | | `canonical` | A string format that emphasizes type preservation at the expense of readability and interoperability. That is, conversion from canonical to BSON will generally preserve type information except in certain specific cases. | | `relaxed` | A string format that emphasizes readability and interoperability at the expense of type preservation.That is, conversion from relaxed format to BSON can lose type information. | ### `limit` An explicit maximum number of documents to return. Operations: `find` **Type**: `int` ### `operation` The mongodb operation to perform. **Type**: `string` **Default**: `find` **Options**: `find`, `aggregate` ### `password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `query` Bloblang expression describing MongoDB query. **Type**: `string` ```yaml # Examples: query: |2 root.from = {"$lte": timestamp_unix()} root.to = {"$gte": timestamp_unix()} ``` ### `sort` An object specifying fields to sort by, and the respective sort order (`1` ascending, `-1` descending). Note: The driver currently appears to support only one sorting key. Operations: `find` **Type**: `object` ```yaml # Examples: sort: name: 1 # --- sort: age: -1 ``` ### `url` The URL of the target MongoDB server. **Type**: `string` ```yaml # Examples: url: mongodb://localhost:27017 ``` ### `username` The username to connect to the database. **Type**: `string` **Default**: `""` --- # Page 67: mqtt **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/mqtt.md --- # mqtt Subscribe to topics on MQTT brokers. ## Metadata This input adds the following metadata fields to each message: - `mqtt_duplicate` - `mqtt_qos` - `mqtt_retained` - `mqtt_topic` - `mqtt_message_id` You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ### Common ```yml input: label: "" mqtt: urls: [] # No default (required) client_id: "" connect_timeout: 30s topics: [] # No default (required) auto_replay_nacks: true ``` ### Advanced ```yml input: label: "" mqtt: urls: [] # No default (required) client_id: "" dynamic_client_id_suffix: "" # No default (optional) connect_timeout: 30s will: enabled: false qos: 0 retained: false topic: "" payload: "" user: "" password: "" keepalive: 30 tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] topics: [] # No default (required) qos: 1 clean_session: true auto_replay_nacks: true ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `clean_session` Set whether the connection is non-persistent. **Type**: `bool` **Default**: `true` ### `client_id` The client identifier sent to the MQTT broker when connecting, which the broker uses to identify the client session. Use `dynamic_client_id_suffix` to give each run of the pipeline a unique identifier. **Type**: `string` **Default**: `""` ### `connect_timeout` The maximum amount of time to wait in order to establish a connection before the attempt is abandoned. **Type**: `string` **Default**: `30s` ```yaml # Examples: connect_timeout: 1s # --- connect_timeout: 500ms ``` ### `dynamic_client_id_suffix` Append a dynamically generated suffix to the specified `client_id` on each run of the pipeline. This can be useful when clustering Redpanda Connect producers. **Type**: `string` | Option | Summary | | --- | --- | | `nanoid` | append a nanoid of length 21 characters | ### `keepalive` Max seconds of inactivity before a keepalive message is sent. **Type**: `int` **Default**: `30` ### `password` A password to connect with. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `qos` The level of delivery guarantee to enforce. Has options 0, 1, 2. **Type**: `int` **Default**: `1` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `topics[]` A list of topics to consume from. **Type**: `array` ### `urls[]` A list of URLs to connect to. Use the format `scheme://host:port`, where: - `scheme` is one of the following: `tcp`, `ssl`, `ws` - `host` is the IP address or hostname - `port` is the port on which the MQTT broker accepts connections If an item in the list contains commas, it is expanded into multiple URLs. **Type**: `array` ```yaml # Examples: urls: - "tcp://localhost:1883" ``` ### `user` A username to connect with. **Type**: `string` **Default**: `""` ### `will` Set last will message in case of Redpanda Connect failure **Type**: `object` ### `will.enabled` Whether to enable last will messages. **Type**: `bool` **Default**: `false` ### `will.payload` Set payload for last will message. **Type**: `string` **Default**: `""` ### `will.qos` Set QoS for last will message. Valid values are: 0, 1, 2. **Type**: `int` **Default**: `0` ### `will.retained` Set retained for last will message. **Type**: `bool` **Default**: `false` ### `will.topic` Set topic for last will message. **Type**: `string` **Default**: `""` --- # Page 68: mysql_cdc **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/mysql_cdc.md --- # mysql_cdc Streams data changes from a MySQL or MariaDB database, using the binary log to capture data updates. This input reads the MySQL [binary log (`binlog`)](https://dev.mysql.com/doc/refman/8.4/en/binary-log.html) to capture changes to the tables listed in [`tables`](#tables) as they happen. This input is built on the [`go-mysql` canal library](https://github.com/go-mysql-org/go-mysql?tab=readme-ov-file#replication) but uses a custom approach for streaming historical data. ## Snapshot and streaming modes When `stream_snapshot` is `true` and `checkpoint_cache` holds no binlog position, this input takes a snapshot before it streams changes: 1. It runs `FLUSH TABLES …​ WITH READ LOCK` on the selected tables, which blocks writes to them. 2. It opens one `START TRANSACTION WITH CONSISTENT SNAPSHOT` transaction for each snapshot worker, so that every worker reads the same state of the database. 3. It reads the current binlog position and then runs `UNLOCK TABLES` to release the lock. 4. It reads each table in primary key order within those transactions. 5. It streams changes from the binlog position that it read in step 3, which covers the changes made while the snapshot was read. The binlog position is stored in `checkpoint_cache` only after the snapshot is acknowledged, so if the pipeline restarts before then, the snapshot runs again from the start. When `stream_snapshot` is `false` and no position is stored, this input starts streaming from the current binlog position. In both modes, a restart resumes streaming from the binlog position stored in `checkpoint_cache`. ## Data types Column values keep their MySQL types where an equivalent exists. Integer, `YEAR`, and `BIT` columns become integers, `FLOAT` and `DOUBLE` columns become floating-point numbers, `DATE`, `DATETIME`, and `TIMESTAMP` columns become timestamps, binary and `BLOB` columns become byte arrays, `SET` columns become arrays of strings, and `JSON` columns become structured values. `DECIMAL` and `NUMERIC` columns become strings to preserve their precision, as do text, `ENUM`, and `TIME` columns. For example, a `DECIMAL(10,2)` value of `123.45` becomes the string `"123.45"`. ## Metadata This input adds the following metadata fields to each message: - `operation`: The type of operation (`insert`, `update`, `delete`, or `read` for snapshot messages). - `table`: The name of the table. - `binlog_position`: The binlog position (for CDC messages only, not set for snapshot messages). - `schema`: The table schema in benthos common schema format, compatible with processors like `parquet_encode`. ### Common ```yml input: label: "" mysql_cdc: flavor: mysql dsn: "" # No default (required) tables: [] # No default (required) checkpoint_cache: "" # No default (required) checkpoint_key: mysql_binlog_position snapshot_max_batch_size: 1000 stream_snapshot: false # No default (required) max_parallel_snapshot_tables: 1 auto_replay_nacks: true checkpoint_limit: 1024 batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml input: label: "" mysql_cdc: flavor: mysql dsn: "" # No default (required) tables: [] # No default (required) checkpoint_cache: "" # No default (required) checkpoint_key: mysql_binlog_position snapshot_max_batch_size: 1000 max_reconnect_attempts: 10 stream_snapshot: false # No default (required) max_parallel_snapshot_tables: 1 auto_replay_nacks: true checkpoint_limit: 1024 tls: skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] aws: enabled: false region: "" # No default (optional) endpoint: "" # No default (required) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) roles: [] # No default (optional) batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Prerequisites - MySQL version 8 or later, or MariaDB. For MariaDB, set [`flavor`](#flavor) to `mariadb`. - Network access from the cluster where your Redpanda Connect pipeline is running to the source database environment. For detailed networking information, including how to set up a VPC peering connection, see [Redpanda Cloud Networking](https://docs.redpanda.com/cloud-data-platform/networking/). - Binary logging enabled on the database server ### Configuration resources #### Cloud platforms - [Change data capture on Amazon RDS for MySQL](https://aws.amazon.com/blogs/database/enable-change-data-capture-on-amazon-rds-for-mysql-applications-that-are-using-xa-transactions/) - [Azure MySQL Database (CDC)](https://learn.microsoft.com/en-us/fabric/real-time-hub/add-source-mysql-database-cdc) - [Google Cloud SQL for MySQL](https://cloud.google.com/datastream/docs/configure-cloudsql-mysql) #### Self-hosted MySQL - [Binary Logging Options and Variables](https://dev.mysql.com/doc/refman/8.4/en/replication-options-binary-log.html) ## Binlog rotation When the database server rotates the binlog file, the `mysql_cdc` input follows it to the next file. A rotation does not flush the current batch or store a new binlog position. The input stores a binlog position in `checkpoint_cache` after the output acknowledges a batch. The stored position is always the end of a transaction, so a restart resumes at the start of the next transaction. Messages that were read after that position can be delivered again after a restart. ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `aws` AWS IAM authentication configuration for MySQL instances. When enabled, IAM credentials are used to generate temporary authentication tokens instead of a static password. **Type**: `object` ### `aws.enabled` Enable AWS IAM authentication for MySQL. When enabled, an IAM authentication token is generated and used as the password. When using IAM authentication ensure `max_reconnect_attempts` is set to a low value to ensure it can refresh credentials. **Type**: `bool` **Default**: `false` ### `aws.endpoint` The MySQL endpoint hostname (for example, mydb.abc123.us-east-1.rds.amazonaws.com). **Type**: `string` ### `aws.id` The AWS access key ID to authenticate with. When empty, the default AWS credential chain is used. **Type**: `string` ### `aws.region` The AWS region where the MySQL instance is located. The region is used to sign the IAM authentication token and for STS calls when assuming roles. If no region is specified, the environment default is used. **Type**: `string` ### `aws.role` Optional AWS IAM role ARN to assume for authentication. When `roles` is also set, this role is assumed first and the `roles` entries are assumed after it. **Type**: `string` ### `aws.role_external_id` Optional external ID to use when assuming the role set in `role`. Each entry in `roles` sets its own external ID. **Type**: `string` ### `aws.roles[]` Optional array of AWS IAM roles to assume for authentication. Roles are assumed in sequence, each using the credentials of the previous one, enabling chaining for purposes such as cross-account access. Each role can optionally specify an external ID. When `role` is also set, it is assumed before the first entry. **Type**: `array` ### `aws.roles[].role` AWS IAM role ARN to assume. **Type**: `string` **Default**: `""` ### `aws.roles[].role_external_id` Optional external ID for the role assumption. **Type**: `string` **Default**: `""` ### `aws.secret` The AWS secret access key that pairs with `id`. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `aws.token` The AWS session token to use with `id` and `secret`. Required only when using short-term credentials. **Type**: `string` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `checkpoint_cache` A [cache resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) to store the binlog position of the most recent data update delivered by Redpanda Connect. After a restart, Redpanda Connect can continue processing changes from this last known position, avoiding the need to reprocess all table updates. **Type**: `string` ### `checkpoint_key` The key identifier used to store the binlog position in `checkpoint_cache`. If you have multiple `mysql_cdc` inputs sharing the same cache, you can provide an alternative key. **Type**: `string` **Default**: `mysql_binlog_position` ### `checkpoint_limit` The maximum number of messages that this input can process at a given time. Increasing this limit enables parallel processing, and batching at the output level. To preserve at-least-once guarantees, any given binlog position is not acknowledged until all messages up to that position are delivered. **Type**: `int` **Default**: `1024` ### `dsn` The data source name (DSN) of the MySQL database from which you want to stream updates. Use the format `user:password@tcp(localhost:3306)/database`. **Type**: `string` ```yaml # Examples: dsn: user:password@tcp(localhost:3306)/database ``` ### `flavor` The type of MySQL database to connect to. **Type**: `string` **Default**: `mysql` | Option | Summary | | --- | --- | | `mariadb` | MariaDB flavored databases. | | `mysql` | MySQL flavored databases. | ### `max_parallel_snapshot_tables` Specifies the number of tables that will be snapshotted in parallel. **Type**: `int` **Default**: `1` ### `max_reconnect_attempts` The maximum number of attempts the MySQL driver will try to re-establish a broken connection before Connect attempts reconnection. A zero or negative number means infinite retry attempts. **Type**: `int` **Default**: `10` ### `snapshot_max_batch_size` The maximum number of table rows to fetch in each batch when taking a snapshot. This option is only available when `stream_snapshot` is set to `true`. **Type**: `int` **Default**: `1000` ### `stream_snapshot` When set to `true`, this input streams a snapshot of all existing data in the source database before streaming data changes. To use this setting, all database tables that you want to replicate _must_ have a primary key. When set to `false`, the input starts streaming from the current binlog position. **Type**: `bool` ### `tables[]` A list of the database table names to stream changes from. Specify each table name as a separate item. **Type**: `array` ```yaml # Examples: tables: - table1 - table2 ``` ### `tls` Custom TLS settings for the MySQL connection. When `enabled` is `true`, these settings replace any `tls` parameter in the `dsn`, and the server name is set to the host from the DSN. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` --- # Page 69: nats_jetstream **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/nats_jetstream.md --- # nats_jetstream Reads messages from NATS JetStream subjects. ## Consume mirrored streams In the case where a stream being consumed is mirrored from a different JetStream domain the stream cannot be resolved from the subject name alone, and so the stream name as well as the subject (if applicable) must both be specified. ## Metadata This input adds the following metadata fields to each message: - `nats_subject` - `nats_sequence_stream` - `nats_sequence_consumer` - `nats_num_delivered` - `nats_num_pending` - `nats_domain` - `nats_timestamp_unix_nano` - `nats_consumer` You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ## Connection name When monitoring and managing a production [NATS system](https://docs.nats.io/nats-concepts/overview), it is often useful to know which connection a message was sent or received from. This can be achieved by setting the connection name option when creating a NATS connection. Redpanda Connect will automatically set the connection name based off the label of the given NATS component, so that monitoring tools between NATS and Redpanda Connect can stay in sync. ## Authentication There are several components within Redpanda Connect which uses NATS services. You will find that each of these components support optional advanced authentication parameters for [NKeys](https://docs.nats.io/nats-server/configuration/securing_nats/auth_intro/nkey_auth) and [User Credentials](https://docs.nats.io/using-nats/developer/connecting/creds). See an [in-depth tutorial](https://docs.nats.io/running-a-nats-service/nats_admin/security/jwt). ### NKey file The NATS server can use these NKeys in several ways for authentication. The simplest is for the server to be configured with a list of known public keys. The server then generates a challenge for each connection request from a client, and the client must respond to the challenge by signing it with its private NKey configured in the `nkey_file` or `nkey` field. [More details](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth). ### User credentials NATS server supports decentralized authentication based on JSON Web Tokens (JWT). Clients need an [user JWT](https://docs.nats.io/nats-server/configuration/securing_nats/jwt#json-web-tokens) and a corresponding [NKey secret](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth) when connecting to a server which is configured to use this authentication scheme. The `user_credentials_file` field should point to a file containing both the private key and the JWT and can be generated with the [nsc tool](https://docs.nats.io/nats-tools/nsc). Alternatively, the `user_jwt` field can contain a plain text JWT and the `user_nkey_seed` field can contain the plain text NKey Seed. [More details](https://docs.nats.io/using-nats/developer/connecting/creds). ### Token The `token` field can contain a plain text token string for [token-based authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/tokens). ### User and password The `user` and `password` fields can be used for [username/password authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/username_password). #### Common ```yml input: label: "" nats_jetstream: urls: [] # No default (required) queue: "" # No default (optional) subject: "" # No default (optional) durable: "" # No default (optional) stream: "" # No default (optional) bind: false # No default (optional) deliver: all ``` #### Advanced ```yml input: label: "" nats_jetstream: urls: [] # No default (required) max_reconnects: 0 # No default (optional) queue: "" # No default (optional) subject: "" # No default (optional) durable: "" # No default (optional) stream: "" # No default (optional) bind: false # No default (optional) create_stream: false deliver: all ack_wait: 30s max_ack_pending: 1024 tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] tls_handshake_first: false auth: nkey_file: "" # No default (optional) nkey: "" # No default (optional) user_credentials_file: "" # No default (optional) user_jwt: "" # No default (optional) user_nkey_seed: "" # No default (optional) user: "" # No default (optional) password: "" # No default (optional) token: "" # No default (optional) extract_tracing_map: "" # No default (optional) ``` ## Fields ### `ack_wait` The maximum amount of time NATS server should wait for an ack from consumer. **Type**: `string` **Default**: `30s` ```yaml # Examples: ack_wait: 100ms # --- ack_wait: 5m ``` ### `auth` Optional configuration of NATS authentication parameters. **Type**: `object` ### `auth.nkey` Your NKey seed (private key) for NATS authentication. NKeys provide cryptographic authentication without passwords. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: nkey: UDXU4RCSJNZOIQHZNWXHXORDPRTGNJAHAHFRGZNEEJCPQTT2M7NLCNF4 ``` ### `auth.nkey_file` An optional file containing a NKey seed. **Type**: `string` ```yaml # Examples: nkey_file: ./seed.nk ``` ### `auth.password` An optional plain text password (given along with the corresponding user name). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.token` An optional plain text token. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user` An optional plain text user name (given along with the corresponding user password). **Type**: `string` ### `auth.user_credentials_file` An optional file containing user credentials which consist of a user JWT and corresponding NKey seed. **Type**: `string` ```yaml # Examples: user_credentials_file: ./user.creds ``` ### `auth.user_jwt` An optional plaintext user JWT to use along with the corresponding user NKey seed. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user_nkey_seed` An optional plaintext user NKey seed to use along with the corresponding user JWT. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `bind` Indicates that the subscription should use an existing consumer. **Type**: `bool` ### `create_stream` Whether to automatically create the stream if it doesn’t exist (requires the stream field to be set). **Type**: `bool` **Default**: `false` ### `deliver` Determines which messages to deliver when consuming without a durable subscriber. **Type**: `string` **Default**: `all` | Option | Summary | | --- | --- | | `all` | Deliver all available messages. | | `last` | Deliver starting with the last published messages. | | `last_per_subject` | Deliver starting with the last published message per subject. | | `new` | Deliver starting from now, not taking into account any previous messages. | ### `durable` Preserve the state of your consumer under a durable name. **Type**: `string` ### `extract_tracing_map` EXPERIMENTAL: A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that attempts to extract an object containing tracing propagation information, which is then used as the root tracing span for the message. The specification of the extracted fields must match the format used by the service wide tracer. **Type**: `string` ```yaml # Examples: extract_tracing_map: root = @ # --- extract_tracing_map: root = this.meta.span ``` ### `max_ack_pending` The maximum number of outstanding acks to be allowed before consuming is halted. **Type**: `int` **Default**: `1024` ### `max_reconnects` The maximum number of times to attempt to reconnect to the server. If negative, it will never stop trying to reconnect. **Type**: `int` ### `queue` An optional queue group to consume as. Used to configure a push consumer. **Type**: `string` ### `stream` A stream to consume from. Either a subject or stream must be specified. **Type**: `string` ### `subject` A subject to consume from. Supports wildcards for consuming multiple subjects. Either a subject or stream must be specified. **Type**: `string` ```yaml # Examples: subject: foo.bar.baz # --- subject: foo.*.baz # --- subject: foo.bar.* # --- subject: foo.> ``` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `tls_handshake_first` Whether to perform the initial TLS handshake before sending the NATS INFO protocol message. This is required when connecting to some NATS servers that expect TLS to be established immediately after connection, before any protocol negotiation. **Type**: `bool` **Default**: `false` ### `urls[]` A list of URLs to connect to. If a list item contains commas, it will be expanded into multiple URLs. **Type**: `array` ```yaml # Examples: urls: - "nats://127.0.0.1:4222" # --- urls: - "nats://username:password@127.0.0.1:4222" ``` --- # Page 70: nats_kv **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/nats_kv.md --- # nats_kv Watches for updates in a NATS key-value bucket. ## Metadata This input adds the following metadata fields to each message: - `nats_kv_key` - `nats_kv_bucket` - `nats_kv_revision` - `nats_kv_delta` - `nats_kv_operation` - `nats_kv_created` ## Connection name When monitoring and managing a production [NATS system](https://docs.nats.io/nats-concepts/overview), it is often useful to know which connection a message was sent or received from. This can be achieved by setting the connection name option when creating a NATS connection. Redpanda Connect will automatically set the connection name based off the label of the given NATS component, so that monitoring tools between NATS and Redpanda Connect can stay in sync. ## Authentication There are several components within Redpanda Connect which uses NATS services. You will find that each of these components support optional advanced authentication parameters for [NKeys](https://docs.nats.io/nats-server/configuration/securing_nats/auth_intro/nkey_auth) and [User Credentials](https://docs.nats.io/using-nats/developer/connecting/creds). See an [in-depth tutorial](https://docs.nats.io/running-a-nats-service/nats_admin/security/jwt). ### NKey file The NATS server can use these NKeys in several ways for authentication. The simplest is for the server to be configured with a list of known public keys. The server then generates a challenge for each connection request from a client, and the client must respond to the challenge by signing it with its private NKey configured in the `nkey_file` or `nkey` field. [More details](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth). ### User credentials NATS server supports decentralized authentication based on JSON Web Tokens (JWT). Clients need an [user JWT](https://docs.nats.io/nats-server/configuration/securing_nats/jwt#json-web-tokens) and a corresponding [NKey secret](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth) when connecting to a server which is configured to use this authentication scheme. The `user_credentials_file` field should point to a file containing both the private key and the JWT and can be generated with the [nsc tool](https://docs.nats.io/nats-tools/nsc). Alternatively, the `user_jwt` field can contain a plain text JWT and the `user_nkey_seed` field can contain the plain text NKey Seed. [More details](https://docs.nats.io/using-nats/developer/connecting/creds). ### Token The `token` field can contain a plain text token string for [token-based authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/tokens). ### User and password The `user` and `password` fields can be used for [username/password authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/username_password). #### Common ```yml input: label: "" nats_kv: urls: [] # No default (required) bucket: "" # No default (required) key: ">" auto_replay_nacks: true ``` #### Advanced ```yml input: label: "" nats_kv: urls: [] # No default (required) max_reconnects: 0 # No default (optional) bucket: "" # No default (required) key: ">" auto_replay_nacks: true ignore_deletes: false include_history: false meta_only: false tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] tls_handshake_first: false auth: nkey_file: "" # No default (optional) nkey: "" # No default (optional) user_credentials_file: "" # No default (optional) user_jwt: "" # No default (optional) user_nkey_seed: "" # No default (optional) user: "" # No default (optional) password: "" # No default (optional) token: "" # No default (optional) ``` ## Fields ### `auth` Optional configuration of NATS authentication parameters. **Type**: `object` ### `auth.nkey` Your NKey seed (private key) for NATS authentication. NKeys provide cryptographic authentication without passwords. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: nkey: UDXU4RCSJNZOIQHZNWXHXORDPRTGNJAHAHFRGZNEEJCPQTT2M7NLCNF4 ``` ### `auth.nkey_file` An optional file containing a NKey seed. **Type**: `string` ```yaml # Examples: nkey_file: ./seed.nk ``` ### `auth.password` An optional plain text password (given along with the corresponding user name). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.token` An optional plain text token. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user` An optional plain text user name (given along with the corresponding user password). **Type**: `string` ### `auth.user_credentials_file` An optional file containing user credentials which consist of a user JWT and corresponding NKey seed. **Type**: `string` ```yaml # Examples: user_credentials_file: ./user.creds ``` ### `auth.user_jwt` An optional plaintext user JWT to use along with the corresponding user NKey seed. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user_nkey_seed` An optional plaintext user NKey seed to use along with the corresponding user JWT. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `bucket` The name of the KV bucket. **Type**: `string` ```yaml # Examples: bucket: my_kv_bucket ``` ### `ignore_deletes` Do not send delete markers as messages. **Type**: `bool` **Default**: `false` ### `include_history` Include all the history per key, not just the last one. **Type**: `bool` **Default**: `false` ### `key` Key to watch for updates, can include wildcards. **Type**: `string` **Default**: `>` ```yaml # Examples: key: foo.bar.baz # --- key: foo.*.baz # --- key: foo.bar.* # --- key: foo.> ``` ### `max_reconnects` The maximum number of times to attempt to reconnect to the server. If negative, it will never stop trying to reconnect. **Type**: `int` ### `meta_only` Retrieve only the metadata of the entry **Type**: `bool` **Default**: `false` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `tls_handshake_first` Whether to perform the initial TLS handshake before sending the NATS INFO protocol message. This is required when connecting to some NATS servers that expect TLS to be established immediately after connection, before any protocol negotiation. **Type**: `bool` **Default**: `false` ### `urls[]` A list of URLs to connect to. If a list item contains commas, it will be expanded into multiple URLs. **Type**: `array` ```yaml # Examples: urls: - "nats://127.0.0.1:4222" # --- urls: - "nats://username:password@127.0.0.1:4222" ``` --- # Page 71: nats **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/nats.md --- # nats Subscribes to a NATS subject. ## Metadata This input adds the following metadata fields to each message: - `nats_subject` - `nats_reply_subject` - All message headers (when supported by the connection) You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ## Connection name When monitoring and managing a production [NATS system](https://docs.nats.io/nats-concepts/overview), it is often useful to know which connection a message was sent or received from. This can be achieved by setting the connection name option when creating a NATS connection. Redpanda Connect will automatically set the connection name based off the label of the given NATS component, so that monitoring tools between NATS and Redpanda Connect can stay in sync. ## Authentication There are several components within Redpanda Connect which uses NATS services. You will find that each of these components support optional advanced authentication parameters for [NKeys](https://docs.nats.io/nats-server/configuration/securing_nats/auth_intro/nkey_auth) and [User Credentials](https://docs.nats.io/using-nats/developer/connecting/creds). See an [in-depth tutorial](https://docs.nats.io/running-a-nats-service/nats_admin/security/jwt). ### NKey file The NATS server can use these NKeys in several ways for authentication. The simplest is for the server to be configured with a list of known public keys. The server then generates a challenge for each connection request from a client, and the client must respond to the challenge by signing it with its private NKey configured in the `nkey_file` or `nkey` field. [More details](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth). ### User credentials NATS server supports decentralized authentication based on JSON Web Tokens (JWT). Clients need an [user JWT](https://docs.nats.io/nats-server/configuration/securing_nats/jwt#json-web-tokens) and a corresponding [NKey secret](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth) when connecting to a server which is configured to use this authentication scheme. The `user_credentials_file` field should point to a file containing both the private key and the JWT and can be generated with the [nsc tool](https://docs.nats.io/nats-tools/nsc). Alternatively, the `user_jwt` field can contain a plain text JWT and the `user_nkey_seed` field can contain the plain text NKey Seed. [More details](https://docs.nats.io/using-nats/developer/connecting/creds). ### Token The `token` field can contain a plain text token string for [token-based authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/tokens). ### User and password The `user` and `password` fields can be used for [username/password authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/username_password). #### Common ```yml input: label: "" nats: urls: [] # No default (required) subject: "" # No default (required) queue: "" # No default (optional) auto_replay_nacks: true send_ack: true ``` #### Advanced ```yml input: label: "" nats: urls: [] # No default (required) max_reconnects: 0 # No default (optional) subject: "" # No default (required) queue: "" # No default (optional) auto_replay_nacks: true send_ack: true nak_delay: "" # No default (optional) prefetch_count: 500000 tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] tls_handshake_first: false auth: nkey_file: "" # No default (optional) nkey: "" # No default (optional) user_credentials_file: "" # No default (optional) user_jwt: "" # No default (optional) user_nkey_seed: "" # No default (optional) user: "" # No default (optional) password: "" # No default (optional) token: "" # No default (optional) extract_tracing_map: "" # No default (optional) ``` ## Fields ### `auth` Optional configuration of NATS authentication parameters. **Type**: `object` ### `auth.nkey` Your NKey seed (private key) for NATS authentication. NKeys provide cryptographic authentication without passwords. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: nkey: UDXU4RCSJNZOIQHZNWXHXORDPRTGNJAHAHFRGZNEEJCPQTT2M7NLCNF4 ``` ### `auth.nkey_file` An optional file containing a NKey seed. **Type**: `string` ```yaml # Examples: nkey_file: ./seed.nk ``` ### `auth.password` An optional plain text password (given along with the corresponding user name). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.token` An optional plain text token. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user` An optional plain text user name (given along with the corresponding user password). **Type**: `string` ### `auth.user_credentials_file` An optional file containing user credentials which consist of a user JWT and corresponding NKey seed. **Type**: `string` ```yaml # Examples: user_credentials_file: ./user.creds ``` ### `auth.user_jwt` An optional plaintext user JWT to use along with the corresponding user NKey seed. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user_nkey_seed` An optional plaintext user NKey seed to use along with the corresponding user JWT. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `extract_tracing_map` EXPERIMENTAL: A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that attempts to extract an object containing tracing propagation information, which is then used as the root tracing span for the message. The specification of the extracted fields must match the format used by the service wide tracer. **Type**: `string` ```yaml # Examples: extract_tracing_map: root = @ # --- extract_tracing_map: root = this.meta.span ``` ### `max_reconnects` The maximum number of times to attempt to reconnect to the server. If negative, it will never stop trying to reconnect. **Type**: `int` ### `nak_delay` An optional delay duration on redelivering a message when negatively acknowledged. **Type**: `string` ```yaml # Examples: nak_delay: 1m ``` ### `prefetch_count` The maximum number of messages to pull at a time. **Type**: `int` **Default**: `500000` ### `queue` An optional queue group to consume as. **Type**: `string` ### `send_ack` Whether an automatic acknowledgment is sent as a reply to each message. When enabled, these replies are sent only when data has been delivered to all outputs. **Type**: `bool` **Default**: `true` ### `subject` A subject to consume from. Supports wildcards for consuming multiple subjects. **Type**: `string` ```yaml # Examples: subject: foo.bar.baz # --- subject: foo.*.baz # --- subject: foo.bar.* # --- subject: foo.> ``` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `tls_handshake_first` Whether to perform the initial TLS handshake before sending the NATS INFO protocol message. This is required when connecting to some NATS servers that expect TLS to be established immediately after connection, before any protocol negotiation. **Type**: `bool` **Default**: `false` ### `urls[]` A list of URLs to connect to. If a list item contains commas, it will be expanded into multiple URLs. **Type**: `array` ```yaml # Examples: urls: - "nats://127.0.0.1:4222" # --- urls: - "nats://username:password@127.0.0.1:4222" ``` --- # Page 72: oracledb_cdc **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/oracledb_cdc.md --- # oracledb_cdc Enables Change Data Capture by consuming from OracleDB. Streams changes from an Oracle database for Change Data Capture (CDC). Use the `snapshot_mode` field to control whether existing data is captured in an initial snapshot before streaming changes. ## Metadata This input adds the following metadata fields to each message: - `database_schema`: The database schema for the table where the message originates from. - `table_name`: Name of the table that the message originated from. - `operation`: Type of operation that generated the message: `read`, `delete`, `insert`, or `update`. `read` is from messages that are read in the initial snapshot phase. - `scn`: The System Change Number in Oracle. Messages published as part of a snapshot will contain Oracle’s current SCN captured at time of snapshot. - `transaction_id`: The Oracle transaction ID in `USN.SLOT.SEQ` format, identifying the transaction that produced the change. Not present on snapshot (`read`) messages. - `source_ts_ms`: The timestamp of when Oracle wrote the change record into the redo log, expressed as milliseconds since the Unix epoch. This reflects the database server’s wall-clock time at the moment the DML executed, not the transaction commit time. Not present on snapshot (`read`) messages. - `commit_ts_ms`: The timestamp of the transaction commit, expressed as milliseconds since the Unix epoch. Sourced from `V$LOGMNR_CONTENTS.TIMESTAMP` on the COMMIT redo record: this is Oracle’s wall-clock time when the commit was written to the redo log, not a dedicated commit-timestamp column. For snapshot (`read`) messages, this reflects Oracle’s `SYSTIMESTAMP` at the moment the snapshot SCN was captured, so all snapshot messages share the same value. - `username`: The Oracle database username of the session that performed the DML, sourced from `V$LOGMNR_CONTENTS.USERNAME`. Not present on snapshot (`read`) messages, nor on change messages where Oracle reports a NULL or empty username. - `rs_id`: The LogMiner record set ID from `V$LOGMNR_CONTENTS.RS_ID`, identifying the redo record that produced the change. Use `rs_id`, `ssn` and `row_seq` together to identify one row change and to order the changes of a transaction. Not present on snapshot (`read`) messages, nor on LOB-only synthetic updates. - `ssn`: The SQL sequence number from `V$LOGMNR_CONTENTS.SSN`. Compare it numerically. Not present whenever `rs_id` is not present. - `row_seq`: The position of the row change among the consecutive row changes that report the same `rs_id` and `ssn`. It starts at 0 in redo order. Oracle reports the same `rs_id` and `ssn` for every row of an array DML redo record, such as a bulk `DELETE` of up to 255 rows. This field tells those rows apart. It is 0 for every other change. LogMiner returns the rows of one redo record one after the other, and the connector counts them in that order. Compare it numerically. Not present whenever `rs_id` is not present. - `schema`: The table schema, for use with schema-aware downstream processors such as `schema_registry_encode`. When new columns are detected in CDC events, the schema is automatically refreshed from the Oracle catalog. Dropped columns are reflected after a connector restart. ## Permissions When using the default Oracle based cache, the Connect user requires permission to create tables and stored procedures, and the `rpcn` schema must already exist. Refer to `checkpoint_cache_table_name` for more information. When `max_parallel_snapshot_tables` is greater than 1, tables with an enabled and validated primary key and no `snapshot_filters` entry are considered for splitting into parallel chunks. Planning and reading those chunks uses flashback queries (`AS OF SCN`) pinned to the SCN captured at the start of the snapshot. For tables it does not own, the Connect user then requires the `FLASHBACK` object privilege on each table (`GRANT FLASHBACK ON . TO `) or `GRANT FLASHBACK ANY TABLE TO `, in addition to `SELECT`. A table the user can’t read with flashback queries isn’t split: a warning is logged and a single reader reads it with a full scan, as when `max_parallel_snapshot_tables` is 1. Because every chunk reads as of that one SCN, the database’s undo retention must also cover the full duration of the snapshot, otherwise reads fail with ORA-01555 (snapshot too old). ## Performance Streaming throughput is bounded by the LogMiner session, not by CPU. Each pipeline mines the redo stream through a single synchronous LogMiner reader, so adding cores to Redpanda Connect does not raise the capture rate. To capture more aggregate change volume from one database, run multiple pipelines that each `include` a disjoint set of tables. Every pipeline gets its own LogMiner reader. Large transactions and driver fetch size: left to itself, the Oracle driver sizes each fetch to roughly 128 KiB based on the declared maximum width of the selected columns. As a result, wide columns such as LogMiner’s redo SQL yield only a handful of rows per network round trip. This can make large committed transactions appear minutes late while the database, network and connector all look idle. Each round trip costs a full network exchange, and a large transaction requires thousands of them. The connector therefore fetches `prefetch_rows` rows per round trip (500 by default). Raise it for large transactions over high-latency links. A `PREFETCH_ROWS` query parameter in `connection_string` takes precedence over the field. The checkpoint advances about every 10 seconds after every delivered batch is acknowledged, also while the monitored tables are idle. On an idle database it can stay up to `logminer.min_scn_window_size` SCNs behind the current SCN, because the input does not mine smaller ranges. It never moves past the start of a transaction that is still open. With `batching.count` and no `batching.period`, rows can wait in the batcher until more rows arrive, and the checkpoint does not advance until they flush. Set a `period` to prevent this. Keep redo logs for longer than the longest open transaction and the longest pipeline outage. If the checkpointed SCN is no longer available, the input cannot resume and fails with ORA-01291. Alert on a stagnant checkpoint SCN or repeated ORA errors. A flashback or point-in-time recovery on the source database followed by `OPEN RESETLOGS` permanently invalidates any checkpoint taken before that event. The checkpoint belongs to a prior database incarnation, and no log file from either incarnation covers the gap. This is a different failure from the retention case above, and it surfaces as ORA-01291. Increasing retention will not help, because the problem is incarnation identity rather than log availability. Recovery always requires clearing the connector’s checkpoint so it resumes from the database’s current SCN. With the default Oracle-based checkpoint cache, the checkpoint row lives in the same database, so the flashback rolls it back rather than clearing it. It must be deleted explicitly. Clearing the checkpoint alone loses any changes committed between the last checkpoint and the restart. To avoid that gap, clear the checkpoint and set `snapshot_mode` to `snapshot_and_stream` together. Setting `snapshot_mode` alone has no effect, since a checkpoint that is still present skips snapshotting entirely. ### Common ```yml input: label: "" oracledb_cdc: connection_string: "" # No default (required) wallet_path: "" # No default (optional) wallet_password: "" # No default (optional) prefetch_rows: 500 snapshot_mode: "" # No default (optional) max_parallel_snapshot_tables: 1 snapshot_max_batch_size: 1000 logminer: scn_window_size: 20000 min_scn_window_size: 1000 max_scn_window_size: 100000 backoff_interval: 5s mining_interval: 300ms strategy: online_catalog max_transaction_events: 0 lob_enabled: true transaction_cache: "" # No default (optional) transaction_cache_key: oracledb_cdc max_session_age: 0s snapshot_filters: {} # No default (optional) include: [] # No default (required) exclude: [] # No default (optional) checkpoint_cache: "" # No default (optional) checkpoint_cache_table_name: RPCN.CDC_CHECKPOINT_CACHE checkpoint_cache_key: oracledb_cdc checkpoint_limit: 1024 pdb_name: "" # No default (optional) auto_replay_nacks: true batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml input: label: "" oracledb_cdc: connection_string: "" # No default (required) wallet_path: "" # No default (optional) wallet_password: "" # No default (optional) prefetch_rows: 500 snapshot_mode: "" # No default (optional) max_parallel_snapshot_tables: 1 snapshot_max_batch_size: 1000 snapshot_connection_backoff: initial_interval: 100ms max_interval: 5s max_elapsed_time: 3m0s logminer: scn_window_size: 20000 min_scn_window_size: 1000 max_scn_window_size: 100000 window_strategy: scn_window redo_volume_min: 2 redo_volume_growth_max: 4 backoff_interval: 5s mining_interval: 300ms strategy: online_catalog max_transaction_events: 0 lob_enabled: true transaction_cache: "" # No default (optional) transaction_cache_key: oracledb_cdc max_session_age: 0s snapshot_filters: {} # No default (optional) include: [] # No default (required) exclude: [] # No default (optional) checkpoint_cache: "" # No default (optional) checkpoint_cache_table_name: RPCN.CDC_CHECKPOINT_CACHE checkpoint_cache_key: oracledb_cdc checkpoint_limit: 1024 pdb_name: "" # No default (optional) auto_replay_nacks: true batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `checkpoint_cache` A [cache resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) to use for storing the current System Change Number (SCN) that has been successfully delivered. This allows Redpanda Connect to continue from that SCN upon restart, rather than consume the entire state of OracleDB redo logs. If not set, the default Oracle-based cache is used. See `checkpoint_cache_table_name` for more information. **Type**: `string` ### `checkpoint_cache_key` The key to use to store the snapshot position in `checkpoint_cache`. An alternative key can be provided if multiple CDC inputs share the same cache. **Type**: `string` **Default**: `oracledb_cdc` ### `checkpoint_cache_table_name` The identifier for the checkpoint cache table name. If no `checkpoint_cache` field is specified, this input will automatically create a table and stored procedure under the `rpcn` schema to act as a checkpoint cache. This table stores the latest processed System Change Number (SCN) that has been successfully delivered, allowing Redpanda Connect to resume from that point upon restart rather than reconsume the entire redo log. When `pdb_name` is set and this field is left at its default value, the table name is automatically derived per PDB (for example, `RPCN.CDC_CHECKPOINT_MYPDB`) to avoid SCN collisions between pipelines monitoring different PDBs. Set this field explicitly to opt out of that auto-derivation. **Type**: `string` **Default**: `RPCN.CDC_CHECKPOINT_CACHE` ```yaml # Examples: checkpoint_cache_table_name: RPCN.CHECKPOINT_CACHE ``` ### `checkpoint_limit` The maximum number of messages that can be processed at a given time. Increasing this limit enables parallel processing and batching at the output level. Any given System Change Number (SCN) will not be acknowledged unless all messages under that offset are delivered in order to preserve at least once delivery guarantees. **Type**: `int` **Default**: `1024` ### `connection_string` The connection string of the Oracle database to connect to. You can supply additional connection options as URL query parameters, for example: `oracle://user:password@host:1522/service?WALLET=/opt/oracle/wallet&SSL=true`. **Type**: `string` ```yaml # Examples: connection_string: oracle://username:password@host:port/service_name # --- connection_string: oracle://user:password@host:1522/service?WALLET=/opt/oracle/wallet&SSL=true ``` ### `exclude[]` Regular expressions for tables to exclude. **Type**: `array` ```yaml # Examples: exclude: SCHEMA.PRIVATETABLE ``` ### `include[]` Regular expressions for tables to include. **Type**: `array` ```yaml # Examples: include: SCHEMA.PRODUCTS ``` ### `logminer` LogMiner configuration settings. **Type**: `object` ### `logminer.backoff_interval` The interval between attempts to check for new changes once all data is processed. For low traffic tables increasing this value can reduce network traffic to the server. **Type**: `string` **Default**: `5s` ```yaml # Examples: backoff_interval: 5s # --- backoff_interval: 1m ``` ### `logminer.lob_enabled` When enabled, large object (CLOB, BLOB) columns are included in both snapshot and streaming change events. When disabled, these columns are still present but contain no values. Enabling this option introduces additional performance overhead and increases memory requirements. While a transaction that changed a LOB stays open, every mining window re-reads redo back to the start of that transaction, because LogMiner can only rebuild a LOB from a session that starts before it. Long-running transactions with LOB changes therefore increase mining work, and a window can read more redo than the scn_window_size and redo_volume settings imply. **Type**: `bool` **Default**: `true` ### `logminer.max_scn_window_size` The maximum SCN range that can be mined in a single cycle. The window starts at scn_window_size and grows by scn_window_size each cycle that ends at the cap (backlog present), up to this limit. It shrinks by the same step each cycle that catches up to the database. This allows the connector to automatically mine larger windows during heavy backlog and smaller windows during steady state. **Type**: `int` **Default**: `100000` ### `logminer.max_session_age` The maximum duration a single LogMiner session may stay open before being forcibly ended and restarted, even if the underlying redo log files haven’t changed. By default, a LogMiner session is only restarted when a redo log switch is detected. On databases where switches are infrequent, a session can stay open for a long time, and LogMiner has been observed to accumulate server-side PGA memory (particularly around online catalog dictionary lookups) until Oracle terminates the session with ORA-04036. Setting this forces a periodic restart independent of log switches. Set to 0 (default) to disable and restart only on log switches. **Type**: `string` **Default**: `0s` ```yaml # Examples: max_session_age: 20m ``` ### `logminer.max_transaction_events` The maximum number of events that can be buffered for a single transaction. If a transaction exceeds this limit it is discarded and its events will not be emitted. Set to 0 to disable the limit. **Type**: `int` **Default**: `0` ### `logminer.min_scn_window_size` The minimum SCN gap required before starting a new LogMiner session. When the gap between the connector’s current position and the database’s current SCN is smaller than this value, the mining cycle is skipped and the connector backs off instead. This prevents excessive LogMiner start/stop cycles on low-traffic databases where Oracle background activity advances the SCN without producing relevant events. This gate applies regardless of `window_strategy`. Set to 0 to disable. **Type**: `int` **Default**: `1000` ### `logminer.mining_interval` The interval between mining cycles during normal operation. Controls how frequently LogMiner polls for new changes when not caught up. **Type**: `string` **Default**: `300ms` ```yaml # Examples: mining_interval: 100ms # --- mining_interval: 1s ``` ### `logminer.redo_volume_growth_max` The ceiling the per-thread redo-volume budget can grow to. The ceiling applies independently to each open redo thread, so on Real Application Clusters (RAC) configurations the total volume mined per cycle scales with the number of threads. The budget starts at `redo_volume_min` and grows automatically whenever something prevents the mining window from advancing, such as a long-running transaction holding it in place or a redo log being recycled mid-query, up to this limit. Only applies when `window_strategy` is `redo_volume`. **Type**: `int` **Default**: `4` ### `logminer.redo_volume_min` The approximate minimum number of redo logs to read per redo thread in each mining cycle. Consider increasing this value if redo logs are small and rotate frequently, decreasing if redo logs are very large. Only applies when `window_strategy` is `redo_volume`. **Type**: `int` **Default**: `2` ### `logminer.scn_window_size` The SCN range to mine per cycle. Each cycle reads changes between the current SCN and current SCN + scn_window_size. Smaller values mean more frequent queries with lower memory usage but higher overhead; larger values reduce query frequency and improve throughput at the cost of higher memory usage per cycle. **Type**: `int` **Default**: `20000` ### `logminer.strategy` Controls how LogMiner retrieves data dictionary information. `online_catalog` uses the current data dictionary for best performance but cannot capture DDL changes. Currently, only `online_catalog` is supported. **Type**: `string` **Default**: `online_catalog` ### `logminer.transaction_cache` A [cache resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) to use for buffering in-flight transactions. When set, DML events are serialized and stored in the named cache rather than held in memory, reducing connector memory usage for workloads with large or long-running transactions. If not set, an in-memory buffer is used. Each in-flight transaction is stored as N+1 cache entries: one metadata key holding the transaction ID, start SCN, and event count; and one event key per DML event. A transaction with 1000 events occupies 1001 cache entries. Each AddEvent call writes exactly two keys regardless of how many events the transaction has already accumulated. This cache is designed for low-latency stores with cheap per-operation cost. Redis and Memcached are the recommended backends. The built-in `memory:{}` cache works but provides no durability across restarts. High-latency or per-request-cost stores such as S3 or DynamoDB are not recommended. A transaction with 1000 events generates approximately 3000 cache operations across its lifetime, and because LogMiner processes events on a single goroutine, per-call latency directly reduces throughput. A backend that causes timeouts or errors will also cause the mining cycle to restart from an earlier checkpoint SCN, which can result in duplicate event delivery. **Type**: `string` ### `logminer.transaction_cache_key` The key prefix used when storing transactions in `transaction_cache`. An alternative prefix must be set if multiple `oracledb_cdc` inputs share the same cache resource, since Oracle transaction IDs (USN.SLOT.SEQ) are only unique within a single Oracle instance and would otherwise collide. **Type**: `string` **Default**: `oracledb_cdc` ### `logminer.window_strategy` Controls how the SCN range mined per cycle is sized: - `scn_window` (default): Grows and shrinks a fixed SCN increment (`scn_window_size`) based on its backlog, bounded by `min_scn_window_size` and `max_scn_window_size`. - `redo_volume`: Sizes the range by a fixed redo-volume budget calculated by log size (configured by `redo_volume_min` and `redo_volume_growth_max`), independent of raw SCN movement. This can be helpful when a database’s SCN can advance without matching real transaction volume (for example, a Multitenant Container Database (CDB) shared SCN bumped by another Pluggable Database (PDB)), since `scn_window` would otherwise burn cycles growing its window over mostly-empty ranges, while `redo_volume` sizes each cycle by the redo it actually reads. On Real Application Clusters (RAC), the `redo_volume` budget applies per open thread, so volume mined per cycle scales with the number of open threads. **Type**: `string` **Default**: `scn_window` **Options**: `scn_window`, `redo_volume` ### `max_parallel_snapshot_tables` The maximum number of snapshot readers that run in parallel during the initial snapshot. Each reader reads one table, or one range chunk of a large table. Tables are only split into chunks when this is greater than 1. A table is not split, and is read by a single reader alongside the other tables, when it has a `snapshot_filters` entry. The same is true when it has no primary key, or one that isn’t enabled and validated, or when it has too few distinct keys to split. It is also true when it has a key that must be sampled (anything other than a single NUMBER, FLOAT, DATE or TIMESTAMP column) but no optimizer statistics. Tables are split into at most one chunk per 10,000 rows, so tables with fewer than 20,000 rows aren’t split. The row count comes from the table’s optimizer statistics. When those are missing or show fewer than 20,000 rows, for example because they’re stale, the connector counts the table’s rows instead, stopping once it has counted enough to plan every chunk. Each parallel reader holds its own database connection, so keep this well below the database’s `processes` and `sessions` limits, allowing for the other connections the database serves. If the database runs out of connections, readers wait for one to be released and retry with backoff. The snapshot fails only if no reader can get a connection in time. See `snapshot_connection_backoff`. **Type**: `int` **Default**: `1` ### `pdb_name` The name of the pluggable database (PDB) to monitor. Set this field only when the connection reaches Oracle through the CDB root service. If the connection is already scoped to a PDB, the input fails at startup. When set, LogMiner output is scoped to this PDB via `SRC_CON_NAME` filtering and catalog queries use `ALTER SESSION SET CONTAINER` to switch context. Requires `GRANT SET CONTAINER TO CONTAINER=ALL`. Leave this field unset to monitor the database that the connection is already scoped to. **Type**: `string` ### `prefetch_rows` The number of rows fetched per network round-trip, for both snapshot and streaming reads. Higher values mean fewer round-trips but more memory per fetch, for each table snapshotted in parallel. A `PREFETCH_ROWS` query parameter in `connection_string` takes precedence. **Type**: `int` **Default**: `500` ### `snapshot_connection_backoff` Instead of failing a snapshot, the connector retries acquiring a connection when the database has no capacity for another one, for example when `max_parallel_snapshot_tables` exceeds its `processes` or `sessions` limits. Readers wait for a connection to be released, retrying with exponential backoff. The snapshot fails only if a reader can’t get one within `snapshot_connection_backoff.max_elapsed_time` while no other reader holds a connection. While another reader holds one, the snapshot is still progressing, so the reader keeps waiting. **Type**: `object` ### `snapshot_connection_backoff.initial_interval` The initial period to wait between retry attempts. The retry interval increases for each failed attempt, up to the `max_interval` value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `100ms` ```yaml # Examples: initial_interval: 50ms # --- initial_interval: 1s ``` ### `snapshot_connection_backoff.max_elapsed_time` The maximum overall period of time to spend on retry attempts before the request is aborted. **Type**: `string` **Default**: `3m0s` ```yaml # Examples: max_elapsed_time: 1m # --- max_elapsed_time: 1h ``` ### `snapshot_connection_backoff.max_interval` The maximum period to wait between retry attempts **Type**: `string` **Default**: `5s` ```yaml # Examples: max_interval: 5s # --- max_interval: 1m ``` ### `snapshot_filters` A map of fully-qualified table names (for example `SCHEMA.TABLE`) to SQL `SELECT` queries that override the default snapshot query for each table. Use this to filter or shape the rows captured during the initial snapshot. Each query must project every column of the table’s primary key (all columns of a composite key), even if it otherwise selects only a subset of columns. During a snapshot, Redpanda Connect pages through a table’s rows by filtering and sorting on the full primary key against the query’s own result set. If a primary key column isn’t projected, the snapshot fails part-way through, after the first batch of rows is read. A table with a query here is never split into parallel chunks, whatever `max_parallel_snapshot_tables` is set to. A single reader pages through it in one `READ ONLY` transaction. It is also read without flashback queries (`AS OF SCN`), so it reflects the table when that transaction starts rather than the SCN captured at the start of the snapshot. **Type**: `object` ```yaml # Examples: snapshot_filters: TESTDB.PRODUCTS: SELECT * FROM TESTDB.PRODUCTS WHERE ID > 1000 TESTDB.USERS: SELECT * FROM TESTDB.USERS ``` ### `snapshot_max_batch_size` The maximum number of rows fetched per query when taking a snapshot of a table that is paged by primary key. This applies to tables with a `snapshot_filters` entry configured. It also applies to tables with a primary key that are split into parallel range chunks, which happens only when `max_parallel_snapshot_tables` is greater than 1. All other tables are streamed through a single unordered cursor, where this value only paces how often a cancellation is checked. **Type**: `int` **Default**: `1000` ### `snapshot_mode` Controls snapshot behavior. `none` (default) skips snapshotting and starts streaming from the current SCN. `snapshot_only` performs a full snapshot, persists the SCN checkpoint, then stops without streaming. `snapshot_and_stream` performs a full snapshot then transitions to streaming. **Type**: `string` **Options**: `none`, `snapshot_only`, `snapshot_and_stream` ### `wallet_password` Password for the `ewallet.p12` PKCS#12 wallet file. Only use this when the wallet directory contains `ewallet.p12` rather than `cwallet.sso`. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `wallet_path` Path to the Oracle Wallet directory. When set, this automatically enables SSL. The directory must contain either `cwallet.sso` (auto-login, does not require a password) or `ewallet.p12` (requires `wallet_password`). **Type**: `string` ```yaml # Examples: wallet_path: /opt/oracle/wallet ``` --- # Page 73: otlp_grpc **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/otlp_grpc.md --- # otlp_grpc Receive OpenTelemetry traces, logs, and metrics via OTLP/gRPC protocol. Exposes an OpenTelemetry Collector gRPC receiver that accepts traces, logs, and metrics via gRPC. Telemetry data is received in OTLP protobuf format and converted to individual Redpanda OTEL v1 messages. Each signal (span, log record, or metric) becomes a separate message with embedded Resource and Scope metadata. ## Protocols This input supports OTLP/gRPC on the default port 4317 using the standard OTLP protobuf format for all signal types (traces, logs, metrics). ## Output format Each OTLP export request is unbatched into individual messages: - **Traces**: One message per span - **Logs**: One message per log record - **Metrics**: One message per metric Messages are encoded in Redpanda OTEL v1 format (protobuf or JSON, configurable using the `encoding` field). ## Metadata This input adds the following metadata fields to each message: - `otel_signal_type`: The signal type (`trace`, `log`, or `metric`). - `otel_encoding`: The message encoding (`json` or `protobuf`). - `otel_trace_id`: The base64-encoded trace ID. Set on trace messages only. - `otel_span_id`: The base64-encoded span ID. Set on trace messages only. You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ## Authentication When `auth_token` is configured, clients must include the token in the gRPC metadata: **Go client example:** ```go import ( "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" ) exporter, err := otlptracegrpc.New(ctx, otlptracegrpc.WithEndpoint("localhost:4317"), otlptracegrpc.WithInsecure(), // or WithTLSCredentials() for TLS otlptracegrpc.WithHeaders(map[string]string{ "authorization": "Bearer your-token-here", }), ) ``` **Environment variable:** ```bash export OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer your-token-here" ``` ## Rate limiting You can specify an optional rate limit resource using the `rate_limit` field to throttle incoming requests. When the rate limit is reached, the input delays processing each request until the rate limit resource grants access. ### Common ```yml input: label: "" otlp_grpc: encoding: json address: 0.0.0.0:4317 rate_limit: "" ``` ### Advanced ```yml input: label: "" otlp_grpc: encoding: json address: 0.0.0.0:4317 tls: enabled: false cert_file: "" key_file: "" auth_token: "" max_recv_msg_size: 4194304 rate_limit: "" tcp: reuse_addr: false reuse_port: false schema_registry: url: "" # No default (required) timeout: 5s tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] oauth2: enabled: false client_key: "" client_secret: "" token_url: "" scopes: [] endpoint_params: {} oauth: enabled: false consumer_key: "" consumer_secret: "" access_token: "" access_token_secret: "" basic_auth: enabled: false username: "" password: "" jwt: enabled: false private_key_file: "" signing_method: "" claims: {} headers: {} common_subject: "" trace_subject: "" log_subject: "" metric_subject: "" ``` ## Fields ### `address` The address to listen on for gRPC connections. **Type**: `string` **Default**: `0.0.0.0:4317` ### `auth_token` Optional bearer token for authentication. When set, requests must include the `authorization: Bearer ` metadata. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `encoding` The encoding format for messages in each batch, either `protobuf` or `json`. **Type**: `string` **Default**: `json` **Options**: `protobuf`, `json` ### `max_recv_msg_size` Maximum size of gRPC messages to receive in bytes. **Type**: `int` **Default**: `4194304` ### `rate_limit` The name of an optional rate limit resource to throttle incoming requests. **Type**: `string` **Default**: `""` ### `schema_registry` Optional Schema Registry configuration. When set, the input registers the OTLP schemas for each signal type and prepends the Schema Registry wire format header to each message. **Type**: `object` ### `schema_registry.basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `schema_registry.basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `schema_registry.common_subject` Schema subject name for the common protobuf schema. Only used when encoding is 'protobuf'. Defaults to 'redpanda-otel-common' for protobuf encoding or 'redpanda-otel-common-json' for JSON encoding. **Type**: `string` **Default**: `""` ### `schema_registry.jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `schema_registry.jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `schema_registry.jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `schema_registry.jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `schema_registry.jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `schema_registry.log_subject` Schema subject name for log data. Defaults to 'redpanda-otel-logs' for protobuf encoding or 'redpanda-otel-logs-json' for JSON encoding. **Type**: `string` **Default**: `""` ### `schema_registry.metric_subject` Schema subject name for metric data. Defaults to 'redpanda-otel-metrics' for protobuf encoding or 'redpanda-otel-metrics-json' for JSON encoding. **Type**: `string` **Default**: `""` ### `schema_registry.oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `schema_registry.oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `schema_registry.oauth2` Configures authentication with OAuth version 2 using the client credentials token flow. To exchange a refresh token instead, add a `grant_type` parameter with the value `refresh_token` and a `refresh_token` parameter with the token to `endpoint_params`. **Type**: `object` ### `schema_registry.oauth2.client_key` A value used to identify the client to the token provider. **Type**: `string` **Default**: `""` ### `schema_registry.oauth2.client_secret` The secret used to establish ownership of the client key. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth2.enabled` Whether to use OAuth version 2 in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.oauth2.endpoint_params` A map of optional parameters to send to the token provider with client credentials token requests. Each value must be an array of strings. **Type**: `object` **Default**: `{}` ```yaml # Examples: endpoint_params: audience: - https://example.com resource: - https://api.example.com ``` ### `schema_registry.oauth2.scopes[]` A list of requested permissions (optional). **Type**: `array` **Default**: `[]` ### `schema_registry.oauth2.token_url` The URL of the token provider. **Type**: `string` **Default**: `""` ### `schema_registry.timeout` HTTP client timeout for Schema Registry requests. **Type**: `string` **Default**: `5s` ### `schema_registry.tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `schema_registry.tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `schema_registry.tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `schema_registry.tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `schema_registry.tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `schema_registry.tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `schema_registry.tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `schema_registry.tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `schema_registry.trace_subject` Schema subject name for trace data. Defaults to 'redpanda-otel-traces' for protobuf encoding or 'redpanda-otel-traces-json' for JSON encoding. **Type**: `string` **Default**: `""` ### `schema_registry.url` Schema Registry URL for schema operations. **Type**: `string` ```yaml # Examples: url: http://localhost:8081 ``` ### `tcp` TCP listener socket configuration. **Type**: `object` ### `tcp.reuse_addr` Enable SO_REUSEADDR, allowing binding to ports in TIME_WAIT state. Useful for graceful restarts and config reloads where the server needs to rebind to the same port immediately after shutdown. **Type**: `bool` **Default**: `false` ### `tcp.reuse_port` Enable SO_REUSEPORT, allowing multiple sockets to bind to the same port for load balancing across multiple processes/threads. **Type**: `bool` **Default**: `false` ### `tls` TLS configuration for gRPC. **Type**: `object` ### `tls.cert_file` Path to the TLS certificate file. **Type**: `string` **Default**: `""` ### `tls.enabled` Enable TLS connections. **Type**: `bool` **Default**: `false` ### `tls.key_file` Path to the TLS key file. **Type**: `string` **Default**: `""` --- # Page 74: otlp_http **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/otlp_http.md --- # otlp_http Receive OpenTelemetry traces, logs, and metrics via OTLP/HTTP protocol. Exposes an OpenTelemetry Collector HTTP receiver that accepts traces, logs, and metrics via HTTP. Telemetry data is received in OTLP format (protobuf or JSON) and converted to individual Redpanda OTEL v1 messages. Each signal (span, log record, or metric) becomes a separate message with embedded Resource and Scope metadata. ## Endpoints - `/v1/traces`: OpenTelemetry traces - `/v1/logs`: OpenTelemetry logs - `/v1/metrics`: OpenTelemetry metrics ## Protocols This input supports OTLP/HTTP on the default port 4318. It accepts both: - `application/x-protobuf`: OTLP protobuf format - `application/json`: OTLP JSON format ## Output format Each OTLP export request is unbatched into individual messages: - **Traces**: One message per span - **Logs**: One message per log record - **Metrics**: One message per metric Messages are encoded in Redpanda OTEL v1 format (protobuf or JSON, configurable using the `encoding` field). ## Metadata This input adds the following metadata fields to each message: - `otel_signal_type`: The signal type (`trace`, `log`, or `metric`). - `otel_encoding`: The message encoding (`json` or `protobuf`). - `otel_trace_id`: The base64-encoded trace ID. Set on trace messages only. - `otel_span_id`: The base64-encoded span ID. Set on trace messages only. You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ## Authentication When `auth_token` is configured, clients must include the token in the HTTP `Authorization` header: **Go client example:** ```go import ( "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" ) exporter, err := otlptracehttp.New(ctx, otlptracehttp.WithEndpoint("localhost:4318"), otlptracehttp.WithInsecure(), // or WithTLSClientConfig() for TLS otlptracehttp.WithHeaders(map[string]string{ "Authorization": "Bearer your-token-here", }), ) ``` **cURL example:** ```bash curl -X POST http://localhost:4318/v1/traces \ -H "Content-Type: application/x-protobuf" \ -H "Authorization: Bearer your-token-here" \ --data-binary @traces.pb ``` **Environment variable:** ```bash export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer your-token-here" ``` ## Rate limiting You can specify an optional rate limit resource using the `rate_limit` field to throttle incoming requests. When the rate limit is reached, the input delays processing each request until the rate limit resource grants access. ### Common ```yml input: label: "" otlp_http: encoding: json address: 0.0.0.0:4318 rate_limit: "" ``` ### Advanced ```yml input: label: "" otlp_http: encoding: json address: 0.0.0.0:4318 tls: enabled: false cert_file: "" key_file: "" auth_token: "" read_timeout: 10s write_timeout: 10s max_body_size: 4194304 rate_limit: "" tcp: reuse_addr: false reuse_port: false schema_registry: url: "" # No default (required) timeout: 5s tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] oauth2: enabled: false client_key: "" client_secret: "" token_url: "" scopes: [] endpoint_params: {} oauth: enabled: false consumer_key: "" consumer_secret: "" access_token: "" access_token_secret: "" basic_auth: enabled: false username: "" password: "" jwt: enabled: false private_key_file: "" signing_method: "" claims: {} headers: {} common_subject: "" trace_subject: "" log_subject: "" metric_subject: "" ``` ## Fields ### `address` The address to listen on for HTTP connections. **Type**: `string` **Default**: `0.0.0.0:4318` ### `auth_token` Optional bearer token for authentication. When set, requests must include the `Authorization: Bearer ` header. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `encoding` The encoding format for messages in each batch, either `protobuf` or `json`. **Type**: `string` **Default**: `json` **Options**: `protobuf`, `json` ### `max_body_size` Maximum size of HTTP request body in bytes. **Type**: `int` **Default**: `4194304` ### `rate_limit` The name of an optional rate limit resource to throttle incoming requests. **Type**: `string` **Default**: `""` ### `read_timeout` Maximum duration for reading the entire request. **Type**: `string` **Default**: `10s` ### `schema_registry` Optional Schema Registry configuration. When set, the input registers the OTLP schemas for each signal type and prepends the Schema Registry wire format header to each message. **Type**: `object` ### `schema_registry.basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `schema_registry.basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `schema_registry.common_subject` Schema subject name for the common protobuf schema. Only used when encoding is 'protobuf'. Defaults to 'redpanda-otel-common' for protobuf encoding or 'redpanda-otel-common-json' for JSON encoding. **Type**: `string` **Default**: `""` ### `schema_registry.jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `schema_registry.jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `schema_registry.jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `schema_registry.jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `schema_registry.jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `schema_registry.log_subject` Schema subject name for log data. Defaults to 'redpanda-otel-logs' for protobuf encoding or 'redpanda-otel-logs-json' for JSON encoding. **Type**: `string` **Default**: `""` ### `schema_registry.metric_subject` Schema subject name for metric data. Defaults to 'redpanda-otel-metrics' for protobuf encoding or 'redpanda-otel-metrics-json' for JSON encoding. **Type**: `string` **Default**: `""` ### `schema_registry.oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `schema_registry.oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `schema_registry.oauth2` Configures authentication with OAuth version 2 using the client credentials token flow. To exchange a refresh token instead, add a `grant_type` parameter with the value `refresh_token` and a `refresh_token` parameter with the token to `endpoint_params`. **Type**: `object` ### `schema_registry.oauth2.client_key` A value used to identify the client to the token provider. **Type**: `string` **Default**: `""` ### `schema_registry.oauth2.client_secret` The secret used to establish ownership of the client key. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth2.enabled` Whether to use OAuth version 2 in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.oauth2.endpoint_params` A map of optional parameters to send to the token provider with client credentials token requests. Each value must be an array of strings. **Type**: `object` **Default**: `{}` ```yaml # Examples: endpoint_params: audience: - https://example.com resource: - https://api.example.com ``` ### `schema_registry.oauth2.scopes[]` A list of requested permissions (optional). **Type**: `array` **Default**: `[]` ### `schema_registry.oauth2.token_url` The URL of the token provider. **Type**: `string` **Default**: `""` ### `schema_registry.timeout` HTTP client timeout for Schema Registry requests. **Type**: `string` **Default**: `5s` ### `schema_registry.tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `schema_registry.tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `schema_registry.tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `schema_registry.tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `schema_registry.tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `schema_registry.tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `schema_registry.tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `schema_registry.tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `schema_registry.trace_subject` Schema subject name for trace data. Defaults to 'redpanda-otel-traces' for protobuf encoding or 'redpanda-otel-traces-json' for JSON encoding. **Type**: `string` **Default**: `""` ### `schema_registry.url` Schema Registry URL for schema operations. **Type**: `string` ```yaml # Examples: url: http://localhost:8081 ``` ### `tcp` TCP listener socket configuration. **Type**: `object` ### `tcp.reuse_addr` Enable SO_REUSEADDR, allowing binding to ports in TIME_WAIT state. Useful for graceful restarts and config reloads where the server needs to rebind to the same port immediately after shutdown. **Type**: `bool` **Default**: `false` ### `tcp.reuse_port` Enable SO_REUSEPORT, allowing multiple sockets to bind to the same port for load balancing across multiple processes/threads. **Type**: `bool` **Default**: `false` ### `tls` TLS configuration for HTTP. **Type**: `object` ### `tls.cert_file` Path to the TLS certificate file. **Type**: `string` **Default**: `""` ### `tls.enabled` Enable TLS connections. **Type**: `bool` **Default**: `false` ### `tls.key_file` Path to the TLS key file. **Type**: `string` **Default**: `""` ### `write_timeout` Maximum duration for writing the response. **Type**: `string` **Default**: `10s` --- # Page 75: postgres_cdc **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/postgres_cdc.md --- # postgres_cdc Streams changes from a PostgreSQL database using logical replication. Streams changes from a PostgreSQL database for Change Data Capture (CDC). Additionally, if [`stream_snapshot`](#stream_snapshot) is set to true, then the existing data in the database is also streamed too. Use [`tables`](#tables) to choose which tables to stream changes from. This input was introduced in version 4.40.0 as `pg_stream` and renamed to `postgres_cdc` in version 4.43.0. The `pg_stream` name still works, but it’s deprecated. ## Requirements The source database must have logical replication enabled, which means its `wal_level` setting must be `logical`. The database must also accept replication connections from the host that runs Redpanda Connect, for example through a `replication` entry in `pg_hba.conf`. ## Snapshot and streaming modes This input reads changes through a logical replication slot, which it creates if the slot does not already exist. PostgreSQL retains the write-ahead log (WAL) that the slot still needs, so the input can resume from its last acknowledged position after a restart. When `stream_snapshot` is `true` and the replication slot does not exist yet, this input first reads a consistent snapshot of the tables listed in `tables`. It then streams the changes recorded in the write-ahead log (WAL) since that snapshot was taken. The input creates the replication slot only after every snapshot message is acknowledged, so if the pipeline restarts before then, the snapshot runs again from the start. After the slot exists, a restart resumes streaming from the last acknowledged position in the slot without taking another snapshot. When `stream_snapshot` is `false`, this input creates the replication slot and streams changes from the current end of the WAL. After a restart, it resumes from the last acknowledged position in the slot. ## Data types This input encodes each row as JSON, so each column value becomes the closest JSON type. The PostgreSQL types stay in the `schema` metadata. The following table shows how each PostgreSQL type is represented in a message: | PostgreSQL type | Value in the message | | --- | --- | | `BOOL` | Boolean | | Integer and floating-point types | Number | | `DATE`, `TIMESTAMP`, `TIMESTAMPTZ` | String in RFC 3339 format | | `BYTEA` | Base64-encoded string | | `JSON`, `JSONB` | Structured value | | `NUMERIC`, `DECIMAL` | String, to preserve precision | | `TEXT`, `VARCHAR`, `UUID`, `TIME`, `TIMETZ` | String | | `INTEGER[]`, `TEXT[]` | Array, for example `[1,2,3]` or `["a","b"]` | | `INET` | String in CIDR notation, for example `"192.168.1.1/32"` | | `POINT`, `TSRANGE`, `TSVECTOR` | String in its PostgreSQL text form, for example `"(45.5,-122.6)"`, `"[2024-01-01 00:00:00,2024-12-31 00:00:00)"`, or `"'brown':3 'fox':4"` | ## Metadata This input adds the following metadata fields to each message: - `table`: Name of the table that the message originated from. - `operation`: Type of operation that generated the message: `read`, `insert`, `update`, or `delete`. `read` is from messages that are read in the initial snapshot phase. This will also be `begin` and `commit` if `include_transaction_markers` is enabled. - `lsn`: The log sequence number in PostgreSQL. - `schema`: The table schema in benthos common schema format, compatible with processors like `parquet_encode`. - `commit_ts_ms`: The commit timestamp of the transaction as a Unix millisecond timestamp. Not set for snapshot reads. - `before`: The pre-change state of the row for update and delete operations, in benthos common schema format. For updates, availability depends on the table’s `REPLICA IDENTITY` setting - with the default identity only key columns are present, with `REPLICA IDENTITY FULL` all columns are present. ## Unserializable rows Some rows have decoded WAL data that cannot be marshalled to JSON, in practice non-finite floating point values such as NaN or Infinity. Such a row is published with its error set and a plain-text rendering of the row as the payload. This happens instead of stalling the stream or silently dropping the row. Such messages can be inspected with the `errored()` Bloblang function and routed with error-handling components (for example a `switch` output with `reject_errored`, or a dead-letter queue). If not handled, they flow through the pipeline like any other message. The replication checkpoint advances past them normally once acknowledged. ## Metrics This input emits the following metrics: - `postgres_snapshot_progress`: A gauge, labeled by `table`, that reports the estimated fraction of each table’s rows read so far in the initial snapshot. The value is 1 when the table’s snapshot completes. The total row count comes from the PostgreSQL planner’s row estimate, so the value is approximate until then. - `postgres_replication_lag_bytes`: A gauge that reports how far, in bytes, the replication slot’s restart position lags behind the current position of the source database’s write-ahead log (WAL). - `postgres_publication_missing_tables`: A gauge that reports how many required tables are missing from the publication. The required tables are the tables in `tables` and the signal table, if `signal_table_name` is set. It is only updated when `self_manage_publication` is `false`, and stays 0 otherwise. > 📝 **NOTE** > > A snapshot reads from an exported snapshot transaction, which holds the `xmin` horizon for all tables for as long as the snapshot runs, not only for the table being snapshotted. While the horizon is held, PostgreSQL cannot remove row versions that became dead after the snapshot started, so snapshotting a large table that takes hours or days to complete delays that cleanup for the whole duration. To load existing data from large tables without holding the horizon for the whole load, use an [incremental snapshot](#incremental_snapshot) instead. ### Common ```yml input: label: "" postgres_cdc: dsn: "" # No default (required) include_transaction_markers: false stream_snapshot: false snapshot_batch_size: 1000 schema: "" # No default (required) tables: [] # No default (required) checkpoint_limit: 1024 temporary_slot: false slot_name: "" # No default (required) pg_standby_timeout: 10s pg_wal_monitor_interval: 3s max_parallel_snapshot_tables: 1 auto_replay_nacks: true batch_transactions: false batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml input: label: "" postgres_cdc: dsn: "" # No default (required) include_transaction_markers: false stream_snapshot: false snapshot_batch_size: 1000 schema: "" # No default (required) tables: [] # No default (required) checkpoint_limit: 1024 temporary_slot: false slot_name: "" # No default (required) self_manage_publication: true pg_standby_timeout: 10s pg_wal_monitor_interval: 3s max_parallel_snapshot_tables: 1 unchanged_toast_value: null heartbeat_interval: 1h tls: skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] aws: enabled: false region: "" # No default (optional) endpoint: "" # No default (required) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) roles: [] # No default (optional) signal_table_name: "" incremental_snapshot: enabled: false chunk_size: 1024 heartbeat_interval: 1s retry_cooldown: 30s checkpoint_cache: "" # No default (optional) checkpoint_cache_key: postgres_cdc_incremental_snapshot auto_replay_nacks: true batch_transactions: false batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Set up the source database - PostgreSQL version 14 or later - A connection to the primary PostgreSQL instance. This input does not support connecting to a read replica or a physical standby, such as an Amazon RDS for PostgreSQL read replica. - Network access from the cluster where your Redpanda Connect pipeline is running to the source database environment. For detailed networking information, including how to set up a VPC peering connection, see [Redpanda Cloud Networking](https://docs.redpanda.com/cloud-data-platform/networking/). - Logical replication enabled on your PostgreSQL cluster To check whether logical replication is already enabled, run the following query: ```SQL SHOW wal_level; ``` If the `wal_level` value is `logical`, you can start to use this connector. Otherwise, choose from the following sets of instructions to update your replication settings. ### Cloud platforms - [Amazon RDS for PostgreSQL DB](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Concepts.General.FeatureSupport.LogicalReplication.html) - [Azure Database for PostgreSQL](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-logical#prerequisites-for-logical-replication-and-logical-decoding) - [Google Cloud SQL for PostgreSQL](https://cloud.google.com/sql/docs/postgres/replication/configure-logical-replication), including creating a user with replication privileges - [Neon](https://neon.tech/docs/guides/logical-replication-guide) ### Self-Hosted PostgreSQL Use an account with sufficient permissions (superuser) to update your replication settings. 1. Open the `postgresql.conf` file. 2. Find the `wal_level` parameter. 3. Update the parameter value to `wal_level = logical`. If you already use replication slots, you may need to increase the limit on replication slots (`max_replication_slots`). The `max_wal_senders` parameter value must also be greater than or equal to `max_replication_slots`. 4. Restart the PostgreSQL server. For this input to make a successful connection to your database, also make sure that it allows replication connections. 1. Open the `pg_hba.conf` file. 2. Update this line. ```yaml host replication /32 md5 ``` Replace the following placeholders with your own values: - ``: The username from an account with superuser privileges. - ``: The IP address of the server where you are running Redpanda Connect. 3. Restart the PostgreSQL server. ## Troubleshoot replication failures If the database snapshot fails, the replication slot has only an incomplete record of the existing data in your database. To maintain data integrity, you must drop the replication slot manually in your source database and run the Redpanda Connect pipeline again. ```SQL SELECT pg_drop_replication_slot(SLOT_NAME); ``` ## Receive TOAST and deleted values For full visibility of all data updates, you can also choose to stream [TOAST](https://www.postgresql.org/docs/current/storage-toast.html) and deleted values. To enable this option, run the following query on your source database: ```SQL ALTER TABLE large_data REPLICA IDENTITY FULL; ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `aws` AWS IAM authentication configuration for PostgreSQL instances. When enabled, IAM credentials are used to generate temporary authentication tokens instead of a static password. This is useful for connecting to Amazon RDS or Aurora PostgreSQL instances with IAM database authentication enabled. The generated tokens are valid for 15 minutes and are automatically refreshed. For more information about AWS credentials configuration, see the [credentials for AWS](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/) guide. **Type**: `object` ### `aws.enabled` Enable AWS IAM authentication for PostgreSQL. When enabled, an IAM authentication token is generated and used as the password. **Type**: `bool` **Default**: `false` ### `aws.endpoint` The PostgreSQL endpoint hostname (for example, mydb.abc123.us-east-1.rds.amazonaws.com). **Type**: `string` ### `aws.id` The AWS access key ID to authenticate with. When empty, the default AWS credential chain is used. **Type**: `string` ### `aws.region` The AWS region where the PostgreSQL instance is located. The region is used to sign the IAM authentication token and for STS calls when assuming roles. If no region is specified, the environment default is used. **Type**: `string` ### `aws.role` Optional AWS IAM role ARN to assume for authentication. When `roles` is also set, this role is assumed first and the `roles` entries are assumed after it. **Type**: `string` ### `aws.role_external_id` Optional external ID to use when assuming the role set in `role`. Each entry in `roles` sets its own external ID. **Type**: `string` ### `aws.roles[]` Optional array of AWS IAM roles to assume for authentication. Roles are assumed in sequence, each using the credentials of the previous one, enabling chaining for purposes such as cross-account access. Each role can optionally specify an external ID. When `role` is also set, it is assumed before the first entry. **Type**: `array` ### `aws.roles[].role` AWS IAM role ARN to assume. **Type**: `string` **Default**: `""` ### `aws.roles[].role_external_id` Optional external ID for the role assumption. **Type**: `string` **Default**: `""` ### `aws.secret` The AWS secret access key that pairs with `id`. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `aws.token` The AWS session token to use with `id` and `secret`. Required only when using short-term credentials. **Type**: `string` ### `batch_transactions` When set to true, the rows of each replication transaction are emitted as one batch instead of one message per row. A batch never contains rows from more than one transaction. Large transactions are split into several batches. A batch holds at most 1000 rows, 4 MiB of WAL, or half of `checkpoint_limit`, whichever is smallest. Use this to let batch-aware outputs, such as a multi-row `sql_insert` or a Kafka producer, write a transaction’s rows in one operation. It also lowers the per-message overhead of streaming. This option is off by default because it changes the unit of failure and retry from one row to one transaction. If an output rejects a batch because of one bad row, outputs such as `fallback` handle the whole batch, including the good rows. Leave it off if your pipeline routes individual bad rows to a dead-letter queue. This option cannot be combined with a `batching` policy: it bypasses the policy, including its processors. Snapshot pages are not affected: each page of `snapshot_batch_size` rows is always emitted as one batch. **Type**: `bool` **Default**: `false` ### `batching` Optional [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/) for the emitted messages. By default, streaming rows arrive one message at a time and snapshot rows arrive one page at a time. To change this: - Set a policy to control batch size and timing. It applies to both the snapshot and the stream. - Set `batch_transactions` to receive each replication transaction as one batch. This cannot be combined with a policy. If the policy’s `processors` fail on a batch, its rows are published as the batcher held them, with their error set, rather than dropped or retried, so error-handling components can route them. A processor earlier in the chain may already have altered them. If the processors drop every row of a batch, the position those rows reached is still acknowledged. **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `checkpoint_limit` The maximum number of messages that this input can process at a given time. Increasing this limit enables parallel processing, and batching at the output level. To preserve at-least-once guarantees, any given log sequence number (LSN) is not acknowledged until all messages up to that position are delivered. **Type**: `int` **Default**: `1024` ### `dsn` The data source name (DSN) of the PostgreSQL database from which you want to stream updates. Use the format `postgres://[user[:password]@][netloc][:port][/dbname][?param1=value1&…​]`. PostgreSQL enforces SSL by default. To disable SSL, for example in a secure environment, add `sslmode=disable` to the connection string. **Type**: `string` ```yaml # Examples: dsn: postgres://foouser:foopass@localhost:5432/foodb?sslmode=disable ``` ### `heartbeat_interval` The interval between heartbeat messages, which Redpanda Connect writes to the write-ahead log (WAL) using the `pg_logical_emit_message` function. Heartbeat messages are useful when you subscribe to data changes from tables with low activity, while other tables in the database have higher-frequency updates. Without new messages to acknowledge, PostgreSQL cannot reclaim the WAL, which can exhaust the local disk. Heartbeat messages allow Redpanda Connect to periodically acknowledge new messages even when no data updates occur. Each acknowledgement advances the committed point in the WAL, which ensures that PostgreSQL can safely reclaim older log segments. Each heartbeat message has the prefix `redpanda_connect_`, where `` is the value of `slot_name`. Its content is `{"type":"heartbeat"}`. This input does not pass heartbeats to the pipeline. Other logical decoding consumers of the same database can receive them, so filter on this prefix to ignore them. Set `heartbeat_interval` to `0s` to disable heartbeats. The input rejects `0s` when `incremental_snapshot.enabled` is `true`, because the incremental snapshot would never advance on a quiet table. Heartbeats also pace `incremental_snapshot`. On a quiet table they’re the only thing that advances the snapshot. This interval keeps the slot current, and `incremental_snapshot.heartbeat_interval` applies alongside it: the more frequent of the two wins for the life of the input. **Type**: `string` **Default**: `1h` ```yaml # Examples: heartbeat_interval: 0s # --- heartbeat_interval: 24h ``` ### `include_transaction_markers` When set to `true`, creates empty messages for the `BEGIN` and `COMMIT` operations that start and complete each transaction. Messages with the `operation` metadata field set to `begin` or `commit` have null message payloads. **Type**: `bool` **Default**: `false` ### `incremental_snapshot` Configures chunked snapshotting that runs alongside replication streaming. **Type**: `object` ### `incremental_snapshot.checkpoint_cache` A [cache resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) storing the snapshot’s progress, so a restart resumes instead of starting over. Required when `enabled` is `true`. **Type**: `string` ### `incremental_snapshot.checkpoint_cache_key` The key used to store the incremental snapshot progress in `checkpoint_cache`. Use a different key if multiple incremental snapshots share the same cache. Changing or clearing this key discards the record of which tables have been backfilled, so the next snapshot starts from scratch. To snapshot a finished table again, send a `snapshot-execute` signal instead. It doesn’t need the key changed. **Type**: `string` **Default**: `postgres_cdc_incremental_snapshot` ### `incremental_snapshot.chunk_size` The number of rows to read per chunk while incrementally snapshotting a table. **Type**: `int` **Default**: `1024` ### `incremental_snapshot.enabled` Backfills tables in chunks alongside replication, on request. Tables are not configured here: insert a `snapshot-execute` row into `signal_table_name` to ask for one, so a backfill can be started at any time without a config change. A signal table is therefore required. Unlike `stream_snapshot` this needs no up-front snapshot phase and does not delay replication. The two are mutually exclusive: both read the same rows, so enabling either alongside the other would deliver everything twice. Progress is driven by the replication stream: each streamed transaction releases a buffered chunk, and several more follow immediately if the database was idle during the read. Quiet tables therefore advance in bursts on each heartbeat, paced by `heartbeat_interval`. A row can arrive twice, once from replication and once from the backfill: when a primary key reuses or fills a gap below the table’s current maximum, or, whatever the key type, when a row is inserted after replication starts but before the snapshot reaches its table. Treat rows as idempotent upserts keyed by primary key, as is standard CDC practice. The following primary keys are currently not supported and a signal naming such a table is rejected and logged rather than started: `bytea`, `interval`, `bit`, `bit varying`, and any range or multirange type. Every other key type is supported, composite keys included. **Type**: `bool` **Default**: `false` ### `incremental_snapshot.heartbeat_interval` How often to heartbeat while `enabled` is `true`. The snapshot only advances on a streamed transaction, so on quiet tables this paces it. Raise it to reduce write load at the cost of a slower backfill. Whichever of this and the top-level `heartbeat_interval` is more frequent wins, and applies for the life of the input: it is fixed at startup, and stays in force between backfills as well as during them. Heartbeats are transactional only while a backfill is in progress, since that is the only time the snapshot needs a transaction id from one; between backfills they cost nothing extra. **Type**: `string` **Default**: `1s` ### `incremental_snapshot.retry_cooldown` How long the backfill waits before retrying a chunk read that failed transiently, usually because of a conflicting lock on the table being backfilled, such as `VACUUM FULL` or most `ALTER TABLE` statements. The snapshot’s chunk read shares the goroutine that reads the replication stream, so each retry that blocks on the lock delays replication for every table. Retrying on every streamed transaction would repeat that delay for as long as the lock is held. Raise it to protect replication latency during a long migration, or lower it to resume the backfill sooner after a brief lock. Setting it to `0s` disables the cooldown, retrying on the next streamed transaction. **Type**: `string` **Default**: `30s` ### `max_parallel_snapshot_tables` Specify the maximum number of tables that are processed in parallel when the initial snapshot of the source database is taken. **Type**: `int` **Default**: `1` ### `pg_standby_timeout` Specify the standby timeout after which an idle connection is refreshed to keep the connection alive. **Type**: `string` **Default**: `10s` ```yaml # Examples: pg_standby_timeout: 30s ``` ### `pg_wal_monitor_interval` How often to report changes to the replication lag and write them to Redpanda Connect metrics. When [`self_manage_publication`](#self_manage_publication) is `false`, this interval also sets how often the input checks that the publication still includes the required tables. **Type**: `string` **Default**: `3s` ```yaml # Examples: pg_wal_monitor_interval: 6s ``` ### `schema` The PostgreSQL schema from which to replicate data. **Type**: `string` ```yaml # Examples: schema: public # --- schema: '"MyCaseSensitiveSchemaNeedingQuotes"' ``` ### `self_manage_publication` Whether this input creates and maintains the publication `pglog_stream_`. When `true`, on every connect the input creates the publication if it is missing. Otherwise it adds and drops tables until the publication lists exactly `tables` (plus `signal_table_name`, if set). A publication created `FOR ALL TABLES` is left as is when `tables` is empty. When `tables` is set and the publication is `FOR ALL TABLES` or `FOR TABLES IN SCHEMA`, the input fails to start rather than stream tables that are not in the list. The error gives the SQL statement that fixes the publication. Set this to `false` when the publication is owned outside the connector, for example by a DBA. The replication user then needs no ownership of the replicated tables, and the input never runs `CREATE PUBLICATION` or `ALTER PUBLICATION`. Instead, on every connect it checks the publication. The publication must exist, publish inserts, updates and deletes (the default `publish` option), and include every table in `tables` and the signal table, if `signal_table_name` is set. Otherwise the input fails with an error naming whatever is missing. A partitioned table counts as included only when every one of its partitions is published, directly or through the partitioned table. This check requires PostgreSQL 12 or later. While the input runs, it repeats the table check every `pg_wal_monitor_interval`. When a table has been removed from the publication, the input logs an error and reports the count in the `postgres_publication_missing_tables` metric. PostgreSQL does not capture a table’s changes while it is out of the publication, so adding it back does not recover them. Request an incremental snapshot of the table to backfill them. A table the publication streams with a row filter or a column list (PostgreSQL 15 or later) is logged as a warning at connect. Only the rows and columns it selects are streamed. An incremental snapshot is only accepted for a table the publication streams under the table’s own name, with no row filter or column list. That excludes a partitioned table whose partitions are published without `publish_via_partition_root`, and a partition published through its root with that option. Their changes stream under another name, so they cannot be deduplicated against the backfill. The check is repeated before each chunk, and a backfill whose table no longer qualifies fails. With `false`, the publication decides what is streamed. Every table it includes is replicated, whether or not it is listed in `tables`. A table added with `ALTER PUBLICATION …​ ADD TABLE` starts streaming without a restart. `tables` then lists the tables that must be in the publication, the tables `stream_snapshot` reads, and the tables an incremental snapshot signal may name. Leave it empty to accept whatever the publication includes. To add a table, add it to the publication first, then to `tables`, and request an incremental snapshot to backfill it if needed. To remove one, remove it from `tables` first, then from the publication. An incremental snapshot signal naming a table the publication does not include is rejected. **Type**: `bool` **Default**: `true` ### `signal_table_name` The name of the table used to send control signals to the connector, excluding the schema. The table must exist in the schema configured via the `schema` field. It must not also appear in `tables`. The signal table is implicitly added to the publication and excluded from snapshot scans, so listing it in both places is rejected at startup. Startup validation checks column names only, not types. A wrong column type (for example `data JSONB` instead of `TEXT`) is only caught at runtime, on the first signal row read. The table must have at least these columns: - **id**: any type representable as a string (for example `SERIAL`, `BIGSERIAL`, `UUID`, `VARCHAR`) - **type**: should be `VARCHAR` or another string type (the signal type, see supported signals below) - **data**: should be `TEXT`, a JSON object containing signal parameters Create the table with: ```sql CREATE TABLE . ( id SERIAL PRIMARY KEY, type VARCHAR(32), data TEXT ); ``` Signal rows are published as regular output messages (`operation=insert`, `table=`). To exclude them from downstream processing, filter on the `table` metadata field using a `mapping` processor: ```yaml pipeline: processors: - mapping: | root = if @table == "rpcn_signal_table" { deleted() } else { this } ``` **Supported signals** **`log`**: recognized and logged when received. The `data` column must contain a JSON object with a `message` key, whose value is written to the connector’s log output. ```sql INSERT INTO . (type, data) VALUES ('log', '{"message": "Signal message"}'); ``` **`snapshot-execute`**: backfills the named tables incrementally, alongside streaming. Requires `incremental_snapshot.enabled`. The `data` column must contain a JSON object with a `tables` key listing table names in the configured `schema`, excluding the schema itself: ```sql INSERT INTO . (type, data) VALUES ('snapshot-execute', '{"tables": ["orders", "customers"]}'); ``` Each table must appear in `tables`, or that list must be empty, replicating everything. An unreplicated table has no live changes to deduplicate its backfill against, so a write landing after its chunk is read would be lost. Each must also have a primary key, which the backfill pages by. A table replicated under `REPLICA IDENTITY FULL` without one cannot be snapshotted. That key may not be `bytea`. Its value is read back and bound as the next chunk’s bound, and raw bytes survive neither that nor the checkpoint. **Partitioned tables** Partitioned tables are not yet supported in incremental snapshotting unless their publication sets `publish_via_partition_root = true`. PostgreSQL otherwise publishes their changes under the individual partitions' names while the snapshot backfill reads the parent, so updates to already-read snapshot rows cannot be detected. A signal naming a table with partitions is rejected and logged, and it is left to replication alone. If a check cannot be run at all (for example, because the connection resets), the stream restarts and the signal is read again, so the request is not lost. Each table joins the back of the backfill queue. A table already queued or being backfilled is skipped and logged. A table whose backfill has finished is read again from the start. **Tables with large (TOASTed) column values** Set `REPLICA IDENTITY FULL` on a table with large (TOASTed) column values before backfilling using incremental snapshotting. PostgreSQL omits an unchanged TOAST value from an `UPDATE`, sending a marker instead. Under the default replica identity there is nothing in the message to recover it from, so `unchanged_toast_value` is emitted for that column. For a row updated while its chunk is buffered, the backfilled copy that held the real value is dropped as a duplicate. This leaves the placeholder as the only value the destination ever receives for it. `REPLICA IDENTITY FULL` makes PostgreSQL send the previous row, which the connector reads the real value from. It can be set for the backfill and reverted afterwards. It takes a brief lock but rewrites nothing. **Type**: `string` **Default**: `""` ```yaml # Examples: signal_table_name: rpcn_signal_table ``` ### `slot_name` The name of the PostgreSQL logical replication slot to use. If the slot does not exist, the input creates it. You can also create the slot manually before starting replication. To avoid granting the replication user permission to create publications, you can create the publications manually ahead of time. This input uses the naming pattern `pglog_stream_`, so create publications using this convention. Set `self_manage_publication` to `false` so the input also never alters them. Starting with version 4.48.0, this input no longer adds the prefix `rs_` to the names of the replication slots it creates. To keep using a replication slot that an earlier version created, add the `rs_` prefix to this field yourself. **Type**: `string` ```yaml # Examples: slot_name: my_test_slot ``` ### `snapshot_batch_size` The number of table rows to fetch in each batch when querying the snapshot. This option is only available when `stream_snapshot` is set to `true`. **Type**: `int` **Default**: `1000` ```yaml # Examples: snapshot_batch_size: 10000 ``` ### `stream_snapshot` When set to `true`, this input streams a snapshot of all existing data in the source database before streaming data changes. To use this setting, all database tables that you want to replicate _must_ have a primary key, which allows the input to read each table in parallel. This setting has no effect if `tables` is left empty, since the snapshot is only planned for tables listed there. **Type**: `bool` **Default**: `false` ```yaml # Examples: stream_snapshot: true ``` ### `tables[]` A list of database table names to include in the snapshot and logical replication. Specify each table name as a separate item. If left empty, and `self_manage_publication` is `true`, the underlying PostgreSQL publication is created `FOR ALL TABLES`, which replicates every table in every schema of the database, ignoring `schema`. An existing publication of the same name that lists specific tables is dropped and recreated `FOR ALL TABLES` with the same options, which requires a superuser. This also disables `stream_snapshot`. The initial snapshot is only planned for tables listed here. **Type**: `array` ```yaml # Examples: tables: - my_table_1 - '"MyCaseSensitiveTableNeedingQuotes"' ``` ### `temporary_slot` If set to `true`, the input creates a temporary replication slot that is automatically dropped when the connection to your source database is closed. You might use this option to: - Avoid data accumulating in the replication slot when a pipeline is paused or stopped. - Test the connector. If the pipeline is restarted and `stream_snapshot` is enabled, another data snapshot is taken before data updates are streamed. **Type**: `bool` **Default**: `false` ### `tls` Custom TLS settings for the PostgreSQL connection. When `enabled` is `true`, these settings replace the TLS settings derived from the `dsn` and from `PG*` environment variables such as `PGSSLMODE`, and the server name is set to the host from the DSN. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `unchanged_toast_value` Specify the value to emit when unchanged TOAST values appear in the message stream. Unchanged values occur for data updates and deletes when `REPLICA IDENTITY` is not set to `FULL`. Prefer a distinctive sentinel over the `null` default. A `null` can’t be told apart from a column that is genuinely null, so a consumer can’t skip the field instead of overwriting a good value with it. This matters most alongside `incremental_snapshot`, where a backfilled row can be the only delivery that carries a large column’s real value. See [`signal_table_name`](#signal_table_name). **Type**: `unknown` **Default**: `null` ```yaml # Examples: unchanged_toast_value: __redpanda_connect_unchanged_toast_value__ ``` ## Example pipeline You can run the following pipeline locally to check that data updates are streamed from your source database to Redpanda Connect. All transactions are written to stdout. ```yml input: label: "postgres_cdc" postgres_cdc: dsn: postgres://user:password@host:port/dbname include_transaction_markers: false slot_name: test_slot_native_decoder snapshot_batch_size: 100000 stream_snapshot: true temporary_slot: true schema: schema_name tables: - table_name cache_resources: - label: data_caching file: directory: /tmp/cache output: label: main stdout: {} ``` --- # Page 76: read_until **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/read_until.md --- # read_until Reads messages from a child input until a consumed message passes a [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/), at which point the input closes. It is also possible to configure a timeout after which the input is closed if no new messages arrive in that period. Messages are read continuously while the query check returns false, when the query returns true the message that triggered the check is sent out and the input is closed. Use this to define inputs where the stream should end once a certain message appears. If the idle timeout is configured, the input will be closed if no new messages arrive after that period of time. Use this field if you want to empty out and close an input that doesn’t have a logical end. Sometimes inputs close themselves. For example, when the `file` input type reaches the end of a file it will shut down. By default this type will also shut down. If you wish for the input type to be restarted every time it shuts down until the query check is met then set `restart_input` to `true`. ## Metadata A metadata key `benthos_read_until` containing the value `final` is added to the first part of the message that triggers the input to stop. ```yml input: label: "" read_until: input: {} # No default (required) check: "" # No default (optional) idle_timeout: "" # No default (optional) restart_input: false ``` ## Fields ### `check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that should return a boolean value indicating whether the input should now be closed. **Type**: `string` ```yaml # Examples: check: this.type == "foo" # --- check: counter() >= 100 ``` ### `idle_timeout` The maximum amount of time without receiving new messages after which the input is closed. **Type**: `string` ```yaml # Examples: idle_timeout: 5s ``` ### `input` The child input to consume from. **Type**: `input` ### `restart_input` Whether the input should be reopened if it closes itself before the condition has resolved to true. **Type**: `bool` **Default**: `false` ## Examples ### Consume N Messages A common reason to use this input is to consume only N messages from an input and then stop. This can easily be done with the [`counter` function](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/#counter): ```yaml # Only read 100 messages, and then exit. input: read_until: check: counter() >= 100 input: kafka: addresses: [ TODO ] topics: [ foo, bar ] consumer_group: foogroup ``` ### Read from a kafka and close when empty A common reason to use this input is a job that consumes all messages and exits once its empty: ```yaml # Consumes all messages and exit when the last message was consumed 5s ago. input: read_until: idle_timeout: 5s input: kafka: addresses: [ TODO ] topics: [ foo, bar ] consumer_group: foogroup ``` --- # Page 77: redis_list **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redis_list.md --- # redis_list Pops messages from the beginning of a Redis list using the BLPop command. #### Common ```yml input: label: "" redis_list: url: "" # No default (required) key: "" # No default (required) auto_replay_nacks: true ``` #### Advanced ```yml input: label: "" redis_list: url: "" # No default (required) kind: simple master: "" client_name: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] key: "" # No default (required) auto_replay_nacks: true max_in_flight: 0 timeout: 5s command: blpop ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `client_name` Set the client name for the Redis connection. **Type**: `string` **Default**: `redpanda-connect` ### `command` The command used to pop elements from the Redis list **Type**: `string` **Default**: `blpop` **Options**: `blpop`, `brpop` ### `key` The key of a list to read from. **Type**: `string` ### `kind` Specifies a simple, cluster-aware, or failover-aware redis client. **Type**: `string` **Default**: `simple` **Options**: `simple`, `cluster`, `failover` ### `master` Name of the redis master when `kind` is `failover` **Type**: `string` **Default**: `""` ```yaml # Examples: master: mymaster ``` ### `max_in_flight` Optionally sets a limit on the number of messages that can be flowing through a Redpanda Connect stream pending acknowledgment from the input at any given time. Once a message has been either acknowledged or rejected (nacked) it is no longer considered pending. If the input produces logical batches then each batch is considered a single count against the maximum. **WARNING**: Batching policies at the output level will stall if this field limits the number of messages below the batching threshold. Zero (default) or lower implies no limit. **Type**: `int` **Default**: `0` ### `timeout` The length of time to poll for new messages before reattempting. **Type**: `string` **Default**: `5s` ### `tls` Custom TLS settings can be used to override system defaults. **Troubleshooting** Some cloud hosted instances of Redis (such as Azure Cache) might need some hand holding in order to establish stable connections. Unfortunately, it is often the case that TLS issues will manifest as generic error messages such as "i/o timeout". If you’re using TLS and are seeing connectivity problems consider setting `enable_renegotiation` to `true`, and ensuring that the server supports at least TLS version 1.2. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL of the target Redis server. Database is optional and is supplied as the URL path. **Type**: `string` ```yaml # Examples: url: redis://:6379 # --- url: redis://localhost:6379 # --- url: redis://foousername:foopassword@redisplace:6379 # --- url: redis://:foopassword@redisplace:6379 # --- url: redis://localhost:6379/1 # --- url: redis://localhost:6379/1,redis://localhost:6380/1 ``` --- # Page 78: redis_pubsub **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redis_pubsub.md --- # redis_pubsub Consume from a Redis publish/subscribe channel using either the SUBSCRIBE or PSUBSCRIBE commands. In order to subscribe to channels using the `PSUBSCRIBE` command set the field `use_patterns` to `true`, then you can include glob-style patterns in your channel names. For example: - `h?llo` subscribes to hello, hallo and hxllo - `h*llo` subscribes to hllo and heeeello - `h[ae]llo` subscribes to hello and hallo, but not hillo Use `\` to escape special characters if you want to match them verbatim. ## Metadata This input adds the following metadata fields to each message: - `redis_pubsub_channel` - `redis_pubsub_pattern` You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ### Common ```yml input: label: "" redis_pubsub: url: "" # No default (required) channels: [] # No default (required) use_patterns: false auto_replay_nacks: true ``` ### Advanced ```yml input: label: "" redis_pubsub: url: "" # No default (required) kind: simple master: "" client_name: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] channels: [] # No default (required) use_patterns: false auto_replay_nacks: true ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `channels[]` A list of channels to consume from. **Type**: `array` ### `client_name` Set the client name for the Redis connection. **Type**: `string` **Default**: `redpanda-connect` ### `kind` Specifies a simple, cluster-aware, or failover-aware redis client. **Type**: `string` **Default**: `simple` **Options**: `simple`, `cluster`, `failover` ### `master` Name of the redis master when `kind` is `failover` **Type**: `string` **Default**: `""` ```yaml # Examples: master: mymaster ``` ### `tls` Custom TLS settings can be used to override system defaults. **Troubleshooting** Some cloud hosted instances of Redis (such as Azure Cache) might need some hand holding in order to establish stable connections. Unfortunately, it is often the case that TLS issues will manifest as generic error messages such as "i/o timeout". If you’re using TLS and are seeing connectivity problems consider setting `enable_renegotiation` to `true`, and ensuring that the server supports at least TLS version 1.2. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL of the target Redis server. Database is optional and is supplied as the URL path. **Type**: `string` ```yaml # Examples: url: redis://:6379 # --- url: redis://localhost:6379 # --- url: redis://foousername:foopassword@redisplace:6379 # --- url: redis://:foopassword@redisplace:6379 # --- url: redis://localhost:6379/1 # --- url: redis://localhost:6379/1,redis://localhost:6380/1 ``` ### `use_patterns` Whether to use the PSUBSCRIBE command, allowing for glob-style patterns within target channel names. **Type**: `bool` **Default**: `false` --- # Page 79: redis_scan **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redis_scan.md --- # redis_scan Scans the set of keys in the current selected database and gets their values, using the Scan and Get commands. Optionally, iterates only elements matching a glob-style pattern. For example: - `*foo*` iterates only keys which contain `foo` in it. - `foo*` iterates only keys starting with `foo`. This input generates a message for each key value pair in the following format: ```json {"key":"foo","value":"bar"} ``` #### Common ```yml input: label: "" redis_scan: url: "" # No default (required) auto_replay_nacks: true match: "" ``` #### Advanced ```yml input: label: "" redis_scan: url: "" # No default (required) kind: simple master: "" client_name: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] auto_replay_nacks: true match: "" ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `client_name` Set the client name for the Redis connection. **Type**: `string` **Default**: `redpanda-connect` ### `kind` Specifies a simple, cluster-aware, or failover-aware redis client. **Type**: `string` **Default**: `simple` **Options**: `simple`, `cluster`, `failover` ### `master` Name of the redis master when `kind` is `failover` **Type**: `string` **Default**: `""` ```yaml # Examples: master: mymaster ``` ### `match` Iterates only elements matching the optional glob-style pattern. By default, it matches all elements. **Type**: `string` **Default**: `""` ```yaml # Examples: match: "*" # --- match: 1* # --- match: foo* # --- match: foo # --- match: "*4*" ``` ### `tls` Custom TLS settings can be used to override system defaults. **Troubleshooting** Some cloud hosted instances of Redis (such as Azure Cache) might need some hand holding in order to establish stable connections. Unfortunately, it is often the case that TLS issues will manifest as generic error messages such as "i/o timeout". If you’re using TLS and are seeing connectivity problems consider setting `enable_renegotiation` to `true`, and ensuring that the server supports at least TLS version 1.2. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL of the target Redis server. Database is optional and is supplied as the URL path. **Type**: `string` ```yaml # Examples: url: redis://:6379 # --- url: redis://localhost:6379 # --- url: redis://foousername:foopassword@redisplace:6379 # --- url: redis://:foopassword@redisplace:6379 # --- url: redis://localhost:6379/1 # --- url: redis://localhost:6379/1,redis://localhost:6380/1 ``` --- # Page 80: redis_streams **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redis_streams.md --- # redis_streams Pulls messages from Redis (v5.0+) streams with the XREADGROUP command. The `client_id` should be unique for each consumer of a group. Redis stream entries are key/value pairs, as such it is necessary to specify the key that contains the body of the message. All other keys/value pairs are saved as metadata fields. #### Common ```yml input: label: "" redis_streams: url: "" # No default (required) body_key: body streams: [] # No default (required) auto_replay_nacks: true limit: 10 client_id: "" consumer_group: "" ``` #### Advanced ```yml input: label: "" redis_streams: url: "" # No default (required) kind: simple master: "" client_name: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] body_key: body streams: [] # No default (required) auto_replay_nacks: true limit: 10 client_id: "" consumer_group: "" create_streams: true start_from_oldest: true commit_period: 1s timeout: 1s ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `body_key` The field key to extract the raw message from. All other keys will be stored in the message as metadata. **Type**: `string` **Default**: `body` ### `client_id` The consumer name used within `consumer_group` when reading with `XREADGROUP`. Redis tracks pending messages for each consumer name. **Type**: `string` **Default**: `""` ### `client_name` Set the client name for the Redis connection. **Type**: `string` **Default**: `redpanda-connect` ### `commit_period` The period of time between each batch of `XACK` calls that acknowledge delivered message IDs to the consumer group. Pending acknowledgements are also sent during shutdown. **Type**: `string` **Default**: `1s` ### `consumer_group` An identifier for the consumer group of the stream. **Type**: `string` **Default**: `""` ### `create_streams` Create subscribed streams if they do not exist (MKSTREAM option). **Type**: `bool` **Default**: `true` ### `kind` Specifies a simple, cluster-aware, or failover-aware redis client. **Type**: `string` **Default**: `simple` **Options**: `simple`, `cluster`, `failover` ### `limit` The maximum number of messages to consume from a single request. **Type**: `int` **Default**: `10` ### `master` Name of the redis master when `kind` is `failover` **Type**: `string` **Default**: `""` ```yaml # Examples: master: mymaster ``` ### `start_from_oldest` If an offset is not found for a stream, determines whether to consume from the oldest available offset, otherwise messages are consumed from the latest offset. **Type**: `bool` **Default**: `true` ### `streams[]` A list of streams to consume from. **Type**: `array` ### `timeout` The length of time to poll for new messages before reattempting. **Type**: `string` **Default**: `1s` ### `tls` Custom TLS settings can be used to override system defaults. **Troubleshooting** Some cloud hosted instances of Redis (such as Azure Cache) might need some hand holding in order to establish stable connections. Unfortunately, it is often the case that TLS issues will manifest as generic error messages such as "i/o timeout". If you’re using TLS and are seeing connectivity problems consider setting `enable_renegotiation` to `true`, and ensuring that the server supports at least TLS version 1.2. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL of the target Redis server. Database is optional and is supplied as the URL path. **Type**: `string` ```yaml # Examples: url: redis://:6379 # --- url: redis://localhost:6379 # --- url: redis://foousername:foopassword@redisplace:6379 # --- url: redis://:foopassword@redisplace:6379 # --- url: redis://localhost:6379/1 # --- url: redis://localhost:6379/1,redis://localhost:6380/1 ``` --- # Page 81: redpanda_common **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda_common.md --- # redpanda_common > ⚠️ **WARNING** > > This component is deprecated and will be removed in a future version. Consumes data from a Redpanda (Kafka) broker, using credentials defined in a common top-level `redpanda` config block. This input is deprecated as of version 4.68.0. Use the [`redpanda` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda/) instead. When you omit its connection fields, the `redpanda` input connects using the same top-level [`redpanda` config block](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/redpanda/about/). When a consumer group is specified this input consumes one or more topics, and partitions automatically balance across any other connected clients with the same consumer group. When a consumer group is not specified, topics can either be consumed in their entirety or with explicit partitions. ## Delivery Guarantees When using consumer groups, the offsets of "delivered" records are committed automatically and continuously, and in the event of restarts these committed offsets are used to resume from where the input left off. Redpanda Connect guarantees at least once delivery by ensuring that records are only considered to be delivered when all configured outputs that the record is routed to have confirmed delivery. ## Ordering To preserve ordering of topic partitions, records consumed from each partition are processed and delivered in the order that they are received, and only one batch of records of a given partition is ever processed at a time. This means that parallel processing can only occur when multiple topic partitions are being consumed, but ensures that data is processed in a sequential order as determined from the source partition. However, one way in which the order of records can be mixed is when delivery errors occur and error handling mechanisms kick in. Redpanda Connect always leans towards at least once delivery unless instructed otherwise, and this includes reattempting delivery of data when the ordering of that data can no longer be guaranteed. For example, a batch of records may have been sent to an output broker and only a subset of records were delivered. In this case Redpanda Connect by default reattempts to deliver the records that failed, even though these failed records may have come before records that were previously delivered successfully. To avoid this scenario you must specify in your configuration an alternative way to handle delivery errors in the form of a [`fallback`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/fallback/) output. It is good practice to also disable the field `auto_retry_nacks` by setting it to `false` when you’ve added an explicit fallback output as this improves the throughput of your pipeline. For example, the following config avoids ordering issues by specifying a fallback output into a DLQ topic, which is also retried indefinitely as a way to apply back pressure during connectivity issues: ```yaml output: fallback: - redpanda_common: topic: foo - retry: output: redpanda_common: topic: foo_dlq ``` ## Batching Records are processed and delivered from each partition in batches as received from brokers. These batch sizes are therefore dynamically sized in order to optimise throughput, but can be tuned with the config fields `fetch_max_bytes`, `fetch_max_partition_bytes`, and `max_yield_batch_bytes`. Batches can be further broken down using the [`split`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/split/) processor. ## Metrics When a consumer group is set, this input emits a `redpanda_lag` metric with `topic` and `partition` labels for each consumed topic. The metric records the number of produced messages that the consumer group has not yet read from each topic partition. ## Metadata This input adds the following metadata fields to each message: - `kafka_key` - `kafka_topic` - `kafka_partition` - `kafka_offset` - `kafka_lag` - `kafka_timestamp_ms` - `kafka_timestamp_unix` - `kafka_tombstone_message` - All record headers > 📝 **NOTE** > > If you need to move topic data between Redpanda clusters or other Apache Kafka clusters, consider using the [`redpanda` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda/) and [output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda/) instead. ### Common ```yml input: label: "" redpanda_common: topics: [] # No default (optional) regexp_topics_include: [] # No default (optional) regexp_topics_exclude: [] # No default (optional) transaction_isolation_level: read_uncommitted consumer_group: "" # No default (optional) auto_replay_nacks: true ``` ### Advanced ```yml input: label: "" redpanda_common: topics: [] # No default (optional) regexp_topics_include: [] # No default (optional) regexp_topics_exclude: [] # No default (optional) rack_id: "" instance_id: "" rebalance_timeout: 45s session_timeout: 1m heartbeat_interval: 3s start_offset: earliest fetch_max_bytes: 50MiB fetch_max_wait: 5s fetch_min_bytes: 1B fetch_max_partition_bytes: 1MiB transaction_isolation_level: read_uncommitted consumer_group: "" # No default (optional) commit_period: 5s partition_buffer_bytes: 1MB topic_lag_refresh_period: 5s max_yield_batch_bytes: 32KB auto_replay_nacks: true timely_nacks_maximum_wait: "" # No default (optional) ``` ## Pipeline example This data pipeline reads data from `topic_A` and `topic_B` on a Redpanda cluster, and then writes the data to `topic_C` on the same cluster. The cluster details are configured within the `redpanda` configuration block, so you only need to configure them once. This is a useful feature when you have multiple inputs and outputs in the same data pipeline that need to connect to the same cluster. ```none input: redpanda_common: topics: [ topic_A, topic_B ] output: redpanda_common: topic: topic_C key: ${! @id } redpanda: seed_brokers: [ "127.0.0.1:9092" ] tls: enabled: true sasl: - mechanism: SCRAM-SHA-512 password: bar username: foo ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `commit_period` The period of time between each commit of the current partition offsets to the consumer group. Offsets are always committed during shutdown. **Type**: `string` **Default**: `5s` ### `consumer_group` An optional consumer group. When you specify this value: - The partitions of any topics specified in the `topics` field are automatically distributed across consumers that share the consumer group. - Partition offsets are automatically committed and resumed under this name. Consumer groups are not supported when you specify explicit partitions to consume from in the `topics` field. **Type**: `string` ### `fetch_max_bytes` The maximum number of bytes that a broker tries to send during a fetch. If individual records are larger than the `fetch_max_bytes` value, brokers still send them. This field is equivalent to the Java setting `fetch.max.bytes`. **Type**: `string` **Default**: `50MiB` ### `fetch_max_partition_bytes` The maximum number of bytes that are consumed from a single partition in a fetch request. This field is equivalent to the Java setting `fetch.max.partition.bytes`. If a single batch is larger than the `fetch_max_partition_bytes` value, the batch is still sent so that the client can make progress. **Type**: `string` **Default**: `1MiB` ### `fetch_max_wait` The maximum period of time a broker can wait for a fetch response to reach the required minimum number of bytes (`fetch_min_bytes`). This field is equivalent to the Java setting `fetch.max.wait.ms`. **Type**: `string` **Default**: `5s` ### `fetch_min_bytes` The minimum number of bytes that a broker tries to send during a fetch. This field is equivalent to the Java setting `fetch.min.bytes`. **Type**: `string` **Default**: `1B` ### `heartbeat_interval` When you specify a `consumer_group`, `heartbeat_interval` sets how frequently a consumer group member should send heartbeats to Apache Kafka. Apache Kafka uses heartbeats to make sure that a group member’s session is active. This value must be lower than `session_timeout`, and should be no higher than one-third of `session_timeout`. This field is equivalent to the Java `heartbeat.interval.ms` setting and accepts Go duration format strings such as `10s` or `2m`. **Type**: `string` **Default**: `3s` ### `instance_id` When you specify a `consumer_group`, set `instance_id` to define the group’s static membership, which can prevent unnecessary rebalances during reconnections. The value must be unique per consumer within the group. When you assign an instance ID, the client does not leave the consumer group when it closes. To remove the client from the group, you must use an external admin command on behalf of the instance ID. **Type**: `string` **Default**: `""` ### `max_yield_batch_bytes` The maximum size (in bytes) for each batch yielded by this input. This value must be less than or equal to the `partition_buffer_bytes`. If using Redpanda output, this value should not be greater than the `max_message_bytes` option value (1MB by default), and for high-throughput scenarios they should be equal. **Type**: `string` **Default**: `32KB` ### `partition_buffer_bytes` A buffer size (in bytes) for each consumed partition, which allows the internal queuing of records before they are flushed. Increasing this value may improve throughput but results in higher memory utilization. Each buffer can grow slightly beyond this value. **Type**: `string` **Default**: `1MB` ### `rack_id` A rack specifies where the client is physically located, and changes fetch requests to consume from the closest replica as opposed to the leader replica. **Type**: `string` **Default**: `""` ### `rebalance_timeout` When you specify a `consumer_group`, `rebalance_timeout` sets how long consumer group members can take to complete their work and commit offsets after a rebalance has begun. The time that a member takes to detect the rebalance (from a heartbeat) counts against this timeout. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `45s` ### `regexp_topics_exclude[]` A list of regular expression patterns for excluding topics when regex mode is enabled (using `regexp_topics_include` or the deprecated `regexp_topics` boolean). Topics matching any of these patterns will be excluded from consumption, even if they match include patterns. Each pattern is a full regular expression evaluated against the complete topic name. Patterns are not anchored by default, so use `^` and `$` for exact matching. Exclude patterns are applied after include patterns, providing fine-grained control over topic selection. Example: `regexp_topics_exclude: ["^_", ".*-temp$", ".*-test.*"]` excludes topics starting with underscore, ending with `-temp`, or containing `-test`. **Type**: `array` ### `regexp_topics_include[]` A list of regular expression patterns for matching topics to consume from. When specified, the client will periodically refresh the list of matching topics based on the `metadata_max_age` interval. Each pattern is a full regular expression evaluated against the complete topic name. Patterns are not anchored by default, so `logs_.*` matches `my-logs_events` and `logs_errors`. Use `^logs_.*$` to match only topics starting with `logs_`. This field enables regex mode (replacing the deprecated `regexp_topics` boolean) and cannot be used together with explicit `topics` lists. Use `regexp_topics_exclude` to filter out specific patterns from the matched topics. Example: `regexp_topics_include: ["events_.*", "logs_.*"]` consumes from all topics starting with `events_` or `logs_`. **Type**: `array` ```yaml # Examples: regexp_topics_include: - logs_.* - metrics_.* # --- regexp_topics_include: - "events_[0-9]+" ``` ### `session_timeout` When you specify a `consumer_group`, `session_timeout` sets the maximum interval between heartbeats sent by a consumer group member to the broker. If a broker doesn’t receive a heartbeat from a group member before the timeout expires, it removes the member from the consumer group and initiates a rebalance. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `1m` ### `start_offset` Specify the offset from which this input starts or restarts consuming messages. Restarts occur when the `OffsetOutOfRange` error is seen during a fetch. **Type**: `string` **Default**: `earliest` | Option | Summary | | --- | --- | | `committed` | Prevents consuming a partition in a group if the partition has no prior commits. Corresponds to Kafka’s `auto.offset.reset=none` option | | `earliest` | Start from the earliest offset. Corresponds to Kafka’s `auto.offset.reset=earliest` option. | | `latest` | Start from the latest offset. Corresponds to Kafka’s `auto.offset.reset=latest` option. | ### `timely_nacks_maximum_wait` EXPERIMENTAL: Specify a maximum period of time in which each message can be consumed and awaiting either acknowledgement or rejection before rejection is instead forced. This can be useful for avoiding situations where certain downstream components can result in blocked confirmation of delivery that exceeds SLAs. Accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` ### `topic_lag_refresh_period` The interval between consumer lag refreshes. During each cycle, this input asks the brokers for the consumer group’s committed offsets and the partition end offsets, and records the difference (the number of unread messages) for each topic partition in the consumer lag metric and the `kafka_lag` metadata field. Lag is only refreshed when `consumer_group` is set. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `5s` ### `topics[]` A list of topics to consume from. You can list multiple comma-separated topics in a single element. If you specify a `consumer_group`, partitions are automatically distributed across consumers of a topic. Otherwise, all partitions are consumed. Alternatively, add a colon after the topic name to set the explicit partitions to consume. For example, `foo:0` consumes the partition `0` of the topic `foo`. This syntax also supports ranges. For example, `foo:0-10` consumes all partitions from `0` through to `10` inclusive. Finally, add another colon after the partition to set an explicit offset to consume from. For example, `foo:0:10` consumes the partition `0` of the topic `foo` starting from the offset `10`. If the offset is not present (or remains unspecified) then the field `start_offset` determines which offset to start from. **Type**: `array` ```yaml # Examples: topics: - foo - bar # --- topics: - things.* # --- topics: - "foo,bar" # --- topics: - "foo:0" - "bar:1" - "bar:3" # --- topics: - "foo:0,bar:1,bar:3" # --- topics: - "foo:0-5" ``` ### `transaction_isolation_level` The isolation level for handling transactional messages. This setting determines how transactions are processed and affects data consistency guarantees. **Type**: `string` **Default**: `read_uncommitted` | Option | Summary | | --- | --- | | `read_committed` | If set, only committed transactional records are processed. | | `read_uncommitted` | If set, then uncommitted records are processed. | --- # Page 82: redpanda_migrator **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda_migrator.md --- # redpanda_migrator Consumes records from a source Kafka or Redpanda cluster for the redpanda_migrator output to migrate. The `redpanda_migrator` input simply consumes records from the source cluster and forwards them downstream. It does not perform topic/schema/group synchronisation. All migration features and coordination live in the paired [`redpanda_migrator` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda_migrator/), which migrates topic data, topic ACLs, schemas, and consumer group offsets between clusters. When you set a [`consumer_group`](#consumer_group), this input consumes one or more topics and automatically balances the topic partitions across any other connected clients with the same consumer group. Otherwise, topics are consumed in their entirety or with explicit partitions. > ❗ **IMPORTANT** > > This input requires a corresponding `redpanda_migrator` output in the same pipeline. Each pipeline must have both input and output components configured. For capabilities, guarantees, scheduling, and examples, see the output documentation. ## Performance tuning for high throughput For workloads with high message rates or large messages, adjust the following fields to increase buffer sizes and batch processing: - `partition_buffer_bytes: 2MB` - `max_yield_batch_bytes: 1MB` These settings allow the consumer to buffer more data per partition and yield larger batches, reducing overhead and improving throughput at the cost of higher memory usage. ## Delivery guarantees This input commits consumer group offsets only after the paired output acknowledges the writes, so it provides the same at-least-once delivery and per-partition ordering as the [`redpanda` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda/). Each pipeline holds one migrator pair. The input pairs automatically with the `redpanda_migrator` output in the same pipeline, so leave `label` unset on both. To migrate several source clusters, run a separate pipeline for each pair. ## Source cluster permissions When the source cluster enforces ACLs, the source principal needs the topic `READ` and `DESCRIBE_CONFIGS` operations, in addition to the consumer group and cluster permissions that the migration uses. A `READ` ACL implies `DESCRIBE` but not `DESCRIBE_CONFIGS`, so without `DESCRIBE_CONFIGS` the input consumes records but the paired output fails to create topics with a `TOPIC_AUTHORIZATION_FAILED` error. For the full list of source and destination ACLs, see [Required permissions](https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/redpanda_migrator/#required-permissions). ## Metrics When a consumer group is set, this input emits a `redpanda_lag` metric with `topic` and `partition` labels for each consumed topic. The metric records the number of produced messages that the consumer group has not yet read from each topic partition. Monitor this metric to track migration progress. ## Metadata This input adds the following metadata fields to each message: - `kafka_key` - `kafka_topic` - `kafka_partition` - `kafka_offset` - `kafka_lag`: Set only when `consumer_group` is set. - `kafka_timestamp_ms` - `kafka_timestamp_unix` - `kafka_tombstone_message` - All record headers ### Common ```yml input: label: "" redpanda_migrator: seed_brokers: [] # No default (required) topics: [] # No default (optional) regexp_topics_include: [] # No default (optional) regexp_topics_exclude: [] # No default (optional) transaction_isolation_level: read_uncommitted consumer_group: "" # No default (optional) schema_registry: url: "" # No default (required) timeout: 5s auto_replay_nacks: true ``` ### Advanced ```yml input: label: "" redpanda_migrator: seed_brokers: [] # No default (required) client_id: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] sasl: [] # No default (optional) metadata_max_age: 1m request_timeout_overhead: 10s conn_idle_timeout: 20s tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s topics: [] # No default (optional) regexp_topics_include: [] # No default (optional) regexp_topics_exclude: [] # No default (optional) rack_id: "" instance_id: "" rebalance_timeout: 45s session_timeout: 1m heartbeat_interval: 3s start_offset: earliest fetch_max_bytes: 50MiB fetch_max_wait: 5s fetch_min_bytes: 1B fetch_max_partition_bytes: 1MiB transaction_isolation_level: read_uncommitted consumer_group: "" # No default (optional) commit_period: 5s partition_buffer_bytes: 1MB topic_lag_refresh_period: 5s max_yield_batch_bytes: 32KB schema_registry: url: "" # No default (required) timeout: 5s tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] oauth: enabled: false consumer_key: "" consumer_secret: "" access_token: "" access_token_secret: "" basic_auth: enabled: false username: "" password: "" jwt: enabled: false private_key_file: "" signing_method: "" claims: {} headers: {} auto_replay_nacks: true ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `client_id` An identifier for the client connection. This identifier appears in broker logs and metrics, which helps you identify the Redpanda Connect instance that is connecting. **Type**: `string` **Default**: `redpanda-connect` ### `commit_period` The period of time between each commit of the current partition offsets to the consumer group. Offsets are always committed during shutdown. **Type**: `string` **Default**: `5s` ### `conn_idle_timeout` The approximate amount of time that connections can remain idle before they are closed. In the worst case, a connection can stay idle for up to twice this value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `20s` ### `consumer_group` An optional consumer group. When you specify this value: - The partitions of any topics specified in the `topics` field are automatically distributed across consumers that share the consumer group. - Partition offsets are automatically committed and resumed under this name. Consumer groups are not supported when you specify explicit partitions to consume from in the `topics` field. **Type**: `string` ### `fetch_max_bytes` The maximum number of bytes that a broker tries to send during a fetch. If individual records are larger than the `fetch_max_bytes` value, brokers still send them. This field is equivalent to the Java setting `fetch.max.bytes`. **Type**: `string` **Default**: `50MiB` ### `fetch_max_partition_bytes` The maximum number of bytes that are consumed from a single partition in a fetch request. This field is equivalent to the Java setting `fetch.max.partition.bytes`. If a single batch is larger than the `fetch_max_partition_bytes` value, the batch is still sent so that the client can make progress. **Type**: `string` **Default**: `1MiB` ### `fetch_max_wait` The maximum period of time a broker can wait for a fetch response to reach the required minimum number of bytes (`fetch_min_bytes`). This field is equivalent to the Java setting `fetch.max.wait.ms`. **Type**: `string` **Default**: `5s` ### `fetch_min_bytes` The minimum number of bytes that a broker tries to send during a fetch. This field is equivalent to the Java setting `fetch.min.bytes`. **Type**: `string` **Default**: `1B` ### `heartbeat_interval` When you specify a `consumer_group`, `heartbeat_interval` sets how frequently a consumer group member should send heartbeats to Apache Kafka. Apache Kafka uses heartbeats to make sure that a group member’s session is active. This value must be lower than `session_timeout`, and should be no higher than one-third of `session_timeout`. This field is equivalent to the Java `heartbeat.interval.ms` setting and accepts Go duration format strings such as `10s` or `2m`. **Type**: `string` **Default**: `3s` ### `instance_id` When you specify a `consumer_group`, set `instance_id` to define the group’s static membership, which can prevent unnecessary rebalances during reconnections. The value must be unique per consumer within the group. When you assign an instance ID, the client does not leave the consumer group when it closes. To remove the client from the group, you must use an external admin command on behalf of the instance ID. **Type**: `string` **Default**: `""` ### `max_yield_batch_bytes` The maximum size (in bytes) for each batch yielded by this input. This value must be less than or equal to the `partition_buffer_bytes`. If using Redpanda output, this value should not be greater than the `max_message_bytes` option value (1MB by default), and for high-throughput scenarios they should be equal. **Type**: `string` **Default**: `32KB` ### `metadata_max_age` The maximum period of time after which metadata is refreshed. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Lower values provide more responsive topic and partition discovery but may increase broker load. Higher values reduce broker queries but can delay detection of topology changes. This interval also controls how frequently regex topic patterns are re-evaluated to discover new matching topics. **Type**: `string` **Default**: `1m` ### `partition_buffer_bytes` A buffer size (in bytes) for each consumed partition, which allows the internal queuing of records before they are flushed. Increasing this value may improve throughput but results in higher memory utilization. Each buffer can grow slightly beyond this value. **Type**: `string` **Default**: `1MB` ### `rack_id` A rack specifies where the client is physically located, and changes fetch requests to consume from the closest replica as opposed to the leader replica. **Type**: `string` **Default**: `""` ### `rebalance_timeout` When you specify a `consumer_group`, `rebalance_timeout` sets how long consumer group members can take to complete their work and commit offsets after a rebalance has begun. The time that a member takes to detect the rebalance (from a heartbeat) counts against this timeout. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `45s` ### `regexp_topics_exclude[]` A list of regular expression patterns for excluding topics when regex mode is enabled (using `regexp_topics_include` or the deprecated `regexp_topics` boolean). Topics matching any of these patterns will be excluded from consumption, even if they match include patterns. Each pattern is a full regular expression evaluated against the complete topic name. Patterns are not anchored by default, so use `^` and `$` for exact matching. Exclude patterns are applied after include patterns, providing fine-grained control over topic selection. Example: `regexp_topics_exclude: ["^_", ".*-temp$", ".*-test.*"]` excludes topics starting with underscore, ending with `-temp`, or containing `-test`. **Type**: `array` ### `regexp_topics_include[]` A list of regular expression patterns for matching topics to consume from. When specified, the client will periodically refresh the list of matching topics based on the `metadata_max_age` interval. Each pattern is a full regular expression evaluated against the complete topic name. Patterns are not anchored by default, so `logs_.*` matches `my-logs_events` and `logs_errors`. Use `^logs_.*$` to match only topics starting with `logs_`. This field enables regex mode (replacing the deprecated `regexp_topics` boolean) and cannot be used together with explicit `topics` lists. Use `regexp_topics_exclude` to filter out specific patterns from the matched topics. Example: `regexp_topics_include: ["events_.*", "logs_.*"]` consumes from all topics starting with `events_` or `logs_`. **Type**: `array` ```yaml # Examples: regexp_topics_include: - logs_.* - metrics_.* # --- regexp_topics_include: - "events_[0-9]+" ``` ### `request_timeout_overhead` Additional time to apply as overhead when calculating request deadlines. For most requests, the deadline is this overhead alone. For requests that define their own timeout field, the overhead is added on top of that timeout, which helps prevent premature timeouts. This field is roughly equivalent to Apache Kafka’s `request.timeout.ms` parameter, but grants extra time to requests that have timeout fields. **Type**: `string` **Default**: `10s` ### `sasl[]` Specify one or more methods or mechanisms of SASL authentication. They are tried in order. If the broker supports the first SASL mechanism, all connections use it. If the first mechanism fails, the client picks the first supported mechanism. If the broker does not support any client mechanisms, all connections fail. **Type**: `array` ```yaml # Examples: sasl: - mechanism: SCRAM-SHA-512 password: bar username: foo ``` ### `sasl[].aws` Contains AWS-specific fields for when `sasl.mechanism` is set to `AWS_MSK_IAM`. **Type**: `object` ### `sasl[].aws.credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `sasl[].aws.credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `sasl[].aws.credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `sasl[].aws.credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `sasl[].aws.credentials.role` The ARN of the role to assume. **Type**: `string` ### `sasl[].aws.credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `sasl[].aws.credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `sasl[].aws.credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `sasl[].aws.endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `sasl[].aws.region` The AWS region in which your resources are hosted. **Type**: `string` ### `sasl[].aws.tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `sasl[].aws.tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].aws.tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `sasl[].aws.tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `sasl[].aws.tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].extensions` Key/value pairs to add to OAUTHBEARER authentication requests. **Type**: `object` ### `sasl[].mechanism` The SASL mechanism to use for authentication. **Type**: `string` | Option | Summary | | --- | --- | | `AWS_MSK_IAM` | AWS IAM based authentication as specified by the 'aws-msk-iam-auth' java library. | | `OAUTHBEARER` | OAuth Bearer based authentication. | | `PLAIN` | Plain text authentication. | | `REDPANDA_CLOUD_SERVICE_ACCOUNT` | Redpanda Cloud Service Account authentication when running in Redpanda Cloud. | | `SCRAM-SHA-256` | SCRAM based authentication as specified in RFC5802. | | `SCRAM-SHA-512` | SCRAM based authentication as specified in RFC5802. | | `none` | Disable sasl authentication | ### `sasl[].password` The password to use for PLAIN or SCRAM-* authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `sasl[].token` The token to use for a single session’s OAUTHBEARER authentication. **Type**: `string` **Default**: `""` ### `sasl[].username` The username to use for PLAIN or SCRAM-* authentication. **Type**: `string` **Default**: `""` ### `schema_registry` Configuration for schema registry integration. Enables migration of schema subjects, versions, and compatibility settings between clusters. **Type**: `object` ### `schema_registry.basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `schema_registry.basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `schema_registry.jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `schema_registry.jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `schema_registry.jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `schema_registry.jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `schema_registry.jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `schema_registry.oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `schema_registry.oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `schema_registry.timeout` HTTP client timeout for schema registry requests. **Type**: `string` **Default**: `5s` ### `schema_registry.tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `schema_registry.tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `schema_registry.tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `schema_registry.tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `schema_registry.tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `schema_registry.tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `schema_registry.tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `schema_registry.tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `schema_registry.url` The base URL of the schema registry service. Required for schema migration functionality. **Type**: `string` ```yaml # Examples: url: http://localhost:8081 # --- url: https://schema-registry.example.com:8081 ``` ### `seed_brokers[]` A list of broker addresses used to establish connections. If an item of the list contains commas, it is expanded into multiple addresses. **Type**: `array` ```yaml # Examples: seed_brokers: - "localhost:9092" # --- seed_brokers: - "foo:9092" - "bar:9092" # --- seed_brokers: - "foo:9092,bar:9092" ``` ### `session_timeout` When you specify a `consumer_group`, `session_timeout` sets the maximum interval between heartbeats sent by a consumer group member to the broker. If a broker doesn’t receive a heartbeat from a group member before the timeout expires, it removes the member from the consumer group and initiates a rebalance. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `1m` ### `start_offset` Specify the offset from which this input starts or restarts consuming messages. Restarts occur when the `OffsetOutOfRange` error is seen during a fetch. **Type**: `string` **Default**: `earliest` | Option | Summary | | --- | --- | | `committed` | Prevents consuming a partition in a group if the partition has no prior commits. Corresponds to Kafka’s `auto.offset.reset=none` option | | `earliest` | Start from the earliest offset. Corresponds to Kafka’s `auto.offset.reset=earliest` option. | | `latest` | Start from the latest offset. Corresponds to Kafka’s `auto.offset.reset=latest` option. | ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `topic_lag_refresh_period` The interval between consumer lag refreshes. During each cycle, this input asks the brokers for the consumer group’s committed offsets and the partition end offsets, and records the difference (the number of unread messages) for each topic partition in the consumer lag metric and the `kafka_lag` metadata field. Lag is only refreshed when `consumer_group` is set. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `5s` ### `topics[]` A list of topics to consume from. You can list multiple comma-separated topics in a single element. If you specify a `consumer_group`, partitions are automatically distributed across consumers of a topic. Otherwise, all partitions are consumed. Alternatively, add a colon after the topic name to set the explicit partitions to consume. For example, `foo:0` consumes the partition `0` of the topic `foo`. This syntax also supports ranges. For example, `foo:0-10` consumes all partitions from `0` through to `10` inclusive. Finally, add another colon after the partition to set an explicit offset to consume from. For example, `foo:0:10` consumes the partition `0` of the topic `foo` starting from the offset `10`. If the offset is not present (or remains unspecified) then the field `start_offset` determines which offset to start from. **Type**: `array` ```yaml # Examples: topics: - foo - bar # --- topics: - things.* # --- topics: - "foo,bar" # --- topics: - "foo:0" - "bar:1" - "bar:3" # --- topics: - "foo:0,bar:1,bar:3" # --- topics: - "foo:0-5" ``` ### `transaction_isolation_level` The isolation level for handling transactional messages. This setting determines how transactions are processed and affects data consistency guarantees. **Type**: `string` **Default**: `read_uncommitted` | Option | Summary | | --- | --- | | `read_committed` | If set, only committed transactional records are processed. | | `read_uncommitted` | If set, then uncommitted records are processed. | ## Troubleshooting - Ensure the input and output `label` fields match exactly. - Both input and output must be present in the pipeline. - Verify consumer group configuration for partition balancing. - Monitor the lag metric for stalled migration. ## Suggested reading - [`redpanda_migrator` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda_migrator/) - [Migrating from legacy components](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/migrate-unified-redpanda-migrator/) --- # Page 83: redpanda **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda.md --- # redpanda A Kafka input using the [Franz Kafka client library](https://github.com/twmb/franz-go). When a consumer group is specified this input consumes one or more topics, and partitions automatically balance across any other connected clients with the same consumer group. When a consumer group is not specified, topics can either be consumed in their entirety or with explicit partitions. ## Delivery Guarantees When using consumer groups, the offsets of "delivered" records are committed automatically and continuously, and in the event of restarts these committed offsets are used to resume from where the input left off. Redpanda Connect guarantees at least once delivery by ensuring that records are only considered to be delivered when all configured outputs that the record is routed to have confirmed delivery. ## Ordering To preserve ordering of topic partitions, records consumed from each partition are processed and delivered in the order that they are received, and only one batch of records of a given partition is ever processed at a time. This means that parallel processing can only occur when multiple topic partitions are being consumed, but ensures that data is processed in a sequential order as determined from the source partition. If `unordered_processing.enabled` is `true`, this does not apply. Messages of the same partition are processed in parallel, up to `unordered_processing.checkpoint_limit`, and can be delivered out of order. However, one way in which the order of records can be mixed is when delivery errors occur and error handling mechanisms kick in. Redpanda Connect always leans towards at least once delivery unless instructed otherwise, and this includes reattempting delivery of data when the ordering of that data can no longer be guaranteed. For example, a batch of records may have been sent to an output broker and only a subset of records were delivered. In this case Redpanda Connect by default reattempts to deliver the records that failed, even though these failed records may have come before records that were previously delivered successfully. To avoid this scenario you must specify in your configuration an alternative way to handle delivery errors in the form of a [`fallback`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/fallback/) output. It is good practice to also disable the field `auto_retry_nacks` by setting it to `false` when you’ve added an explicit fallback output as this improves the throughput of your pipeline. For example, the following config avoids ordering issues by specifying a fallback output into a DLQ topic, which is also retried indefinitely as a way to apply back pressure during connectivity issues: ```yaml output: fallback: - redpanda: seed_brokers: [ "${REDPANDA_BROKERS}" ] topic: foo tls: enabled: true sasl: - mechanism: SCRAM-SHA-256 username: "" password: "${secrets.PASSWORD}" - retry: output: redpanda: seed_brokers: [ "${REDPANDA_BROKERS}" ] topic: foo_dlq tls: enabled: true sasl: - mechanism: SCRAM-SHA-256 username: "" password: "${secrets.PASSWORD}" ``` ## Batching Records are processed and delivered from each partition in batches as received from brokers. These batch sizes are therefore dynamically sized in order to optimise throughput, but can be tuned with the config fields `fetch_max_bytes`, `fetch_max_partition_bytes`, and `max_yield_batch_bytes`, or `unordered_processing.batching` when unordered processing is enabled. Batches can be further broken down using the [`split`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/split/) processor. ## Metrics When a consumer group is set, this input emits a `redpanda_lag` metric with `topic` and `partition` labels for each consumed topic. The metric records the number of produced messages that the consumer group has not yet read from each topic partition. ## Metadata This input adds the following metadata fields to each message: - `kafka_key` - `kafka_topic` - `kafka_partition` - `kafka_offset` - `kafka_lag` - `kafka_timestamp_ms` - `kafka_timestamp_unix` - `kafka_tombstone_message` - All record headers > ❗ **IMPORTANT** > > Always set `seed_brokers` to the `${REDPANDA_BROKERS}` [contextual variable](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/contextual-variables/), and configure the `tls` and `sasl` fields with credentials for a user that can read the topics you want to consume: > > ```yaml > input: > redpanda: > seed_brokers: > - ${REDPANDA_BROKERS} > topics: > - > tls: > enabled: true > sasl: > - mechanism: SCRAM-SHA-256 > username: "" > password: "${secrets.PASSWORD}" > ``` > > If you leave `seed_brokers` empty, this input ignores the `tls` and `sasl` fields you configure and connects using the internal `redpanda` configuration block that Redpanda Cloud manages for pipeline logs and status reporting. That connection uses a Redpanda Cloud service principal that has no access to your topics, so the pipeline fails with authorization errors. ### Common ```yml input: label: "" redpanda: seed_brokers: [] # No default (optional) topics: [] # No default (optional) regexp_topics_include: [] # No default (optional) regexp_topics_exclude: [] # No default (optional) transaction_isolation_level: read_uncommitted consumer_group: "" # No default (optional) auto_replay_nacks: true ``` ### Advanced ```yml input: label: "" redpanda: seed_brokers: [] # No default (optional) client_id: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] sasl: [] # No default (optional) metadata_max_age: 1m request_timeout_overhead: 10s conn_idle_timeout: 20s tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s topics: [] # No default (optional) regexp_topics_include: [] # No default (optional) regexp_topics_exclude: [] # No default (optional) rack_id: "" instance_id: "" rebalance_timeout: 45s session_timeout: 1m heartbeat_interval: 3s start_offset: earliest fetch_max_bytes: 50MiB fetch_max_wait: 5s fetch_min_bytes: 1B fetch_max_partition_bytes: 1MiB transaction_isolation_level: read_uncommitted consumer_group: "" # No default (optional) commit_period: 5s partition_buffer_bytes: 1MB topic_lag_refresh_period: 5s max_yield_batch_bytes: 32KB unordered_processing: enabled: false checkpoint_limit: 1024 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) partition_assignment_strategy: - "cooperative-sticky" auto_replay_nacks: true timely_nacks_maximum_wait: "" # No default (optional) extract_tracing_map: "" # No default (optional) ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `client_id` An identifier for the client connection. This identifier appears in broker logs and metrics, which helps you identify the Redpanda Connect instance that is connecting. **Type**: `string` **Default**: `redpanda-connect` ### `commit_period` The period of time between each commit of the current partition offsets to the consumer group. Offsets are always committed during shutdown. **Type**: `string` **Default**: `5s` ### `conn_idle_timeout` The approximate amount of time that connections can remain idle before they are closed. In the worst case, a connection can stay idle for up to twice this value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `20s` ### `consumer_group` An optional consumer group. When you specify this value: - The partitions of any topics specified in the `topics` field are automatically distributed across consumers that share the consumer group. - Partition offsets are automatically committed and resumed under this name. Consumer groups are not supported when you specify explicit partitions to consume from in the `topics` field. **Type**: `string` ### `extract_tracing_map` EXPERIMENTAL: A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that attempts to extract an object containing tracing propagation information, which is then used as the root tracing span for the message. The specification of the extracted fields must match the format used by the service wide tracer. **Type**: `string` ```yaml # Examples: extract_tracing_map: root = @ # --- extract_tracing_map: root = this.meta.span ``` ### `fetch_max_bytes` The maximum number of bytes that a broker tries to send during a fetch. If individual records are larger than the `fetch_max_bytes` value, brokers still send them. This field is equivalent to the Java setting `fetch.max.bytes`. **Type**: `string` **Default**: `50MiB` ### `fetch_max_partition_bytes` The maximum number of bytes that are consumed from a single partition in a fetch request. This field is equivalent to the Java setting `fetch.max.partition.bytes`. If a single batch is larger than the `fetch_max_partition_bytes` value, the batch is still sent so that the client can make progress. **Type**: `string` **Default**: `1MiB` ### `fetch_max_wait` The maximum period of time a broker can wait for a fetch response to reach the required minimum number of bytes (`fetch_min_bytes`). This field is equivalent to the Java setting `fetch.max.wait.ms`. **Type**: `string` **Default**: `5s` ### `fetch_min_bytes` The minimum number of bytes that a broker tries to send during a fetch. This field is equivalent to the Java setting `fetch.min.bytes`. **Type**: `string` **Default**: `1B` ### `heartbeat_interval` When you specify a `consumer_group`, `heartbeat_interval` sets how frequently a consumer group member should send heartbeats to Apache Kafka. Apache Kafka uses heartbeats to make sure that a group member’s session is active. This value must be lower than `session_timeout`, and should be no higher than one-third of `session_timeout`. This field is equivalent to the Java `heartbeat.interval.ms` setting and accepts Go duration format strings such as `10s` or `2m`. **Type**: `string` **Default**: `3s` ### `instance_id` When you specify a `consumer_group`, set `instance_id` to define the group’s static membership, which can prevent unnecessary rebalances during reconnections. The value must be unique per consumer within the group. When you assign an instance ID, the client does not leave the consumer group when it closes. To remove the client from the group, you must use an external admin command on behalf of the instance ID. **Type**: `string` **Default**: `""` ### `max_yield_batch_bytes` The maximum size (in bytes) for each batch yielded by this input. This value must be less than or equal to the `partition_buffer_bytes`. If using Redpanda output, this value should not be greater than the `max_message_bytes` option value (1MB by default), and for high-throughput scenarios they should be equal. **Type**: `string` **Default**: `32KB` ### `metadata_max_age` The maximum period of time after which metadata is refreshed. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Lower values provide more responsive topic and partition discovery but may increase broker load. Higher values reduce broker queries but can delay detection of topology changes. This interval also controls how frequently regex topic patterns are re-evaluated to discover new matching topics. **Type**: `string` **Default**: `1m` ### `partition_assignment_strategy[]` When using a consumer group, the strategies this client supports for assigning partitions to group members, in order of preference. This is the equivalent to the Java partition.assignment.strategy setting. Supported values: - `cooperative-sticky`: Balances the total partition count per member while moving as few partitions as possible, and rebalances incrementally so that members keep consuming unaffected partitions. It does not balance partitions of each topic individually. - `sticky`: The same assignment as `cooperative-sticky`, using the eager protocol. - `range`: Divides the partitions of each topic evenly across the members subscribed to it. Remainder partitions go to the first members by sort order, so when consuming many topics the earlier members can own more partitions overall. - `roundrobin`: Assigns all partitions across members one at a time, which balances both each topic and the total when all members subscribe to the same topics. The eager strategies (`sticky`, `range` and `roundrobin`) revoke every partition from every member on each rebalance, such as when a member joins, leaves or restarts. Records that are in flight but not yet committed are then reprocessed from the last committed offsets, so frequent rebalances cause repeated duplicates. To change strategies on a running group, first roll out a list with the old strategy followed by the new one, then a list with only the new one. Members that share no strategy with the group are rejected. This is safe between eager strategies and from an eager strategy to `cooperative-sticky`. Once every member uses only `cooperative-sticky`, do not roll out an eager strategy: an eager member joining a cooperative group can be elected leader and break rebalancing. Instead, stop all members and start them with the new strategy. **Type**: `array` **Default**: ```yaml - "cooperative-sticky" ``` ```yaml # Examples: partition_assignment_strategy: - range # --- partition_assignment_strategy: - cooperative-sticky - roundrobin ``` ### `partition_buffer_bytes` A buffer size (in bytes) for each consumed partition, which allows the internal queuing of records before they are flushed. Increasing this value may improve throughput but results in higher memory utilization. Each buffer can grow slightly beyond this value. **Type**: `string` **Default**: `1MB` ### `rack_id` A rack specifies where the client is physically located, and changes fetch requests to consume from the closest replica as opposed to the leader replica. **Type**: `string` **Default**: `""` ### `rebalance_timeout` When you specify a `consumer_group`, `rebalance_timeout` sets how long consumer group members can take to complete their work and commit offsets after a rebalance has begun. The time that a member takes to detect the rebalance (from a heartbeat) counts against this timeout. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `45s` ### `regexp_topics_exclude[]` A list of regular expression patterns for excluding topics when regex mode is enabled (using `regexp_topics_include` or the deprecated `regexp_topics` boolean). Topics matching any of these patterns will be excluded from consumption, even if they match include patterns. Each pattern is a full regular expression evaluated against the complete topic name. Patterns are not anchored by default, so use `^` and `$` for exact matching. Exclude patterns are applied after include patterns, providing fine-grained control over topic selection. Example: `regexp_topics_exclude: ["^_", ".*-temp$", ".*-test.*"]` excludes topics starting with underscore, ending with `-temp`, or containing `-test`. **Type**: `array` ### `regexp_topics_include[]` A list of regular expression patterns for matching topics to consume from. When specified, the client will periodically refresh the list of matching topics based on the `metadata_max_age` interval. Each pattern is a full regular expression evaluated against the complete topic name. Patterns are not anchored by default, so `logs_.*` matches `my-logs_events` and `logs_errors`. Use `^logs_.*$` to match only topics starting with `logs_`. This field enables regex mode (replacing the deprecated `regexp_topics` boolean) and cannot be used together with explicit `topics` lists. Use `regexp_topics_exclude` to filter out specific patterns from the matched topics. Example: `regexp_topics_include: ["events_.*", "logs_.*"]` consumes from all topics starting with `events_` or `logs_`. **Type**: `array` ```yaml # Examples: regexp_topics_include: - logs_.* - metrics_.* # --- regexp_topics_include: - "events_[0-9]+" ``` ### `request_timeout_overhead` Additional time to apply as overhead when calculating request deadlines. For most requests, the deadline is this overhead alone. For requests that define their own timeout field, the overhead is added on top of that timeout, which helps prevent premature timeouts. This field is roughly equivalent to Apache Kafka’s `request.timeout.ms` parameter, but grants extra time to requests that have timeout fields. **Type**: `string` **Default**: `10s` ### `sasl[]` Specify one or more methods or mechanisms of SASL authentication. They are tried in order. If the broker supports the first SASL mechanism, all connections use it. If the first mechanism fails, the client picks the first supported mechanism. If the broker does not support any client mechanisms, all connections fail. **Type**: `array` ```yaml # Examples: sasl: - mechanism: SCRAM-SHA-512 password: bar username: foo ``` ### `sasl[].aws` Contains AWS-specific fields for when `sasl.mechanism` is set to `AWS_MSK_IAM`. **Type**: `object` ### `sasl[].aws.credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `sasl[].aws.credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `sasl[].aws.credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `sasl[].aws.credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `sasl[].aws.credentials.role` The ARN of the role to assume. **Type**: `string` ### `sasl[].aws.credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `sasl[].aws.credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `sasl[].aws.credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `sasl[].aws.endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `sasl[].aws.region` The AWS region in which your resources are hosted. **Type**: `string` ### `sasl[].aws.tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `sasl[].aws.tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].aws.tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `sasl[].aws.tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `sasl[].aws.tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].extensions` Key/value pairs to add to OAUTHBEARER authentication requests. **Type**: `object` ### `sasl[].mechanism` The SASL mechanism to use for authentication. **Type**: `string` | Option | Summary | | --- | --- | | `AWS_MSK_IAM` | AWS IAM based authentication as specified by the 'aws-msk-iam-auth' java library. | | `OAUTHBEARER` | OAuth Bearer based authentication. | | `PLAIN` | Plain text authentication. | | `REDPANDA_CLOUD_SERVICE_ACCOUNT` | Redpanda Cloud Service Account authentication when running in Redpanda Cloud. | | `SCRAM-SHA-256` | SCRAM based authentication as specified in RFC5802. | | `SCRAM-SHA-512` | SCRAM based authentication as specified in RFC5802. | | `none` | Disable sasl authentication | ### `sasl[].password` The password to use for PLAIN or SCRAM-* authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `sasl[].token` The token to use for a single session’s OAUTHBEARER authentication. **Type**: `string` **Default**: `""` ### `sasl[].username` The username to use for PLAIN or SCRAM-* authentication. **Type**: `string` **Default**: `""` ### `seed_brokers[]` A list of broker addresses used to establish connections. If an item of the list contains commas, it is expanded into multiple addresses. If you omit this field, this component ignores the connection fields set on it, including `tls` and `sasl`, and takes its entire connection configuration from the top-level `redpanda` block. In Redpanda Cloud, the platform sets the top-level `redpanda` block for pipeline logs and status reporting, and its credentials can’t access your topics, so always set this field in Redpanda Cloud. **Type**: `array` ```yaml # Examples: seed_brokers: - "localhost:9092" # --- seed_brokers: - "foo:9092" - "bar:9092" # --- seed_brokers: - "foo:9092,bar:9092" ``` ### `session_timeout` When you specify a `consumer_group`, `session_timeout` sets the maximum interval between heartbeats sent by a consumer group member to the broker. If a broker doesn’t receive a heartbeat from a group member before the timeout expires, it removes the member from the consumer group and initiates a rebalance. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `1m` ### `start_offset` Specify the offset from which this input starts or restarts consuming messages. Restarts occur when the `OffsetOutOfRange` error is seen during a fetch. **Type**: `string` **Default**: `earliest` | Option | Summary | | --- | --- | | `committed` | Prevents consuming a partition in a group if the partition has no prior commits. Corresponds to Kafka’s `auto.offset.reset=none` option | | `earliest` | Start from the earliest offset. Corresponds to Kafka’s `auto.offset.reset=earliest` option. | | `latest` | Start from the latest offset. Corresponds to Kafka’s `auto.offset.reset=latest` option. | ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `timely_nacks_maximum_wait` EXPERIMENTAL: Specify a maximum period of time in which each message can be consumed and awaiting either acknowledgement or rejection before rejection is instead forced. This can be useful for avoiding situations where certain downstream components can result in blocked confirmation of delivery that exceeds SLAs. Accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `topic_lag_refresh_period` The interval between consumer lag refreshes. During each cycle, this input asks the brokers for the consumer group’s committed offsets and the partition end offsets, and records the difference (the number of unread messages) for each topic partition in the consumer lag metric and the `kafka_lag` metadata field. Lag is only refreshed when `consumer_group` is set. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `5s` ### `topics[]` A list of topics to consume from. You can list multiple comma-separated topics in a single element. If you specify a `consumer_group`, partitions are automatically distributed across consumers of a topic. Otherwise, all partitions are consumed. Alternatively, add a colon after the topic name to set the explicit partitions to consume. For example, `foo:0` consumes the partition `0` of the topic `foo`. This syntax also supports ranges. For example, `foo:0-10` consumes all partitions from `0` through to `10` inclusive. Finally, add another colon after the partition to set an explicit offset to consume from. For example, `foo:0:10` consumes the partition `0` of the topic `foo` starting from the offset `10`. If the offset is not present (or remains unspecified) then the field `start_offset` determines which offset to start from. **Type**: `array` ```yaml # Examples: topics: - foo - bar # --- topics: - things.* # --- topics: - "foo,bar" # --- topics: - "foo:0" - "bar:1" - "bar:3" # --- topics: - "foo:0,bar:1,bar:3" # --- topics: - "foo:0-5" ``` ### `transaction_isolation_level` The isolation level for handling transactional messages. This setting determines how transactions are processed and affects data consistency guarantees. **Type**: `string` **Default**: `read_uncommitted` | Option | Summary | | --- | --- | | `read_committed` | If set, only committed transactional records are processed. | | `read_uncommitted` | If set, then uncommitted records are processed. | ### `unordered_processing` Allows consumers to process messages of any given partition in parallel, which may result in unordered processing. This option enables asynchronous publishing at the output level. The maximum parallelization of each partition is determined by the `checkpoint_limit` field. **Type**: `object` ### `unordered_processing.batching` Allows you to configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/) that applies to individual topic partitions in order to batch messages together before flushing them for processing. Batching can be beneficial for performance and useful for windowed processing, and doing so preserves the ordering of topic partitions. **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `unordered_processing.batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `unordered_processing.batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `unordered_processing.batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `unordered_processing.batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `unordered_processing.batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `unordered_processing.checkpoint_limit` The maximum number of messages that are processed in parallel inside the same partition before back pressure is applied. When a message with a specific offset is delivered to the output, the offset is only committed when all messages of previous offsets have also been delivered. This behavior ensures at-least-once delivery guarantees. However, in the event of crashes or server faults, it also increases the likelihood of duplicates. To decrease this risk, reduce the `checkpoint_limit` value. **Type**: `int` **Default**: `1024` ### `unordered_processing.enabled` Whether to enable the unordered processing of messages from a given partition. **Type**: `bool` **Default**: `false` --- # Page 84: resource **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/resource.md --- # resource Resource is an input type that channels messages from a resource input, identified by its name. Resources allow you to tidy up deeply nested configs. For example, the config: ```yaml input: broker: inputs: - kafka: addresses: [ TODO ] topics: [ foo ] consumer_group: foogroup - gcp_pubsub: project: bar subscription: baz ``` Could also be expressed as: ```yaml input: broker: inputs: - resource: foo - resource: bar input_resources: - label: foo kafka: addresses: [ TODO ] topics: [ foo ] consumer_group: foogroup - label: bar gcp_pubsub: project: bar subscription: baz ``` Resources also allow you to reference a single input in multiple places, such as multiple streams mode configs, or multiple entries in a broker input. However, when a resource is referenced more than once the messages it produces are distributed across those references, so each message will only be directed to a single reference, not all of them. You can find out more about resources in [Resources](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/resources/). ```yml input: resource: "" ``` --- # Page 85: salesforce_cdc **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce_cdc.md --- # salesforce_cdc Streams Salesforce Change Data Capture (CDC) and Platform Events from the Pub/Sub gRPC API, optionally preceded by a REST snapshot of the configured sObjects. Subscribes to one or more Salesforce Pub/Sub topics in parallel and emits a message per event. Topics may be: - `/data/ChangeEvent`: per-sObject CDC channel. - `/data/ChangeEvents`: CDC firehose (every CDC-enabled sObject). - `/event/__e`: custom Platform Event. - `/event/`: standard Platform Event (for example `LoginEventStream`). - A bare sObject name (for example, `Account`) is shorthand for `/data/AccountChangeEvent`. Optionally runs a REST snapshot for the CDC sObjects before opening the streaming subscriptions, so the pipeline sees the current state plus continuous changes. Per-topic replay state persists in a cache resource so each subscription resumes across restarts independently. ## When to use this input Use `salesforce_cdc` for: - Continuous ingestion with both historical state (snapshot) and live changes (CDC). - Real-time custom or standard Platform Events. - Mixed CDC + Platform Event pipelines under a single component. Use a different Salesforce input instead if: - You only need a one-off extract or periodic SOQL query: use [`salesforce`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce/). - You need a GraphQL query (cross-object in one request): use [`salesforce_graphql`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce_graphql/). ## Metadata Every emitted message has: - `topic`: The full Pub/Sub topic path (for example, "/event/Order__e"). - `replay_id`: The Pub/Sub replay ID in hex (streaming events only). CDC events also carry: - `operation`: "read" for snapshot rows; "create", "update", "delete", or "undelete" for CDC events. - `sobject`: The sObject API name (for example, "Account"). - `record_ids`: Comma-separated record IDs affected by the event (when present). Platform Events also carry: - `event_uuid`: The Salesforce `EventUuid` extracted from the payload (the canonical dedup key), when present. ## Authentication Uses the Salesforce OAuth 2.0 Client Credentials flow. Create a Connected App in Salesforce, enable OAuth settings and the Client Credentials Flow, ensure Change Data Capture is enabled for the target sObjects (Setup → Change Data Capture), then supply the Consumer Key as `client_id` and Consumer Secret as `client_secret`. ## Prerequisites Each `/data/…​` topic requires Change Data Capture to be enabled for the corresponding sObject (Setup → Change Data Capture). Each `/event/…​` topic requires the corresponding Platform Event to exist in Salesforce; standard events may require Event Monitoring licenses or specific permissions. ### Common ```yml input: label: "" salesforce_cdc: org_url: "" # No default (required) client_id: "" # No default (required) client_secret: "" # No default (required) api_version: v65.0 topics: [] # No default (required) stream_snapshot: true replay_preset: latest snapshot_max_batch_size: 2000 stream_batch_size: 100 max_parallel_snapshot_objects: 1 checkpoint_cache: "" # No default (required) checkpoint_cache_key: salesforce_cdc checkpoint_limit: 1024 auto_replay_nacks: true batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml input: label: "" salesforce_cdc: org_url: "" # No default (required) client_id: "" # No default (required) client_secret: "" # No default (required) api_version: v65.0 topics: [] # No default (required) stream_snapshot: true replay_preset: latest snapshot_max_batch_size: 2000 stream_batch_size: 100 max_parallel_snapshot_objects: 1 checkpoint_cache: "" # No default (required) checkpoint_cache_key: salesforce_cdc checkpoint_limit: 1024 auto_replay_nacks: true grpc: reconnect_base_delay: 500ms reconnect_max_delay: 30s reconnect_max_attempts: 0 shutdown_timeout: 10s buffer_size: 1000 http: timeout: 5s tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] proxy_url: "" disable_http2: false tps_limit: 0 tps_burst: 1 backoff: initial_interval: 1s max_interval: 30s max_retries: 3 tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s http: max_idle_conns: 100 max_idle_conns_per_host: 0 max_conns_per_host: 64 idle_conn_timeout: 1m30s tls_handshake_timeout: 10s expect_continue_timeout: 1s response_header_timeout: 0s disable_keep_alives: false disable_compression: false max_response_header_bytes: 1048576 max_response_body_bytes: 10485760 write_buffer_size: 4096 read_buffer_size: 4096 h2: strict_max_concurrent_requests: false max_decoder_header_table_size: 4096 max_encoder_header_table_size: 4096 max_read_frame_size: 16384 max_receive_buffer_per_connection: 1048576 max_receive_buffer_per_stream: 1048576 send_ping_timeout: 0s ping_timeout: 15s write_byte_timeout: 0s access_log_level: "" access_log_body_limit: 0 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `api_version` Salesforce REST API version to target, prefixed with `v`. Affects endpoint paths (`/services/data/{api_version}/…​`) and available fields/objects. Must be supported by your org; check Setup → Company Information. Older versions may lack recent fields. **Type**: `string` **Default**: `v65.0` ```yaml # Examples: api_version: v65.0 # --- api_version: v62.0 ``` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `checkpoint_cache` Name of the cache resource used to persist snapshot cursor and per-topic replay IDs across restarts. The cache must be declared under the top-level `cache_resources` block. Choose a durable cache (Redis, Postgres, DynamoDB) for production; in-memory caches lose checkpoints on restart. **Type**: `string` ```yaml # Examples: checkpoint_cache: persistent_cache ``` ### `checkpoint_cache_key` Key inside the checkpoint cache where this input’s state is stored. Change when running multiple `salesforce_cdc` inputs against the same cache resource to avoid collisions. **Type**: `string` **Default**: `salesforce_cdc` ### `checkpoint_limit` Maximum number of unacknowledged batches in flight (per topic) before that topic pauses reading. Prevents unbounded memory growth when downstream components stall. Higher values increase throughput in steady state; lower values bound memory under backpressure. **Type**: `int` **Default**: `1024` ### `client_id` Consumer Key of the Salesforce Connected App authorized for the OAuth Client Credentials flow. Create the Connected App under Setup → App Manager → New Connected App, enable OAuth settings, enable the Client Credentials Flow under `Flow Enablement`, then copy the Consumer Key from `Manage Consumer Details`. **Type**: `string` ### `client_secret` Consumer Secret of the Salesforce Connected App, paired with `client_id`. Sensitive; prefer environment variable interpolation (`${SALESFORCE_CLIENT_SECRET}`) over inlining. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `grpc` gRPC transport tuning for the Pub/Sub API connection. **Type**: `object` ### `grpc.buffer_size` Size of the internal gRPC event receive buffer. **Type**: `int` **Default**: `1000` ### `grpc.reconnect_base_delay` Base delay for gRPC reconnection backoff. **Type**: `string` **Default**: `500ms` ### `grpc.reconnect_max_attempts` Maximum number of gRPC reconnection attempts. 0 means unlimited. This budget also governs transient schema-fetch failures: an event whose schema fetch keeps failing at the same replay position is retried (by reconnect-and-redeliver, or inline before the first event is delivered) this many times before the topic fails permanently. Deterministic schema failures - a schema that is missing, inaccessible, or fails to compile - and payloads that repeatedly fail to decode give up after a small fixed number of attempts regardless of this setting, since retrying cannot change the outcome. **Type**: `int` **Default**: `0` ### `grpc.reconnect_max_delay` Maximum delay for gRPC reconnection backoff. **Type**: `string` **Default**: `30s` ### `grpc.shutdown_timeout` Timeout for graceful gRPC client shutdown. **Type**: `string` **Default**: `10s` ### `http` HTTP client configuration for Salesforce REST calls (OAuth token endpoint and, where applicable, data queries). **Type**: `object` ### `http.access_log_body_limit` Maximum bytes of request/response body to include in logs. 0 to skip body logging. **Type**: `int` **Default**: `0` ### `http.access_log_level` Log level for HTTP request/response logging. Empty disables logging. **Type**: `string` **Default**: `""` **Options**: `""`, `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR` ### `http.backoff` Adaptive backoff configuration for 429 (Too Many Requests) responses. Always active. **Type**: `object` ### `http.backoff.initial_interval` Initial interval between retries on 429 responses. **Type**: `string` **Default**: `1s` ### `http.backoff.max_interval` Maximum interval between retries on 429 responses. **Type**: `string` **Default**: `30s` ### `http.backoff.max_retries` Maximum number of retries on 429 responses. **Type**: `int` **Default**: `3` ### `http.disable_http2` Disable HTTP/2 and force HTTP/1.1. **Type**: `bool` **Default**: `false` ### `http.http` HTTP transport settings controlling connection pooling, timeouts, and HTTP/2. **Type**: `object` ### `http.http.disable_compression` Disable automatic decompression of gzip responses. **Type**: `bool` **Default**: `false` ### `http.http.disable_keep_alives` Disable HTTP keep-alive connections; each request uses a new connection. **Type**: `bool` **Default**: `false` ### `http.http.expect_continue_timeout` Maximum time to wait for a server’s 100-continue response before sending the body. 0 means the body is sent immediately. **Type**: `string` **Default**: `1s` ### `http.http.h2` HTTP/2-specific transport settings. Only applied when HTTP/2 is enabled. **Type**: `object` ### `http.http.h2.max_decoder_header_table_size` Upper limit in bytes for the HPACK header table used to decode headers from the peer. Must be less than 4 MiB. **Type**: `int` **Default**: `4096` ### `http.http.h2.max_encoder_header_table_size` Upper limit in bytes for the HPACK header table used to encode headers sent to the peer. Must be less than 4 MiB. **Type**: `int` **Default**: `4096` ### `http.http.h2.max_read_frame_size` Largest HTTP/2 frame this endpoint will read. Valid range: 16 KiB to 16 MiB. **Type**: `int` **Default**: `16384` ### `http.http.h2.max_receive_buffer_per_connection` Maximum flow-control window size in bytes for data received on a connection. Must be at least 64 KiB and less than 4 MiB. **Type**: `int` **Default**: `1048576` ### `http.http.h2.max_receive_buffer_per_stream` Maximum flow-control window size in bytes for data received on a single stream. Must be less than 4 MiB. **Type**: `int` **Default**: `1048576` ### `http.http.h2.ping_timeout` Timeout waiting for a PING response before closing the connection. **Type**: `string` **Default**: `15s` ### `http.http.h2.send_ping_timeout` Idle timeout after which a PING frame is sent to verify connection health. 0 disables health checks. **Type**: `string` **Default**: `0s` ### `http.http.h2.strict_max_concurrent_requests` When true, new requests block when a connection’s concurrency limit is reached instead of opening a new connection. **Type**: `bool` **Default**: `false` ### `http.http.h2.write_byte_timeout` Timeout for writing data to a connection. The timer resets whenever bytes are written. 0 disables the timeout. **Type**: `string` **Default**: `0s` ### `http.http.idle_conn_timeout` How long an idle connection remains in the pool before being closed. 0 disables the timeout. **Type**: `string` **Default**: `1m30s` ### `http.http.max_conns_per_host` Maximum total connections (active + idle) per host. 0 means unlimited. **Type**: `int` **Default**: `64` ### `http.http.max_idle_conns` Maximum total number of idle (keep-alive) connections across all hosts. 0 means unlimited. **Type**: `int` **Default**: `100` ### `http.http.max_idle_conns_per_host` Maximum idle connections to keep per host. 0 (the default) uses GOMAXPROCS+1. **Type**: `int` **Default**: `0` ### `http.http.max_response_body_bytes` Maximum bytes of response body the client will read. The response body is wrapped with a limit reader; reads beyond this cap return EOF. 0 disables the limit. **Type**: `int` **Default**: `10485760` ### `http.http.max_response_header_bytes` Maximum bytes of response headers to allow. **Type**: `int` **Default**: `1048576` ### `http.http.read_buffer_size` Size in bytes of the per-connection read buffer. **Type**: `int` **Default**: `4096` ### `http.http.response_header_timeout` Maximum time to wait for response headers after writing the full request. 0 disables the timeout. **Type**: `string` **Default**: `0s` ### `http.http.tls_handshake_timeout` Maximum time to wait for a TLS handshake to complete. 0 disables the timeout. **Type**: `string` **Default**: `10s` ### `http.http.write_buffer_size` Size in bytes of the per-connection write buffer. **Type**: `int` **Default**: `4096` ### `http.proxy_url` HTTP proxy URL. Empty string disables proxying. **Type**: `string` **Default**: `""` ### `http.tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `http.tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `http.tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `http.tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `http.tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `http.tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `http.tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `http.timeout` HTTP request timeout. **Type**: `string` **Default**: `5s` ### `http.tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `http.tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `http.tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `http.tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `http.tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `http.tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `http.tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `http.tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `http.tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `http.tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `http.tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `http.tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `http.tps_burst` Maximum burst size for rate limiting. **Type**: `int` **Default**: `1` ### `http.tps_limit` Rate limit in requests per second. 0 disables rate limiting. **Type**: `float` **Default**: `0` ### `max_parallel_snapshot_objects` Number of sObjects snapshotted concurrently during the REST snapshot phase. Each in-flight snapshot consumes one HTTP connection and Salesforce API call quota. Default 1 serializes the work; raise when snapshotting many sObjects and your API limits permit. **Type**: `int` **Default**: `1` ### `org_url` Salesforce instance base URL for your org, protocol included and no trailing slash. Used as the base for both the OAuth token endpoint and REST queries. Production orgs use `https://{my-domain}.my.salesforce.com`; sandboxes use `https://{my-domain}.sandbox.my.salesforce.com`. Legacy instance URLs (`https://na123.salesforce.com`) still work but My Domain URLs are strongly recommended by Salesforce. **Type**: `string` ```yaml # Examples: org_url: https://acme.my.salesforce.com # --- org_url: https://acme--staging.sandbox.my.salesforce.com ``` ### `replay_preset` Initial replay position used per topic only on first run (when no checkpoint exists in the cache); ignored once a topic’s replay ID has been written. - `latest`: Start from new events only; any changes between prior run and Connect are skipped. - `earliest`: Replay from the retention start (24h standard, 72h with enhanced retention). Use to recover missed events after outages. **Type**: `string` **Default**: `latest` **Options**: `latest`, `earliest` ### `snapshot_max_batch_size` Page size for the REST snapshot query; records per `/query` response. Must be between 200 and 2000 per Salesforce REST API limits. Larger pages reduce HTTP round trips; smaller pages reduce peak memory per fetch. **Type**: `int` **Default**: `2000` ```yaml # Examples: snapshot_max_batch_size: 2000 # --- snapshot_max_batch_size: 500 ``` ### `stream_batch_size` Number of events requested per gRPC `Fetch` call, per topic. Higher values improve throughput at the cost of peak batch memory; lower values give steadier latency under load. **Type**: `int` **Default**: `100` ```yaml # Examples: stream_batch_size: 100 # --- stream_batch_size: 500 ``` ### `stream_snapshot` When true (default), paginate a full REST snapshot of every CDC sObject in `topics` before opening any streaming subscription. When false, skip the snapshot and start streaming immediately. Platform Event topics (`/event/…​`) are always skipped; they have no REST equivalent. **Type**: `bool` **Default**: `true` ### `topics[]` Pub/Sub topics to subscribe to. Each entry is one of: a bare sObject name (`Account` → `/data/AccountChangeEvent`), an explicit CDC channel (`/data/AccountChangeEvent`), the CDC firehose (`/data/ChangeEvents`), or a Platform Event topic (`/event/Order__e`, `/event/LoginEventStream`). Each topic gets its own gRPC subscription with an independent replay cursor. **Type**: `array` ```yaml # Examples: topics: - Account - Contact # --- topics: - /data/ChangeEvents # --- topics: - Account - /event/Order__e # --- topics: - Opportunity - MyCustom__c - /event/Sync_Requested__e ``` ## Examples ### Snapshot + CDC for core objects Snapshot Accounts, Contacts, and Opportunities, then stream their CDC events: ```yaml input: salesforce_cdc: org_url: https://acme.my.salesforce.com client_id: ${SALESFORCE_CLIENT_ID} client_secret: ${SALESFORCE_CLIENT_SECRET} topics: [ Account, Contact, Opportunity ] stream_snapshot: true replay_preset: latest checkpoint_cache: persistent_cache cache_resources: - label: persistent_cache redis: url: redis://localhost:6379 ``` ### CDC firehose without snapshot Subscribe to every CDC-enabled sObject via the firehose, no historical snapshot: ```yaml input: salesforce_cdc: org_url: https://acme.my.salesforce.com client_id: ${SALESFORCE_CLIENT_ID} client_secret: ${SALESFORCE_CLIENT_SECRET} topics: [ /data/ChangeEvents ] stream_snapshot: false replay_preset: latest checkpoint_cache: persistent_cache ``` ### Mixed CDC + Platform Events Combine Account CDC with a custom Platform Event in one pipeline: ```yaml input: salesforce_cdc: org_url: https://acme.my.salesforce.com client_id: ${SALESFORCE_CLIENT_ID} client_secret: ${SALESFORCE_CLIENT_SECRET} topics: - Account - /event/Order_Created__e stream_snapshot: true replay_preset: latest checkpoint_cache: persistent_cache ``` ### Platform Events only Stream a custom event and a standard login stream: snapshot is skipped automatically: ```yaml input: salesforce_cdc: org_url: https://acme.my.salesforce.com client_id: ${SALESFORCE_CLIENT_ID} client_secret: ${SALESFORCE_CLIENT_SECRET} topics: - /event/Order__e - /event/LoginEventStream replay_preset: latest checkpoint_cache: persistent_cache ``` --- # Page 86: salesforce_graphql **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce_graphql.md --- # salesforce_graphql Executes a Salesforce GraphQL (UIAPI) query once and emits a message for each record. Executes a GraphQL query against the Salesforce UIAPI (`POST /services/data/{api_version}/graphql`), walks the response tree, and emits one message per record. When records are exhausted the input shuts down, letting the pipeline terminate gracefully (or the next input in a [sequence](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sequence/) to take over). ## When to use this input Use `salesforce_graphql` for: - Cross-object queries in a single request (parent + children + grandchildren). - Response shapes that already match your downstream schema. - Queries benefiting from GraphQL’s field-level selection and nesting. - Adopting Salesforce’s UIAPI / future-forward query surface. Use a different Salesforce input instead if: - You only need single-object SELECTs: use [`salesforce`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce/) (simpler, no GraphQL schema knowledge needed). - You need continuous change events: use [`salesforce_cdc`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce_cdc/). ## Pagination When the query selects an `edges`/`pageInfo` connection, the input transparently paginates by injecting `after: ""` into the query string between requests. The query must include `pageInfo { hasNextPage endCursor }` for pagination to terminate cleanly. Responses without an `edges` array are emitted as a single message and the input completes. ## Metadata This input adds no Salesforce-specific metadata. GraphQL response shapes vary by query, so record identity and context travel in the message body. ## Authentication Uses the Salesforce OAuth 2.0 Client Credentials flow. Create a Connected App in Salesforce, enable OAuth settings and the Client Credentials Flow, grant the `api` OAuth scope, then supply the Consumer Key as `client_id` and Consumer Secret as `client_secret`. The Connected App must have access to the target UIAPI objects. ### Common ```yml input: label: "" salesforce_graphql: org_url: "" # No default (required) client_id: "" # No default (required) client_secret: "" # No default (required) api_version: v65.0 query: "" # No default (required) variables: "" # No default (optional) auto_replay_nacks: true ``` ### Advanced ```yml input: label: "" salesforce_graphql: org_url: "" # No default (required) client_id: "" # No default (required) client_secret: "" # No default (required) api_version: v65.0 query: "" # No default (required) variables: "" # No default (optional) auto_replay_nacks: true http: timeout: 5s tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] proxy_url: "" disable_http2: false tps_limit: 0 tps_burst: 1 backoff: initial_interval: 1s max_interval: 30s max_retries: 3 tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s http: max_idle_conns: 100 max_idle_conns_per_host: 0 max_conns_per_host: 64 idle_conn_timeout: 1m30s tls_handshake_timeout: 10s expect_continue_timeout: 1s response_header_timeout: 0s disable_keep_alives: false disable_compression: false max_response_header_bytes: 1048576 max_response_body_bytes: 10485760 write_buffer_size: 4096 read_buffer_size: 4096 h2: strict_max_concurrent_requests: false max_decoder_header_table_size: 4096 max_encoder_header_table_size: 4096 max_read_frame_size: 16384 max_receive_buffer_per_connection: 1048576 max_receive_buffer_per_stream: 1048576 send_ping_timeout: 0s ping_timeout: 15s write_byte_timeout: 0s access_log_level: "" access_log_body_limit: 0 ``` ## Fields ### `api_version` Salesforce REST API version to target, prefixed with `v`. Affects endpoint paths (`/services/data/{api_version}/…​`) and available fields/objects. Must be supported by your org; check Setup → Company Information. Older versions may lack recent fields. **Type**: `string` **Default**: `v65.0` ```yaml # Examples: api_version: v65.0 # --- api_version: v62.0 ``` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `client_id` Consumer Key of the Salesforce Connected App authorized for the OAuth Client Credentials flow. Create the Connected App under Setup → App Manager → New Connected App, enable OAuth settings, enable the Client Credentials Flow under `Flow Enablement`, then copy the Consumer Key from `Manage Consumer Details`. **Type**: `string` ### `client_secret` Consumer Secret of the Salesforce Connected App, paired with `client_id`. Sensitive; prefer environment variable interpolation (`${SALESFORCE_CLIENT_SECRET}`) over inlining. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `http` HTTP client configuration for Salesforce REST calls (OAuth token endpoint and, where applicable, data queries). **Type**: `object` ### `http.access_log_body_limit` Maximum bytes of request/response body to include in logs. 0 to skip body logging. **Type**: `int` **Default**: `0` ### `http.access_log_level` Log level for HTTP request/response logging. Empty disables logging. **Type**: `string` **Default**: `""` **Options**: `""`, `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR` ### `http.backoff` Adaptive backoff configuration for 429 (Too Many Requests) responses. Always active. **Type**: `object` ### `http.backoff.initial_interval` Initial interval between retries on 429 responses. **Type**: `string` **Default**: `1s` ### `http.backoff.max_interval` Maximum interval between retries on 429 responses. **Type**: `string` **Default**: `30s` ### `http.backoff.max_retries` Maximum number of retries on 429 responses. **Type**: `int` **Default**: `3` ### `http.disable_http2` Disable HTTP/2 and force HTTP/1.1. **Type**: `bool` **Default**: `false` ### `http.http` HTTP transport settings controlling connection pooling, timeouts, and HTTP/2. **Type**: `object` ### `http.http.disable_compression` Disable automatic decompression of gzip responses. **Type**: `bool` **Default**: `false` ### `http.http.disable_keep_alives` Disable HTTP keep-alive connections; each request uses a new connection. **Type**: `bool` **Default**: `false` ### `http.http.expect_continue_timeout` Maximum time to wait for a server’s 100-continue response before sending the body. 0 means the body is sent immediately. **Type**: `string` **Default**: `1s` ### `http.http.h2` HTTP/2-specific transport settings. Only applied when HTTP/2 is enabled. **Type**: `object` ### `http.http.h2.max_decoder_header_table_size` Upper limit in bytes for the HPACK header table used to decode headers from the peer. Must be less than 4 MiB. **Type**: `int` **Default**: `4096` ### `http.http.h2.max_encoder_header_table_size` Upper limit in bytes for the HPACK header table used to encode headers sent to the peer. Must be less than 4 MiB. **Type**: `int` **Default**: `4096` ### `http.http.h2.max_read_frame_size` Largest HTTP/2 frame this endpoint will read. Valid range: 16 KiB to 16 MiB. **Type**: `int` **Default**: `16384` ### `http.http.h2.max_receive_buffer_per_connection` Maximum flow-control window size in bytes for data received on a connection. Must be at least 64 KiB and less than 4 MiB. **Type**: `int` **Default**: `1048576` ### `http.http.h2.max_receive_buffer_per_stream` Maximum flow-control window size in bytes for data received on a single stream. Must be less than 4 MiB. **Type**: `int` **Default**: `1048576` ### `http.http.h2.ping_timeout` Timeout waiting for a PING response before closing the connection. **Type**: `string` **Default**: `15s` ### `http.http.h2.send_ping_timeout` Idle timeout after which a PING frame is sent to verify connection health. 0 disables health checks. **Type**: `string` **Default**: `0s` ### `http.http.h2.strict_max_concurrent_requests` When true, new requests block when a connection’s concurrency limit is reached instead of opening a new connection. **Type**: `bool` **Default**: `false` ### `http.http.h2.write_byte_timeout` Timeout for writing data to a connection. The timer resets whenever bytes are written. 0 disables the timeout. **Type**: `string` **Default**: `0s` ### `http.http.idle_conn_timeout` How long an idle connection remains in the pool before being closed. 0 disables the timeout. **Type**: `string` **Default**: `1m30s` ### `http.http.max_conns_per_host` Maximum total connections (active + idle) per host. 0 means unlimited. **Type**: `int` **Default**: `64` ### `http.http.max_idle_conns` Maximum total number of idle (keep-alive) connections across all hosts. 0 means unlimited. **Type**: `int` **Default**: `100` ### `http.http.max_idle_conns_per_host` Maximum idle connections to keep per host. 0 (the default) uses GOMAXPROCS+1. **Type**: `int` **Default**: `0` ### `http.http.max_response_body_bytes` Maximum bytes of response body the client will read. The response body is wrapped with a limit reader; reads beyond this cap return EOF. 0 disables the limit. **Type**: `int` **Default**: `10485760` ### `http.http.max_response_header_bytes` Maximum bytes of response headers to allow. **Type**: `int` **Default**: `1048576` ### `http.http.read_buffer_size` Size in bytes of the per-connection read buffer. **Type**: `int` **Default**: `4096` ### `http.http.response_header_timeout` Maximum time to wait for response headers after writing the full request. 0 disables the timeout. **Type**: `string` **Default**: `0s` ### `http.http.tls_handshake_timeout` Maximum time to wait for a TLS handshake to complete. 0 disables the timeout. **Type**: `string` **Default**: `10s` ### `http.http.write_buffer_size` Size in bytes of the per-connection write buffer. **Type**: `int` **Default**: `4096` ### `http.proxy_url` HTTP proxy URL. Empty string disables proxying. **Type**: `string` **Default**: `""` ### `http.tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `http.tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `http.tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `http.tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `http.tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `http.tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `http.tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `http.timeout` HTTP request timeout. **Type**: `string` **Default**: `5s` ### `http.tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `http.tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `http.tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `http.tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `http.tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `http.tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `http.tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `http.tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `http.tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `http.tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `http.tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `http.tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `http.tps_burst` Maximum burst size for rate limiting. **Type**: `int` **Default**: `1` ### `http.tps_limit` Rate limit in requests per second. 0 disables rate limiting. **Type**: `float` **Default**: `0` ### `org_url` Salesforce instance base URL for your org, protocol included and no trailing slash. Used as the base for both the OAuth token endpoint and REST queries. Production orgs use `https://{my-domain}.my.salesforce.com`; sandboxes use `https://{my-domain}.sandbox.my.salesforce.com`. Legacy instance URLs (`https://na123.salesforce.com`) still work but My Domain URLs are strongly recommended by Salesforce. **Type**: `string` ```yaml # Examples: org_url: https://acme.my.salesforce.com # --- org_url: https://acme--staging.sandbox.my.salesforce.com ``` ### `query` The GraphQL query document as a single string. Must target the Salesforce UIAPI schema (`uiapi.query.*` or `uiapi.mutation.*`). Typically follows the UIAPI convention of nested `edges { node { field { value } } }`. Variables are referenced with `$name` and supplied via the `variables` field. For automatic pagination, include `pageInfo { hasNextPage endCursor }` in the relevant connection. **Type**: `string` ```yaml # Examples: query: query Accounts { uiapi { query { Account { edges { node { Id { value } Name { value } } } pageInfo { hasNextPage endCursor } } } } } # --- query: "query Accounts($first: Int) { uiapi { query { Account(first: $first) { edges { node { Id { value } Name { value } } } pageInfo { hasNextPage endCursor } } } } }" ``` ### `variables` Optional [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) whose result must be an object whose keys are GraphQL variable names referenced by `query`. Values pass through as JSON in the request body’s `variables` field. The mapping runs once at startup with no message context, so it can use literal values and functions that don’t read a message, such as `now()`, but can’t reference message content or metadata. **Type**: `string` ```yaml # Examples: variables: 'root = {"first": 100}' # --- variables: 'root = {"since": now().ts_format("2006-01-02T15:04:05Z"), "limit": 500}' ``` ## Examples ### Account snapshot via GraphQL Fetch the first 500 Accounts with a nested UIAPI query: ```yaml input: salesforce_graphql: org_url: https://acme.my.salesforce.com client_id: ${SALESFORCE_CLIENT_ID} client_secret: ${SALESFORCE_CLIENT_SECRET} query: | query Accounts($limit: Int) { uiapi { query { Account(first: $limit) { edges { node { Id { value } Name { value } LastModifiedDate { value } } } pageInfo { hasNextPage endCursor } } } } } variables: | root = {"limit": 500} ``` --- # Page 87: salesforce **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce.md --- # salesforce Executes a Salesforce SOQL query once and emits a message for each record. Runs a SOQL query against the Salesforce REST API, paginates through all result pages, and emits one message per record. When results are exhausted the input shuts down, letting the pipeline terminate gracefully (or the next input in a [sequence](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sequence/) to take over). ## When to use this input Use `salesforce` for: - One-shot extracts (for example, dump all Accounts into a warehouse). - Periodic full-table refreshes via a scheduled pipeline or [sequence](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sequence/). - Backfills and ad-hoc queries. - Warming up a downstream pipeline before switching to CDC. Use a different Salesforce input instead if: - You need continuous change events: use [`salesforce_cdc`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce_cdc/). - You need a GraphQL query (cross-object in one request): use [`salesforce_graphql`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce_graphql/). ## Metadata This input adds the following metadata fields to each message: - `sobject`: The sObject API name (for example, "Account"). ## Authentication Uses the Salesforce OAuth 2.0 Client Credentials flow. Create a Connected App in Salesforce, enable OAuth settings and the Client Credentials Flow, then supply the Consumer Key as `client_id` and Consumer Secret as `client_secret`. ### Common ```yml input: label: "" salesforce: org_url: "" # No default (required) client_id: "" # No default (required) client_secret: "" # No default (required) api_version: v65.0 object: "" # No default (required) columns: [] # No default (required) where: "" # No default (optional) args_mapping: "" # No default (optional) auto_replay_nacks: true ``` ### Advanced ```yml input: label: "" salesforce: org_url: "" # No default (required) client_id: "" # No default (required) client_secret: "" # No default (required) api_version: v65.0 object: "" # No default (required) columns: [] # No default (required) where: "" # No default (optional) args_mapping: "" # No default (optional) prefix: "" # No default (optional) suffix: "" # No default (optional) auto_replay_nacks: true http: timeout: 5s tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] proxy_url: "" disable_http2: false tps_limit: 0 tps_burst: 1 backoff: initial_interval: 1s max_interval: 30s max_retries: 3 tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s http: max_idle_conns: 100 max_idle_conns_per_host: 0 max_conns_per_host: 64 idle_conn_timeout: 1m30s tls_handshake_timeout: 10s expect_continue_timeout: 1s response_header_timeout: 0s disable_keep_alives: false disable_compression: false max_response_header_bytes: 1048576 max_response_body_bytes: 10485760 write_buffer_size: 4096 read_buffer_size: 4096 h2: strict_max_concurrent_requests: false max_decoder_header_table_size: 4096 max_encoder_header_table_size: 4096 max_read_frame_size: 16384 max_receive_buffer_per_connection: 1048576 max_receive_buffer_per_stream: 1048576 send_ping_timeout: 0s ping_timeout: 15s write_byte_timeout: 0s access_log_level: "" access_log_body_limit: 0 ``` ## Fields ### `api_version` Salesforce REST API version to target, prefixed with `v`. Affects endpoint paths (`/services/data/{api_version}/…​`) and available fields/objects. Must be supported by your org; check Setup → Company Information. Older versions may lack recent fields. **Type**: `string` **Default**: `v65.0` ```yaml # Examples: api_version: v65.0 # --- api_version: v62.0 ``` ### `args_mapping` Optional [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) whose result must be an array of values matching the count of `?` placeholders in `where`. Values are SOQL-escaped: strings become quoted literals, timestamps become ISO-8601, booleans and numbers pass through. The mapping runs once at startup with no message context, so it can use literal values and functions that don’t read a message, such as `now()`, but can’t reference message content or metadata. **Type**: `string` ```yaml # Examples: args_mapping: root = [ (now() - "1h").ts_format("2006-01-02T15:04:05Z") ] # --- args_mapping: root = [ "Active", (now() - "24h").ts_format("2006-01-02T15:04:05Z") ] ``` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `client_id` Consumer Key of the Salesforce Connected App authorized for the OAuth Client Credentials flow. Create the Connected App under Setup → App Manager → New Connected App, enable OAuth settings, enable the Client Credentials Flow under `Flow Enablement`, then copy the Consumer Key from `Manage Consumer Details`. **Type**: `string` ### `client_secret` Consumer Secret of the Salesforce Connected App, paired with `client_id`. Sensitive; prefer environment variable interpolation (`${SALESFORCE_CLIENT_SECRET}`) over inlining. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `columns[]` Ordered list of field API names to retrieve. SOQL does not accept `*`; every field must be listed explicitly. Standard fields use their documented names; custom fields end with `__c`. Relationship fields traverse parents via dot notation (`Account.Name`, `Owner.Manager.Email`) up to 5 levels deep. Requesting a non-existent or non-queryable field fails at Connect time with a SOQL compile error. **Type**: `array` ```yaml # Examples: columns: - Id - Name - LastModifiedDate # --- columns: - Id - Account.Name - Owner.Email # --- columns: - Id - MyCustom__c ``` ### `http` HTTP client configuration for Salesforce REST calls (OAuth token endpoint and, where applicable, data queries). **Type**: `object` ### `http.access_log_body_limit` Maximum bytes of request/response body to include in logs. 0 to skip body logging. **Type**: `int` **Default**: `0` ### `http.access_log_level` Log level for HTTP request/response logging. Empty disables logging. **Type**: `string` **Default**: `""` **Options**: `""`, `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR` ### `http.backoff` Adaptive backoff configuration for 429 (Too Many Requests) responses. Always active. **Type**: `object` ### `http.backoff.initial_interval` Initial interval between retries on 429 responses. **Type**: `string` **Default**: `1s` ### `http.backoff.max_interval` Maximum interval between retries on 429 responses. **Type**: `string` **Default**: `30s` ### `http.backoff.max_retries` Maximum number of retries on 429 responses. **Type**: `int` **Default**: `3` ### `http.disable_http2` Disable HTTP/2 and force HTTP/1.1. **Type**: `bool` **Default**: `false` ### `http.http` HTTP transport settings controlling connection pooling, timeouts, and HTTP/2. **Type**: `object` ### `http.http.disable_compression` Disable automatic decompression of gzip responses. **Type**: `bool` **Default**: `false` ### `http.http.disable_keep_alives` Disable HTTP keep-alive connections; each request uses a new connection. **Type**: `bool` **Default**: `false` ### `http.http.expect_continue_timeout` Maximum time to wait for a server’s 100-continue response before sending the body. 0 means the body is sent immediately. **Type**: `string` **Default**: `1s` ### `http.http.h2` HTTP/2-specific transport settings. Only applied when HTTP/2 is enabled. **Type**: `object` ### `http.http.h2.max_decoder_header_table_size` Upper limit in bytes for the HPACK header table used to decode headers from the peer. Must be less than 4 MiB. **Type**: `int` **Default**: `4096` ### `http.http.h2.max_encoder_header_table_size` Upper limit in bytes for the HPACK header table used to encode headers sent to the peer. Must be less than 4 MiB. **Type**: `int` **Default**: `4096` ### `http.http.h2.max_read_frame_size` Largest HTTP/2 frame this endpoint will read. Valid range: 16 KiB to 16 MiB. **Type**: `int` **Default**: `16384` ### `http.http.h2.max_receive_buffer_per_connection` Maximum flow-control window size in bytes for data received on a connection. Must be at least 64 KiB and less than 4 MiB. **Type**: `int` **Default**: `1048576` ### `http.http.h2.max_receive_buffer_per_stream` Maximum flow-control window size in bytes for data received on a single stream. Must be less than 4 MiB. **Type**: `int` **Default**: `1048576` ### `http.http.h2.ping_timeout` Timeout waiting for a PING response before closing the connection. **Type**: `string` **Default**: `15s` ### `http.http.h2.send_ping_timeout` Idle timeout after which a PING frame is sent to verify connection health. 0 disables health checks. **Type**: `string` **Default**: `0s` ### `http.http.h2.strict_max_concurrent_requests` When true, new requests block when a connection’s concurrency limit is reached instead of opening a new connection. **Type**: `bool` **Default**: `false` ### `http.http.h2.write_byte_timeout` Timeout for writing data to a connection. The timer resets whenever bytes are written. 0 disables the timeout. **Type**: `string` **Default**: `0s` ### `http.http.idle_conn_timeout` How long an idle connection remains in the pool before being closed. 0 disables the timeout. **Type**: `string` **Default**: `1m30s` ### `http.http.max_conns_per_host` Maximum total connections (active + idle) per host. 0 means unlimited. **Type**: `int` **Default**: `64` ### `http.http.max_idle_conns` Maximum total number of idle (keep-alive) connections across all hosts. 0 means unlimited. **Type**: `int` **Default**: `100` ### `http.http.max_idle_conns_per_host` Maximum idle connections to keep per host. 0 (the default) uses GOMAXPROCS+1. **Type**: `int` **Default**: `0` ### `http.http.max_response_body_bytes` Maximum bytes of response body the client will read. The response body is wrapped with a limit reader; reads beyond this cap return EOF. 0 disables the limit. **Type**: `int` **Default**: `10485760` ### `http.http.max_response_header_bytes` Maximum bytes of response headers to allow. **Type**: `int` **Default**: `1048576` ### `http.http.read_buffer_size` Size in bytes of the per-connection read buffer. **Type**: `int` **Default**: `4096` ### `http.http.response_header_timeout` Maximum time to wait for response headers after writing the full request. 0 disables the timeout. **Type**: `string` **Default**: `0s` ### `http.http.tls_handshake_timeout` Maximum time to wait for a TLS handshake to complete. 0 disables the timeout. **Type**: `string` **Default**: `10s` ### `http.http.write_buffer_size` Size in bytes of the per-connection write buffer. **Type**: `int` **Default**: `4096` ### `http.proxy_url` HTTP proxy URL. Empty string disables proxying. **Type**: `string` **Default**: `""` ### `http.tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `http.tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `http.tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `http.tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `http.tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `http.tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `http.tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `http.timeout` HTTP request timeout. **Type**: `string` **Default**: `5s` ### `http.tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `http.tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `http.tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `http.tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `http.tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `http.tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `http.tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `http.tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `http.tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `http.tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `http.tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `http.tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `http.tps_burst` Maximum burst size for rate limiting. **Type**: `int` **Default**: `1` ### `http.tps_limit` Rate limit in requests per second. 0 disables rate limiting. **Type**: `float` **Default**: `0` ### `object` The sObject API name to SELECT from. Case-sensitive; uses the API name, not the display label. Standard objects use the noun (`Account`, `Opportunity`); custom objects end with `__c`; Big Objects end with `__b`; External Objects end with `__x`. Confirm the exact API name in Setup → Object Manager. **Type**: `string` ```yaml # Examples: object: Account # --- object: Contact # --- object: MyCustom__c ``` ### `org_url` Salesforce instance base URL for your org, protocol included and no trailing slash. Used as the base for both the OAuth token endpoint and REST queries. Production orgs use `https://{my-domain}.my.salesforce.com`; sandboxes use `https://{my-domain}.sandbox.my.salesforce.com`. Legacy instance URLs (`https://na123.salesforce.com`) still work but My Domain URLs are strongly recommended by Salesforce. **Type**: `string` ```yaml # Examples: org_url: https://acme.my.salesforce.com # --- org_url: https://acme--staging.sandbox.my.salesforce.com ``` ### `prefix` Optional SOQL fragment inserted before the SELECT keyword. Rarely needed; provided for forward compatibility with future SOQL extensions or Bulk API framing. **Type**: `string` ### `suffix` Optional SOQL fragment appended after the WHERE clause. Typical uses: `ORDER BY` for deterministic pagination, `LIMIT` to cap result size, `FOR REFERENCE` / `FOR VIEW` to mark records for Chatter tracking. **Type**: `string` ```yaml # Examples: suffix: ORDER BY LastModifiedDate DESC # --- suffix: ORDER BY Id LIMIT 1000 # --- suffix: ORDER BY CreatedDate DESC LIMIT 10000 ``` ### `where` Optional SOQL WHERE body, without the `WHERE` keyword. `?` placeholders are substituted client-side from `args_mapping` with SOQL literal escaping (quoted strings, ISO-8601 datetimes). Supports the full WHERE grammar: `AND`/`OR`/`NOT`, `LIKE`, `IN`, date literals (`TODAY`, `LAST_N_DAYS:7`), subqueries. Date/datetime comparisons require ISO-8601 with explicit timezone. **Type**: `string` ```yaml # Examples: where: LastModifiedDate > ? # --- where: Status__c = ? AND CreatedDate > ? # --- where: OwnerId IN (?, ?) ``` ## Examples ### Recent Account Changes Query Accounts modified in the last hour and emit one message per record: ```yaml input: salesforce: org_url: https://acme.my.salesforce.com client_id: ${SALESFORCE_CLIENT_ID} client_secret: ${SALESFORCE_CLIENT_SECRET} object: Account columns: [ Id, Name, LastModifiedDate ] where: LastModifiedDate > ? args_mapping: | root = [ (now() - "1h").ts_format("2006-01-02T15:04:05Z") ] ``` --- # Page 88: sap_hana **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sap_hana.md --- # sap_hana Reads rows from a SAP HANA table. Reads rows from a SAP HANA table. Supports five modes: - `bulk`: reads all rows once then the input terminates (wrap it in [`read_until`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/read_until/) with `restart_input: true` for periodic re-reads). - `incrementing`: polls for rows where `incrementing_column` exceeds the last seen value, emitting only net-new rows. Values from an `IDENTITY` column or a sequence are assigned when a row is inserted, not when it commits: with concurrent writers a lower value can commit after a higher one has been read, and that row is never emitted. Use `timestamp+incrementing` with a `timestamp_delay` longer than your longest write transaction when the table has concurrent writers. - `query`: executes a user-supplied SQL statement and emits one message per result row. - `timestamp`: polls for rows where `timestamp_column` falls within `(last_hwm, database_now - timestamp_delay]`. The bound is read from the database clock (see `timestamp_clock`) and the delay absorbs commit lag. The HWM advances to the window bound once the window is fully consumed. Mid-window, a batch checkpoints the timestamp of its last row when the next row has a later one, so a restart re-reads only the rows of the timestamp that was in progress (rows sharing a timestamp cannot be split). - `timestamp+incrementing`: like `timestamp` but orders by `(timestamp_column, incrementing_column)` and resumes after the exact `(timestamp, incrementing)` pair of the last delivered row, so rows sharing a timestamp are neither duplicated nor missed and a restart mid-window continues from the last acknowledged batch rather than the window start. ## Metadata Messages produced in `bulk`, `incrementing`, `timestamp`, and `timestamp+incrementing` modes carry the following metadata fields (`query` mode attaches none): - `table_name`: The HANA table name. - `database_schema`: The configured `schema_name`. Only present when `schema_name` is set. - `schema`: Avro-compatible schema derived from `SYS.TABLE_COLUMNS`, suitable for use with `schema_registry_encode`. Column additions are detected automatically without a pipeline restart. Only present when `schema_name` is configured. - `primary_key_columns`: JSON array of the table’s primary-key column names in key order. Only present when `schema_name` is configured and the table has a primary key. ## Permissions The connecting user needs `SELECT` on the source table, or on the statement’s tables in `query` mode. The user also needs read access to system views in these cases: - When `schema_name` is set, the input reads `SYS.TABLE_COLUMNS`, `SYS.INDEX_COLUMNS`, and `SYS.INDEXES` to build the `schema` and `primary_key_columns` metadata. - In the `timestamp` and `timestamp+incrementing` modes, the input reads `SYS.TABLE_COLUMNS` (or `SYS.VIEW_COLUMNS` for a view) to check the type of `timestamp_column` when it connects. Without access, the check is skipped and a warning is logged. - When `incrementing_initial_value` is set and no checkpoint exists yet, the input reads `SYS.TABLE_COLUMNS` (or `SYS.VIEW_COLUMNS` for a view) to bind the initial value with the type of `incrementing_column`. Without catalog rows, it test-binds the value against the column (as a number when it parses as one, then as the literal string) and fails to connect when neither binds. HANA lists catalog rows for the objects a user holds a privilege on, so `SELECT` on a table or view is enough for these reads. A view has no rows in `SYS.TABLE_COLUMNS` whatever the privileges, so it is read without `schema` and `primary_key_columns` metadata. For other objects the user cannot see in the catalog, grant `CATALOG READ`. ## Known limitations - Polling only: deleted rows are never seen, and `incrementing` mode never sees updates to existing rows. The timestamp modes see an update only when the application also updates `timestamp_column`. - Rows whose `incrementing_column` or `timestamp_column` is NULL are never emitted. - `timestamp_column` must be a TIMESTAMP, LONGDATE or SECONDDATE column. Change times stored as `DEC(15,0)` UTC timestamps or as separate date and time character columns, as in many SAP application tables, cannot drive the timestamp modes. - `schema` and `primary_key_columns` metadata come from `SYS.TABLE_COLUMNS`, which does not describe views or calculation views, so those are read without schema metadata. - `schema_registry_encode` derives Avro field names from column names. Column names that are not valid Avro names, such as SAP’s `/BIC/` namespaced columns, fail to encode; register the schema yourself and rename the columns in a `mapping` instead of using `schema_metadata`. Table names are sanitised automatically. - `bulk` and `query` have no position to resume from: an error part-way through a read restarts it from the first row, re-sending the rows already delivered. - `query` runs its statement once and then the input ends, like `bulk`, and attaches no metadata. Calculation views with input parameters can only be read this way. - The cursor stays open while downstream components apply backpressure. On a busy HANA system a long-open cursor holds back MVCC garbage collection, so index the `incrementing_column` or `timestamp_column` and avoid outputs that stall for long periods. The first poll of a polling mode without an initial value reads the whole table in key order; set `incrementing_initial_value` or `timestamp_initial_value` to skip history you do not need. Raise `fetch_size` (for example to 1000 to 5000) on high-latency links, together with `checkpoint_limit`. ## Troubleshooting **`checkpoint key …​ holds the position of …​` on connect.** Two `sap_hana` inputs share a `checkpoint_cache` and `checkpoint_cache_key`. Give each input its own `checkpoint_cache_key`. The error also appears when `schema_name` or `table` changed for an existing input: the stored position is for the old reference, so delete the key to start over or set `incrementing_initial_value`/`timestamp_initial_value` under a new key. **Cannot connect to SAP HANA Cloud.** HANA Cloud accepts TLS connections only, on port 443. go-hdb enables TLS when a TLS parameter is present, so add `TLSServerName=` to the DSN (and `TLSRootCAFile=` if the CA is not in the system trust store). **`schema` and `primary_key_columns` metadata are missing.** The input reads them from `SYS.TABLE_COLUMNS` and `SYS.INDEX_COLUMNS`; when that read fails it logs a warning and carries on without them. Views never have them. For a table, check the warning in the logs, grant the connecting user `SELECT` on the table (or `CATALOG READ`), and make sure `schema_name` is set. **"invalid table name" or "invalid column name" for a table that exists.** Identifiers in this configuration are quoted when sent to HANA, so they must match the catalog’s case exactly. HANA upper-cases identifiers that were created without quotes: a table created as `create table orders` is `ORDERS` in the catalog and must be configured as such. **Batches arrive one at a time.** `fetch_size` larger than `checkpoint_limit` means a batch cannot be handed on until the previous one is acknowledged (a warning is logged at startup). Raise `checkpoint_limit` or lower `fetch_size`. **Rows written around the time of a poll are missing in timestamp modes.** The poll window ends at the database clock minus `timestamp_delay`; a row whose timestamp was assigned before that bound but committed after the poll is never seen. Set `timestamp_delay` longer than your longest write transaction, and pick the `timestamp_clock` that matches how the column is populated. ### Common ```yml input: label: "" sap_hana: dsn: "" # No default (required) schema_name: "" # No default (optional) table: "" # No default (optional) mode: bulk query: "" # No default (optional) incrementing_column: "" # No default (optional) incrementing_initial_value: "" poll_interval: 60s timestamp_column: "" # No default (optional) timestamp_initial_value: "" timestamp_delay: 5s numeric_mapping: none checkpoint_cache: "" # No default (optional) auto_replay_nacks: true ``` ### Advanced ```yml input: label: "" sap_hana: dsn: "" # No default (required) fetch_size: 128 schema_name: "" # No default (optional) table: "" # No default (optional) mode: bulk query: "" # No default (optional) incrementing_column: "" # No default (optional) incrementing_initial_value: "" poll_interval: 60s timestamp_column: "" # No default (optional) timestamp_initial_value: "" timestamp_delay: 5s timestamp_clock: database numeric_mapping: none max_retries: 3 retry_backoff: 1s checkpoint_cache: "" # No default (optional) checkpoint_cache_key: sap_hana_hwm checkpoint_limit: 1024 auto_replay_nacks: true ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `checkpoint_cache` Name of a cache resource to persist the high-water mark across restarts. When set, the connector resumes from where it left off rather than starting from scratch. Only effective in `incrementing`, `timestamp`, and `timestamp+incrementing` modes. The cache must be declared under `cache_resources`. Choose a durable backend (`redpanda`, `redis`, PostgreSQL via `sql`) for production; `memory` and `lru` caches lose the position on every restart or redeploy, and the input then re-reads from the initial value. Without this field the position is also kept in memory only, and a warning is logged at startup. **Type**: `string` ```yaml # Examples: checkpoint_cache: redis_cache ``` ### `checkpoint_cache_key` Key used to store the checkpoint in `checkpoint_cache`. Every `sap_hana` input sharing a cache resource needs its own key: the stored checkpoint records its table, and an input refuses to start from another table’s checkpoint. **Type**: `string` **Default**: `sap_hana_hwm` ### `checkpoint_limit` The maximum number of messages that can be in flight (read but not yet acknowledged) at a given time. The high-water mark is only checkpointed once every message before it has been acknowledged, preserving at-least-once delivery even when batches are acknowledged out of order. When `fetch_size` exceeds this limit, batches are delivered one at a time (each waits for the previous batch’s acknowledgement), so raise this alongside large `fetch_size` values to keep batches flowing concurrently. **Type**: `int` **Default**: `1024` ### `dsn` SAP HANA connection DSN in `hdb://user:password@host:port[?param=value&…​]` form. URL-encode reserved characters in the user name and password (`#` as `%23`, `@` as `%40`, `%` as `%25`). Useful parameters: `databaseName` selects a tenant database when connecting through the system database port, `defaultSchema` sets the schema unqualified names resolve against, and `TLSServerName`, `TLSRootCAFile` and `TLSInsecureSkipVerify` configure TLS, which SAP HANA Cloud requires. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: dsn: hdb://user:password@host:39017 # --- dsn: hdb://user:password@host:30013?databaseName=HXE # --- dsn: hdb://user:password@.hana.prod-eu10.hanacloud.ondemand.com:443?TLSServerName=.hana.prod-eu10.hanacloud.ondemand.com ``` ### `fetch_size` Number of rows requested per FetchNext round-trip. Larger values reduce round-trips on high-latency connections. **Type**: `int` **Default**: `128` ### `incrementing_column` Column to use as the high-water mark for `incrementing` mode. Must be strictly monotonically increasing with no duplicate values. A BIGINT auto-increment column is ideal. Columns that produce duplicate values (for example, a plain TIMESTAMP) will cause rows whose value ties span a `fetch_size` boundary to be re-delivered. Use `timestamp+incrementing` mode to handle timestamp columns safely. **Type**: `string` ### `incrementing_initial_value` Initial high-water mark value. When empty, all existing rows are emitted on the first run. The value is converted to the ``incrementing_column’s type from the catalog on connect: integers for integer columns, RFC3339 or `YYYY-MM-DD[ HH:MM:SS]`` for DATE/TIMESTAMP columns (the column’s wall time, with no offset other than `Z` or `+00:00`), hexadecimal for BINARY/VARBINARY columns, and the literal string (leading zeros preserved) for character columns. A persisted checkpoint takes precedence over this value. **Type**: `string` **Default**: `""` ### `max_retries` Maximum number of times to retry a failed query before returning an error. Set to `0` to disable retries; negative values are rejected. **Type**: `int` **Default**: `3` ### `mode` Operation mode. **Type**: `string` **Default**: `bulk` **Options**: `bulk`, `incrementing`, `query`, `timestamp`, `timestamp+incrementing` ### `numeric_mapping` Controls how DECIMAL/NUMERIC columns are emitted: - `none`: emit as a canonical decimal string preserving full precision, except integer-typed columns (`DECIMAL(p,0)` with precision ⇐ 18) which are emitted as integers. - `best_fit`: additionally emit columns whose precision fits a double (precision ⇐ 15) as floating-point numbers; wider values fall back to canonical decimal strings. **Type**: `string` **Default**: `none` **Options**: `none`, `best_fit` ### `poll_interval` How long to wait between polls in `incrementing`, `timestamp`, and `timestamp+incrementing` modes. **Type**: `string` **Default**: `60s` ```yaml # Examples: poll_interval: 10s # --- poll_interval: 5m ``` ### `query` Custom SQL statement to execute. Only used when `mode` is `query`. **Type**: `string` ### `retry_backoff` Base delay between query retries. The delay grows linearly with the attempt number (attempt N waits N times this value). **Type**: `string` **Default**: `1s` ### `schema_name` Database schema for the table. When set, an Avro-compatible `schema` metadata field is attached to every message using data from `SYS.TABLE_COLUMNS`. **Type**: `string` ### `table` Table to read from. Required when `mode` is `bulk` or `incrementing`. **Type**: `string` ### `timestamp_clock` Which database clock bounds each timestamp-mode poll window. The bound is always read from HANA, never from the connector host, so it shares the clock and timezone convention of the column it is compared against: - `database`: `CURRENT_TIMESTAMP` (session timezone), matching columns populated by `DEFAULT CURRENT_TIMESTAMP` or `NOW()`. - `database_utc`: `CURRENT_UTCTIMESTAMP`, for columns populated with UTC values. **Type**: `string` **Default**: `database` **Options**: `database`, `database_utc` ### `timestamp_column` Column to use as the high-water mark for `timestamp` and `timestamp+incrementing` modes. Must be a TIMESTAMP or LONGDATE column. **Type**: `string` ### `timestamp_delay` Commit-lag buffer for timestamp modes. The upper bound for each poll is the database clock minus `timestamp_delay`, so rows whose timestamp was assigned slightly before a still-uncommitted transaction finished are not missed. Set it longer than your longest write transaction: a row whose transaction commits after the poll window covering its timestamp has closed is never emitted. Negative values are rejected. **Type**: `string` **Default**: `5s` ```yaml # Examples: timestamp_delay: 0s # --- timestamp_delay: 30s ``` ### `timestamp_initial_value` Initial high-water mark in RFC3339 format (for example, `2024-01-01T00:00:00Z`). When empty, all existing rows are emitted on the first run. `timestamp_column` has no timezone, so write its wall-clock value as-is, tagged with a `Z` or `+00:00` offset, rather than converting it. Any other offset is rejected when the configuration is parsed. **Type**: `string` **Default**: `""` ## Examples ### Incremental reads with a durable checkpoint Polls an orders table for new rows by primary key every 30 seconds and persists the high-water mark in a file cache so a restart resumes where it left off. ```yaml input: sap_hana: dsn: hdb://user:password@hana-host:39017 mode: incrementing schema_name: SALES table: ORDERS incrementing_column: ORDER_ID poll_interval: 30s checkpoint_cache: hana_checkpoints checkpoint_cache_key: sales_orders cache_resources: - label: hana_checkpoints file: directory: /var/lib/redpanda-connect/sap_hana ``` ### Change tracking by timestamp with automatic Avro schema registration Follows an updated-at column together with the primary key so rows sharing a timestamp are neither duplicated nor missed, bounds each poll by the database’s UTC clock with a commit-lag buffer, and registers the table’s schema from the emitted metadata before encoding. The checkpoint is kept in a Redpanda topic, which survives redeploys and needs no local disk (use a compacted topic). ```yaml input: sap_hana: dsn: hdb://user:password@hana-host:39017 mode: timestamp+incrementing schema_name: SALES table: ORDERS timestamp_column: UPDATED_AT incrementing_column: ORDER_ID timestamp_clock: database_utc timestamp_delay: 30s poll_interval: 10s checkpoint_cache: hana_checkpoints checkpoint_cache_key: sales_orders_changes pipeline: processors: - schema_registry_encode: url: http://schema-registry:8081 subject: sales.orders-value schema_metadata: schema format: avro avro: raw_json: true output: redpanda: seed_brokers: [ "broker:9092" ] topic: sales.orders cache_resources: - label: hana_checkpoints redpanda: seed_brokers: [ "broker:9092" ] topic: sap_hana_checkpoints ``` ### Run a custom query Runs a SQL statement once and emits one message per result row. In `query` mode, `table` and `schema_name` are not required and no metadata is attached. ```yaml input: sap_hana: dsn: hdb://user:password@hana-host:39017 mode: query query: | SELECT ORDER_ID, CUSTOMER_ID, STATUS FROM SALES.ORDERS WHERE STATUS = 'PENDING' ``` --- # Page 89: schema_registry **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/schema_registry.md --- # schema_registry Reads schemas from a schema registry. You can use this input to extract and back up schemas during a data migration. This input uses the [Franz Kafka Schema Registry client](https://github.com/twmb/franz-go/tree/master/pkg/sr). ## Metadata This input adds the following metadata fields to each message: - `schema_registry_subject` - `schema_registry_subject_compatibility_level` - `schema_registry_version` You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ### Common ```yml input: label: "" schema_registry: url: "" # No default (required) auto_replay_nacks: true ``` ### Advanced ```yml input: label: "" schema_registry: url: "" # No default (required) include_deleted: false subject_filter: "" fetch_in_order: true tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] auto_replay_nacks: true oauth: enabled: false consumer_key: "" consumer_secret: "" access_token: "" access_token_secret: "" basic_auth: enabled: false username: "" password: "" jwt: enabled: false private_key_file: "" signing_method: "" claims: {} headers: {} ``` ## Examples ### Read schemas Read all schemas (including deleted) from a Schema Registry instance which are associated with subjects matching the `^foo.*` filter. ```yaml input: schema_registry: url: http://localhost:8081 include_deleted: true subject_filter: ^foo.* ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `fetch_in_order` Indicate whether to fetch all schemas from the schema registry service and sort them by ID. Set this value to `true` if you use schemas that refer to other schemas (schema references). **Type**: `bool` **Default**: `true` ### `include_deleted` Include deleted entities. **Type**: `bool` **Default**: `false` ### `jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `subject_filter` Include only subjects which match the regular expression filter, or leave this field value blank to select all subjects. **Type**: `string` **Default**: `""` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The base URL of the schema registry service. **Type**: `string` --- # Page 90: sequence **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sequence.md --- # sequence Reads messages from a sequence of child inputs, starting with the first and once that input gracefully terminates starts consuming from the next, and so on. This input is useful for consuming from inputs that have an explicit end but must not be consumed in parallel. #### Common ```yml input: label: "" sequence: inputs: [] # No default (required) ``` #### Advanced ```yml input: label: "" sequence: sharded_join: type: none id_path: "" iterations: 1 merge_strategy: array inputs: [] # No default (required) ``` ## Examples ### End of Stream Message A common use case for sequence might be to generate a message at the end of our main input. With the following config once the records within `./dataset.csv` are exhausted our final payload `{"status":"finished"}` will be routed through the pipeline. ```yaml input: sequence: inputs: - file: paths: [ ./dataset.csv ] scanner: csv: {} - generate: count: 1 mapping: 'root = {"status":"finished"}' ``` ### Joining Data (Simple) Redpanda Connect can be used to join unordered data from fragmented datasets in memory by specifying a common identifier field and a number of sharded iterations. For example, given two CSV files, the first called "main.csv", which contains rows of user data: ```csv uuid,name,age AAA,Melanie,34 BBB,Emma,28 CCC,Geri,45 ``` And the second called "hobbies.csv" that, for each user, contains zero or more rows of hobbies: ```csv uuid,hobby CCC,pokemon go AAA,rowing AAA,golf ``` We can parse and join this data into a single dataset: ```json {"uuid":"AAA","name":"Melanie","age":34,"hobbies":["rowing","golf"]} {"uuid":"BBB","name":"Emma","age":28} {"uuid":"CCC","name":"Geri","age":45,"hobbies":["pokemon go"]} ``` With the following config: ```yaml input: sequence: sharded_join: type: full-outer id_path: uuid merge_strategy: array inputs: - file: paths: - ./hobbies.csv - ./main.csv scanner: csv: {} ``` ### Joining Data (Advanced) In this example we are able to join unordered and fragmented data from a combination of CSV files and newline-delimited JSON documents by specifying multiple sequence inputs with their own processors for extracting the structured data. The first file "main.csv" contains straight forward CSV data: ```csv uuid,name,age AAA,Melanie,34 BBB,Emma,28 CCC,Geri,45 ``` And the second file called "hobbies.ndjson" contains JSON documents, one per line, that associate an identifier with an array of hobbies. However, these data objects are in a nested format: ```json {"document":{"uuid":"CCC","hobbies":[{"type":"pokemon go"}]}} {"document":{"uuid":"AAA","hobbies":[{"type":"rowing"},{"type":"golf"}]}} ``` And so we will want to map these into a flattened structure before the join, and then we will end up with a single dataset that looks like this: ```json {"uuid":"AAA","name":"Melanie","age":34,"hobbies":["rowing","golf"]} {"uuid":"BBB","name":"Emma","age":28} {"uuid":"CCC","name":"Geri","age":45,"hobbies":["pokemon go"]} ``` With the following config: ```yaml input: sequence: sharded_join: type: full-outer id_path: uuid iterations: 10 merge_strategy: array inputs: - file: paths: [ ./main.csv ] scanner: csv: {} - file: paths: [ ./hobbies.ndjson ] scanner: lines: {} processors: - mapping: | root.uuid = this.document.uuid root.hobbies = this.document.hobbies.map_each(this.type) ``` ## Fields ### `inputs[]` An array of inputs to read from sequentially. **Type**: `array` ### `sharded_join` EXPERIMENTAL: Provides a way to perform outer joins of arbitrarily structured and unordered data resulting from the input sequence, even when the overall size of the data surpasses the memory available on the machine. When configured the sequence of inputs will be consumed one or more times according to the number of iterations, and when more than one iteration is specified each iteration will process an entirely different set of messages by sharding them by the ID field. Increasing the number of iterations reduces the memory consumption at the cost of needing to fully parse the data each time. Each message must be structured (JSON or otherwise processed into a structured form) and the fields will be aggregated with those of other messages sharing the ID. At the end of each iteration the joined messages are flushed downstream before the next iteration begins, hence keeping memory usage limited. **Type**: `object` ### `sharded_join.id_path` A [dot path](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/field_paths/) that points to a common field within messages of each fragmented data set and can be used to join them. Messages that are not structured or are missing this field will be dropped. This field must be set in order to enable joins. **Type**: `string` **Default**: `""` ### `sharded_join.iterations` The total number of iterations (shards), increasing this number will increase the overall time taken to process the data, but reduces the memory used in the process. The real memory usage required is significantly higher than the real size of the data and therefore the number of iterations should be at least an order of magnitude higher than the available memory divided by the overall size of the dataset. **Type**: `int` **Default**: `1` ### `sharded_join.merge_strategy` The chosen strategy to use when a data join would otherwise result in a collision of field values. The strategy `array` means non-array colliding values are placed into an array and colliding arrays are merged. The strategy `replace` replaces old values with new values. The strategy `keep` keeps the old value. **Type**: `string` **Default**: `array` **Options**: `array`, `replace`, `keep` ### `sharded_join.type` The type of join to perform. A `full-outer` ensures that all identifiers seen in any of the input sequences are sent, and is performed by consuming all input sequences before flushing the joined results. An `outer` join consumes all input sequences but only writes data joined from the last input in the sequence, similar to a left or right outer join. With an `outer` join if an identifier appears multiple times within the final sequence input it will be flushed each time it appears. `full-outter` and `outter` have been deprecated in favour of `full-outer` and `outer`. **Type**: `string` **Default**: `none` **Options**: `none`, `full-outer`, `outer`, `full-outter`, `outter` --- # Page 91: sftp **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sftp.md --- # sftp Consumes files from an SFTP server. ## Metadata This input adds the following metadata fields to each message: - `sftp_path` - `sftp_mod_time` You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ### Common ```yml input: label: "" sftp: address: "" # No default (required) credentials: username: "" password: "" host_public_key_file: "" # No default (optional) host_public_key: "" # No default (optional) private_key_file: "" # No default (optional) private_key: "" # No default (optional) private_key_pass: "" paths: [] # No default (required) auto_replay_nacks: true scanner: to_the_end: {} watcher: enabled: false minimum_age: 1s poll_interval: 1s cache: "" ``` ### Advanced ```yml input: label: "" sftp: address: "" # No default (required) connection_timeout: 30s credentials: username: "" password: "" host_public_key_file: "" # No default (optional) host_public_key: "" # No default (optional) private_key_file: "" # No default (optional) private_key: "" # No default (optional) private_key_pass: "" ssh_algorithms: additional_key_exchanges: [] # No default (optional) additional_ciphers: [] # No default (optional) additional_macs: [] # No default (optional) max_sftp_sessions: 10 paths: [] # No default (required) auto_replay_nacks: true scanner: to_the_end: {} delete_on_finish: false watcher: enabled: false minimum_age: 1s poll_interval: 1s cache: "" cache_mode: path ``` ## Fields ### `address` The address (hostname or IP address) of the SFTP server to connect to. **Type**: `string` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `connection_timeout` The connection timeout to use when connecting to the target server. **Type**: `string` **Default**: `30s` ### `credentials` The credentials required to log in to the SFTP server. This can include a username and password, or a private key for secure access. **Type**: `object` ### `credentials.host_public_key` The raw contents of the SFTP server’s public key, used for host key verification. **Type**: `string` ### `credentials.host_public_key_file` The path to the SFTP server’s public key file, used for host key verification. **Type**: `string` ### `credentials.password` The password to use for authentication. Used together with `username` for basic authentication or with encrypted private keys for secure access. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `credentials.private_key` The raw contents of the private key used to authenticate with the SFTP server. This field provides an alternative to `private_key_file`. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.private_key_file` The path to a private key file used to authenticate with the SFTP server. You can also provide a private key using the `private_key` field. **Type**: `string` ### `credentials.private_key_pass` An optional passphrase for decrypting the private key, if it is encrypted. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `credentials.ssh_algorithms` Additional SSH transport algorithms to permit for compatibility with legacy SFTP servers. Configured algorithms are appended to the default algorithms, which remain preferred, and when unset the defaults are used unchanged. Algorithms the underlying SSH library classifies as insecure weaken transport security and should only be enabled when required by a known server. These settings do not affect host key verification. **Type**: `object` ### `credentials.ssh_algorithms.additional_ciphers[]` Ciphers to permit in addition to the defaults, for example `aes128-cbc`. **Type**: `array` ### `credentials.ssh_algorithms.additional_key_exchanges[]` Key exchange algorithms to permit in addition to the defaults, for example `diffie-hellman-group1-sha1` or `diffie-hellman-group-exchange-sha1`. **Type**: `array` ### `credentials.ssh_algorithms.additional_macs[]` MAC algorithms to permit in addition to the defaults. **Type**: `array` ### `credentials.username` The username required to authenticate with the SFTP server. **Type**: `string` **Default**: `""` ### `delete_on_finish` Whether to delete files from the server once they are processed. **Type**: `bool` **Default**: `false` ### `max_sftp_sessions` The maximum number of SFTP sessions. **Type**: `int` **Default**: `10` ### `paths[]` A list of paths to consume sequentially. Glob patterns are supported. **Type**: `array` ### `scanner` The [scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/about/) used to split the stream of bytes into individual messages. Scanners are useful for processing large data sources efficiently without holding the entire data set in memory. For example, the `csv` scanner processes individual rows in a CSV file without loading the entire file in memory. **Type**: `scanner` **Default**: ```yaml to_the_end: {} ``` ### `watcher` An experimental mode whereby the input will periodically scan the target paths for new files and consume them, when all files are consumed the input will continue polling for new files. **Type**: `object` ### `watcher.cache` A [cache resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) for storing the paths of files already consumed. **Type**: `string` **Default**: `""` ### `watcher.cache_mode` Controls what the watcher stores in the cache for each consumed file. `path` records only the path, so a consumed file is never consumed again. `path_and_mod_time` also records the file’s modification time, and consumes a previously consumed file again if its modification time changes. Re-consumed files are emitted again in full, so downstream consumers may see duplicate data; the `sftp_mod_time` metadata field can be used to tell versions apart. SFTP reports modification times in whole seconds, so changes are only reliably detected when `minimum_age` is at least `1s`. When an existing cache is switched to `path_and_mod_time`, each entry written in `path` mode is overwritten in the cache with the file’s current modification time the next time the file is polled. Only the cache entry changes: the file is not read again, nothing is sent to the output, and the file on the SFTP server is not modified. With a topic-backed cache such as `redpanda`, this produces one new record per file to the cache topic, not to the pipeline’s output. This cannot be undone, so a file that was modified after it was last consumed but before the switch is never consumed again unless its cache entry is removed. Downgrading to a Redpanda Connect version without `cache_mode` while files are pending leaves those files unconsumed until their cache entries are removed. **Type**: `string` **Default**: `path` **Options**: `path`, `path_and_mod_time` ### `watcher.enabled` Whether file watching is enabled. **Type**: `bool` **Default**: `false` ### `watcher.minimum_age` The minimum period of time since a file was last updated before attempting to consume it. Increasing this period decreases the likelihood that a file will be consumed whilst it is still being written to. **Type**: `string` **Default**: `1s` ```yaml # Examples: minimum_age: 10s # --- minimum_age: 1m # --- minimum_age: 10m ``` ### `watcher.poll_interval` The interval between each attempt to scan the target paths for new files. **Type**: `string` **Default**: `1s` ```yaml # Examples: poll_interval: 100ms # --- poll_interval: 1s ``` --- # Page 92: slack_users **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/slack_users.md --- # slack_users Returns the full profile of all users in your Slack organization using the users.list API method. You can filter the returned users by team ID. This input reads users with the [`users.list`](https://api.slack.com/methods/users.list) Slack API method and emits each user profile as a separate message. To return only the users of one team, set `team_id`. Use it to join user details to Slack messages, or to load user data into a data lakehouse for joins with other data. ```yml input: label: "" slack_users: bot_token: "" # No default (required) team_id: "" auto_replay_nacks: true ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `bot_token` Your [Slack bot user’s OAuth token](https://api.slack.com/concepts/token-types), which must have the [`users:read` scope](https://api.slack.com/scopes/users:read) to access your Slack organization. **Type**: `string` ### `team_id` The encoded ID of a Slack team by which to filter the list of returned users, which you can get from the [`team.info` Slack API method](https://api.slack.com/methods/team.info). If `team_id` is left empty, users from all teams within the organization are returned. **Type**: `string` **Default**: `""` --- # Page 93: slack **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/slack.md --- # slack Connects to Slack using Socket Mode and receives events, interactions, and slash commands. This input connects to Slack using [Socket Mode](https://api.slack.com/apis/socket-mode). Use it to build bots that respond to Slack activity, or to stream Slack events into other systems, such as a data warehouse. ## Metadata This input adds the following metadata fields to each message: - `type`: The Socket Mode event type: `events_api`, `interactive`, or `slash_commands`. ```yml input: label: "" slack: app_token: "" # No default (required) bot_token: "" # No default (required) auto_replay_nacks: true ``` See also: [Examples](#examples) ## Fields ### `app_token` The app-level token, which starts with `xapp-`. The input uses it to open the Socket Mode connection, so it needs the [`connections:write` scope](https://api.slack.com/scopes/connections:write). **Type**: `string` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `bot_token` The OAuth token of your Slack bot user, which starts with `xoxb-`. **Type**: `string` ## Examples ### Echo Slackbot A slackbot that echo messages from other users ```yaml input: slack: app_token: "${APP_TOKEN:xapp-demo}" bot_token: "${BOT_TOKEN:xoxb-demo}" pipeline: processors: - mutation: | # ignore hidden or non message events if this.event.type != "message" || (this.event.hidden | false) { root = deleted() } # Don't respond to our own messages if this.authorizations.any(auth -> auth.user_id == this.event.user) { root = deleted() } output: slack_post: bot_token: "${BOT_TOKEN:xoxb-demo}" channel_id: "${!this.event.channel}" thread_ts: "${!this.event.ts}" text: "ECHO: ${!this.event.text}" ``` --- # Page 94: spicedb_watch **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/spicedb_watch.md --- # spicedb_watch Consume messages from the Watch API from SpiceDB. The SpiceDB input allows you to consume messages from the [Watch API](https://buf.build/authzed/api/docs/main:authzed.api.v1#authzed.api.v1.WatchService.Watch) of a [SpiceDB](https://authzed.com/docs/spicedb/getting-started/discovering-spicedb) instance. This input is useful for applications that need to react to changes in the data managed by SpiceDB in real-time. ## Credentials You need to provide the [endpoint](#endpoint) of your SpiceDB instance and a [bearer token](#bearer_token) for authentication. ## Cache You must provide a [cache resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) in the [`cache`](#cache) field. The input stores the [ZedToken](https://authzed.com/docs/spicedb/concepts/consistency#zedtokens) of the newest update consumed and acked in this cache in order to start reading from it each time the input is initialised. Ideally this cache should be persisted across restarts. ### Common ```yml input: label: "" spicedb_watch: endpoint: "" # No default (required) bearer_token: "" cache: "" # No default (required) ``` ### Advanced ```yml input: label: "" spicedb_watch: endpoint: "" # No default (required) bearer_token: "" max_receive_message_bytes: 4MB cache: "" # No default (required) cache_key: authzed.com/spicedb/watch/last_zed_token tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] ``` ## Configure a cache The following example uses a [`redis` cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/redis/). ```yml # Example input: label: "" spicedb_watch: endpoint: grpc.authzed.com:443 bearer_token: "" cache: "spicedb_cache" cache_resources: - label: "spicedb_cache" redis: url: redis://:6379 ``` To learn more about cache configuration, see the [Caches section](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/), which includes a range of cache components. ## Fields ### `bearer_token` The SpiceDB bearer token to use to authenticate with your SpiceDB instance. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: bearer_token: t_your_token_here_1234567deadbeef ``` ### `cache` The cache resource that stores the ZedToken (ID) of the last message the input processed. When the input starts, it resumes the watch from the stored ZedToken, so it backfills updates it hasn’t read yet. The input stores the ZedToken when each message is acknowledged, whether or not the message reached its outputs, so a message that fails isn’t read again after a restart. **Type**: `string` ### `cache_key` The key identifier to use when storing the ZedToken (ID) of the last message received. **Type**: `string` **Default**: `authzed.com/spicedb/watch/last_zed_token` ### `endpoint` The endpoint of your SpiceDB instance. **Type**: `string` ```yaml # Examples: endpoint: grpc.authzed.com:443 ``` ### `max_receive_message_bytes` The maximum message size (in bytes) this input can receive. If a message exceeds this limit, an `rpc error` is written to the Redpanda Connect logs. **Type**: `string` **Default**: `4MB` ```yaml # Examples: max_receive_message_bytes: 100MB # --- max_receive_message_bytes: 50mib ``` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ## Examples ### Store the ZedToken in Redis Consumes updates from the Watch API and stores the ZedToken of the last acknowledged update in a Redis cache, so that the input resumes from that point after a restart. ```yaml input: spicedb_watch: endpoint: grpc.authzed.com:443 bearer_token: "${SPICEDB_TOKEN}" tls: enabled: true cache: spicedb_cache cache_resources: - label: spicedb_cache redis: url: redis://localhost:6379 ``` --- # Page 95: splunk **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/splunk.md --- # splunk Consumes messages from Splunk. #### Common ```yml input: label: "" splunk: url: "" # No default (required) user: "" # No default (required) password: "" # No default (required) query: "" # No default (required) auto_replay_nacks: true ``` #### Advanced ```yml input: label: "" splunk: url: "" # No default (required) user: "" # No default (required) password: "" # No default (required) query: "" # No default (required) tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] auto_replay_nacks: true ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `password` Splunk account password. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `query` Splunk search query. **Type**: `string` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` Full HTTP Search API endpoint URL. **Type**: `string` ```yaml # Examples: url: https://foobar.splunkcloud.com/services/search/v2/jobs/export ``` ### `user` Splunk account user. **Type**: `string` --- # Page 96: sql_raw **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sql_raw.md --- # sql_raw Executes a select query and creates a message for each row received. Once the rows from the query are exhausted this input shuts down, allowing the pipeline to gracefully terminate (or the next input in a [sequence](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sequence/) to execute). #### Common ```yml input: label: "" sql_raw: driver: mysql # No default (required) dsn: "" # No default (required) query: "" # No default (required) args_mapping: "" # No default (optional) auto_replay_nacks: true ``` #### Advanced ```yml input: label: "" sql_raw: driver: mysql # No default (required) dsn: "" # No default (required) query: "" # No default (required) args_mapping: "" # No default (optional) auto_replay_nacks: true init_files: [] # No default (optional) init_statement: "" # No default (optional) conn_max_idle_time: "" # No default (optional) conn_max_life_time: "" # No default (optional) conn_max_idle: 2 conn_max_open: 0 # No default (optional) ``` When the rows from the query are exhausted, this input shuts down, allowing the pipeline to gracefully terminate or for the next input in a [sequence](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sequence/) to execute. ## Examples ### Consumes an SQL table using a query as an input. This example performs an aggregate query that counts the rows for each name in a table, including only rows that were last updated more than 3600 seconds ago. ```yaml input: sql_raw: driver: postgres dsn: postgres://foouser:foopass@localhost:5432/testdb?sslmode=disable query: "SELECT name, count(*) FROM person WHERE last_updated < $1 GROUP BY name;" args_mapping: | root = [ now().ts_unix() - 3600 ] ``` ## Fields ### `args_mapping` An optional [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that includes the same number of values in an array as the placeholder arguments in the `query` field. **Type**: `string` ```yaml # Examples: args_mapping: root = [ this.cat.meow, this.doc.woofs[0] ] # --- args_mapping: root = [ meta("user.id") ] ``` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `conn_max_idle` An optional maximum number of connections in the idle connection pool. If conn_max_open is greater than 0 but less than the new conn_max_idle, then the new conn_max_idle will be reduced to match the conn_max_open limit. If `value ⇐ 0`, no idle connections are retained. The default max idle connections is currently 2. This may change in a future release. **Type**: `int` **Default**: `2` ### `conn_max_idle_time` An optional maximum amount of time a connection may be idle. Expired connections may be closed lazily before reuse. If `value ⇐ 0`, connections are not closed due to a connections idle time. **Type**: `string` ### `conn_max_life_time` An optional maximum amount of time a connection may be reused. Expired connections may be closed lazily before reuse. If `value ⇐ 0`, connections are not closed due to a connections age. **Type**: `string` ### `conn_max_open` An optional maximum number of open connections to the database. If conn_max_idle is greater than 0 and the new conn_max_open is less than conn_max_idle, then conn_max_idle will be reduced to match the new conn_max_open limit. If `value ⇐ 0`, then there is no limit on the number of open connections. The default is 0 (unlimited). **Type**: `int` ### `driver` The database driver to use. **Type**: `string` **Options**: `mysql`, `postgres`, `pgx`, `clickhouse`, `mssql`, `sqlite`, `oracle`, `snowflake`, `trino`, `gocosmos`, `spanner`, `databricks`, `hana` ### `dsn` A Data Source Name to identify the target database. #### Drivers The following table lists the supported drivers and their DSN formats: | Driver | Data Source Name Format | | --- | --- | | `clickhouse` | [`clickhouse://[username[:password]@][netloc][:port]/dbname[?param1=value1&…​¶mN=valueN]`](https://github.com/ClickHouse/clickhouse-go#dsn) | | `mysql` | `[username[:password]@][protocol[(address)]]/dbname[?param1=value1&…​¶mN=valueN]` | | `postgres` and `pgx` | `postgres://[user[:password]@][netloc][:port][/dbname][?param1=value1&…​]` | | `mssql` | `sqlserver://[user[:password]@][netloc][:port][?database=dbname¶m1=value1&…​]` | | `sqlite` | `file:/path/to/filename.db[?param&=value1&…​]` | | `oracle` | `oracle://[username[:password]@][netloc][:port]/service_name?server=server2&server=server3` | | `snowflake` | `username[:password]@account_identifier/dbname/schemaname[?param1=value&…​¶mN=valueN]` | | `trino` | [`http[s]://user[:pass]@host[:port][?parameters]`](https://github.com/trinodb/trino-go-client#dsn-data-source-name) | | `gocosmos` | [`AccountEndpoint=;AccountKey=[;TimeoutMs=][;Version=][;DefaultDb/Db=][;AutoId=][;InsecureSkipVerify=]`](https://pkg.go.dev/github.com/microsoft/gocosmos#readme-example-usage) | | `spanner` | projects/\[PROJECT\]/instances/\[INSTANCE\]/databases/\[DATABASE\] | | `databricks` | `token:@:/` | | `hana` | `hdb://[user[:password]@]host[:port][?param1=value1&…​]` | Please note that the `postgres` and `pgx` drivers enforce SSL by default, you can override this with the parameter `sslmode=disable` if required. The `pgx` driver is an alternative to the standard `postgres` (pq) driver and comes with extra functionality such as support for array insertion. The `snowflake` driver supports multiple DSN formats. Please consult [the docs](https://pkg.go.dev/github.com/snowflakedb/gosnowflake/v2#hdr-Connection_String) for more details. For [key pair authentication](https://docs.snowflake.com/en/user-guide/key-pair-auth.html#configuring-key-pair-authentication), the DSN has the following format: `@//?warehouse=&role=&authenticator=snowflake_jwt&privateKey=`, where the value for the `privateKey` parameter can be constructed from an unencrypted RSA private key file `rsa_key.p8` using `openssl enc -d -base64 -in rsa_key.p8 | basenc --base64url -w0` (you can use `gbasenc` instead of `basenc` on OSX if you install `coreutils` via Homebrew). If you have a password-encrypted private key, you can decrypt it using `openssl pkcs8 -in rsa_key_encrypted.p8 -out rsa_key.p8`. Also, make sure fields such as the username are URL-encoded. The [`gocosmos`](https://pkg.go.dev/github.com/microsoft/gocosmos) driver is still experimental, but it has support for [hierarchical partition keys](https://learn.microsoft.com/en-us/azure/cosmos-db/hierarchical-partition-keys) as well as [cross-partition queries](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-query-container#cross-partition-query). Please refer to the [SQL notes](https://github.com/microsoft/gocosmos/blob/main/SQL.md) for details. **Type**: `string` ```yaml # Examples: dsn: clickhouse://username:password@host1:9000,host2:9000/database?dial_timeout=200ms&max_execution_time=60 # --- dsn: foouser:foopassword@tcp(localhost:3306)/foodb # --- dsn: postgres://foouser:foopass@localhost:5432/foodb?sslmode=disable # --- dsn: oracle://foouser:foopass@localhost:1521/service_name # --- dsn: token:dapi1234567890ab@dbc-a1b2345c-d6e7.cloud.databricks.com:443/sql/1.0/warehouses/abc123def456 ``` ### `init_files[]` An optional list of file paths containing SQL statements to execute immediately upon the first connection to the target database. This is a useful way to initialise tables before processing data. Glob patterns are supported, including super globs (double star). Care should be taken to ensure that the statements are idempotent, and therefore would not cause issues when run multiple times after service restarts. If both `init_statement` and `init_files` are specified the `init_statement` is executed _after_ the `init_files`. If a statement fails for any reason a warning log will be emitted but the operation of this component will not be stopped. **Type**: `array` ```yaml # Examples: init_files: - ./init/*.sql # --- init_files: - ./foo.sql - ./bar.sql ``` ### `init_statement` An optional SQL statement to execute immediately upon the first connection to the target database. This is a useful way to initialise tables before processing data. Care should be taken to ensure that the statement is idempotent, and therefore would not cause issues when run multiple times after service restarts. If both `init_statement` and `init_files` are specified the `init_statement` is executed _after_ the `init_files`. If the statement fails for any reason a warning log will be emitted but the operation of this component will not be stopped. **Type**: `string` ```yaml # Examples: init_statement: | CREATE TABLE IF NOT EXISTS some_table ( foo varchar(50) not null, bar integer, baz varchar(50), primary key (foo) ) WITHOUT ROWID; ``` ### `query` The query to execute. You must include the correct placeholders for the specified database driver. Some drivers use question marks (`?`), whereas others expect incrementing dollar signs (`$1`, `$2`, and so on) or colons (`:1`, `:2`, and so on). The following table shows the placeholder style for each driver: | Driver | Placeholder style | | --- | --- | | `clickhouse` | Dollar sign (`$`) | | `gocosmos` | Colon (`:`) | | `hana` | Question mark (`?`) | | `mssql` | Question mark (`?`) | | `mysql` | Question mark (`?`) | | `oracle` | Colon (`:`) | | `pgx` | Dollar sign (`$`) | | `postgres` | Dollar sign (`$`) | | `snowflake` | Question mark (`?`) | | `spanner` | Question mark (`?`) | | `sqlite` | Question mark (`?`) | | `trino` | Question mark (`?`) | **Type**: `string` ```yaml # Examples: query: SELECT * FROM footable WHERE user_id = $1; ``` --- # Page 97: sql_select **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sql_select.md --- # sql_select Executes a select query and creates a message for each row received. Once the rows from the query are exhausted this input shuts down, allowing the pipeline to gracefully terminate (or the next input in a [sequence](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sequence/) to execute). #### Common ```yml input: label: "" sql_select: driver: mysql # No default (required) dsn: "" # No default (required) table: "" # No default (required) columns: [] # No default (required) where: "" # No default (optional) args_mapping: "" # No default (optional) auto_replay_nacks: true ``` #### Advanced ```yml input: label: "" sql_select: driver: mysql # No default (required) dsn: "" # No default (required) table: "" # No default (required) columns: [] # No default (required) where: "" # No default (optional) args_mapping: "" # No default (optional) prefix: "" # No default (optional) suffix: "" # No default (optional) auto_replay_nacks: true init_files: [] # No default (optional) init_statement: "" # No default (optional) conn_max_idle_time: "" # No default (optional) conn_max_life_time: "" # No default (optional) conn_max_idle: 2 conn_max_open: 0 # No default (optional) ``` ## Examples ### Consume a Table (PostgreSQL) Here we define a pipeline that will consume all rows from a table created within the last hour by comparing the unix timestamp stored in the row column `created_at`: ```yaml input: sql_select: driver: postgres dsn: postgres://foouser:foopass@localhost:5432/testdb?sslmode=disable table: footable columns: [ '*' ] where: created_at >= ? args_mapping: | root = [ now().ts_unix() - 3600 ] ``` ## Fields ### `args_mapping` An optional [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that evaluates to an array of values, one for each placeholder in the `where` field, in order. The values are passed to the driver as query arguments. **Type**: `string` ```yaml # Examples: args_mapping: root = [ "article", now().ts_format("2006-01-02") ] ``` ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `columns[]` A list of columns to select. **Type**: `array` ```yaml # Examples: columns: - "*" # --- columns: - foo - bar - baz ``` ### `conn_max_idle` An optional maximum number of connections in the idle connection pool. If conn_max_open is greater than 0 but less than the new conn_max_idle, then the new conn_max_idle will be reduced to match the conn_max_open limit. If `value ⇐ 0`, no idle connections are retained. The default max idle connections is currently 2. This may change in a future release. **Type**: `int` **Default**: `2` ### `conn_max_idle_time` An optional maximum amount of time a connection may be idle. Expired connections may be closed lazily before reuse. If `value ⇐ 0`, connections are not closed due to a connections idle time. **Type**: `string` ### `conn_max_life_time` An optional maximum amount of time a connection may be reused. Expired connections may be closed lazily before reuse. If `value ⇐ 0`, connections are not closed due to a connections age. **Type**: `string` ### `conn_max_open` An optional maximum number of open connections to the database. If conn_max_idle is greater than 0 and the new conn_max_open is less than conn_max_idle, then conn_max_idle will be reduced to match the new conn_max_open limit. If `value ⇐ 0`, then there is no limit on the number of open connections. The default is 0 (unlimited). **Type**: `int` ### `driver` The database driver to use. **Type**: `string` **Options**: `mysql`, `postgres`, `pgx`, `clickhouse`, `mssql`, `sqlite`, `oracle`, `snowflake`, `trino`, `gocosmos`, `spanner`, `databricks`, `hana` ### `dsn` A Data Source Name to identify the target database. #### Drivers The following table lists the supported drivers and their DSN formats: | Driver | Data Source Name Format | | --- | --- | | `clickhouse` | [`clickhouse://[username[:password]@][netloc][:port]/dbname[?param1=value1&…​¶mN=valueN]`](https://github.com/ClickHouse/clickhouse-go#dsn) | | `mysql` | `[username[:password]@][protocol[(address)]]/dbname[?param1=value1&…​¶mN=valueN]` | | `postgres` and `pgx` | `postgres://[user[:password]@][netloc][:port][/dbname][?param1=value1&…​]` | | `mssql` | `sqlserver://[user[:password]@][netloc][:port][?database=dbname¶m1=value1&…​]` | | `sqlite` | `file:/path/to/filename.db[?param&=value1&…​]` | | `oracle` | `oracle://[username[:password]@][netloc][:port]/service_name?server=server2&server=server3` | | `snowflake` | `username[:password]@account_identifier/dbname/schemaname[?param1=value&…​¶mN=valueN]` | | `trino` | [`http[s]://user[:pass]@host[:port][?parameters]`](https://github.com/trinodb/trino-go-client#dsn-data-source-name) | | `gocosmos` | [`AccountEndpoint=;AccountKey=[;TimeoutMs=][;Version=][;DefaultDb/Db=][;AutoId=][;InsecureSkipVerify=]`](https://pkg.go.dev/github.com/microsoft/gocosmos#readme-example-usage) | | `spanner` | projects/\[PROJECT\]/instances/\[INSTANCE\]/databases/\[DATABASE\] | | `databricks` | `token:@:/` | | `hana` | `hdb://[user[:password]@]host[:port][?param1=value1&…​]` | Please note that the `postgres` and `pgx` drivers enforce SSL by default, you can override this with the parameter `sslmode=disable` if required. The `pgx` driver is an alternative to the standard `postgres` (pq) driver and comes with extra functionality such as support for array insertion. The `snowflake` driver supports multiple DSN formats. Please consult [the docs](https://pkg.go.dev/github.com/snowflakedb/gosnowflake/v2#hdr-Connection_String) for more details. For [key pair authentication](https://docs.snowflake.com/en/user-guide/key-pair-auth.html#configuring-key-pair-authentication), the DSN has the following format: `@//?warehouse=&role=&authenticator=snowflake_jwt&privateKey=`, where the value for the `privateKey` parameter can be constructed from an unencrypted RSA private key file `rsa_key.p8` using `openssl enc -d -base64 -in rsa_key.p8 | basenc --base64url -w0` (you can use `gbasenc` instead of `basenc` on OSX if you install `coreutils` via Homebrew). If you have a password-encrypted private key, you can decrypt it using `openssl pkcs8 -in rsa_key_encrypted.p8 -out rsa_key.p8`. Also, make sure fields such as the username are URL-encoded. The [`gocosmos`](https://pkg.go.dev/github.com/microsoft/gocosmos) driver is still experimental, but it has support for [hierarchical partition keys](https://learn.microsoft.com/en-us/azure/cosmos-db/hierarchical-partition-keys) as well as [cross-partition queries](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-query-container#cross-partition-query). Please refer to the [SQL notes](https://github.com/microsoft/gocosmos/blob/main/SQL.md) for details. **Type**: `string` ```yaml # Examples: dsn: clickhouse://username:password@host1:9000,host2:9000/database?dial_timeout=200ms&max_execution_time=60 # --- dsn: foouser:foopassword@tcp(localhost:3306)/foodb # --- dsn: postgres://foouser:foopass@localhost:5432/foodb?sslmode=disable # --- dsn: oracle://foouser:foopass@localhost:1521/service_name # --- dsn: token:dapi1234567890ab@dbc-a1b2345c-d6e7.cloud.databricks.com:443/sql/1.0/warehouses/abc123def456 ``` ### `init_files[]` An optional list of file paths containing SQL statements to execute immediately upon the first connection to the target database. This is a useful way to initialise tables before processing data. Glob patterns are supported, including super globs (double star). Care should be taken to ensure that the statements are idempotent, and therefore would not cause issues when run multiple times after service restarts. If both `init_statement` and `init_files` are specified the `init_statement` is executed _after_ the `init_files`. If a statement fails for any reason a warning log will be emitted but the operation of this component will not be stopped. **Type**: `array` ```yaml # Examples: init_files: - ./init/*.sql # --- init_files: - ./foo.sql - ./bar.sql ``` ### `init_statement` An optional SQL statement to execute immediately upon the first connection to the target database. This is a useful way to initialise tables before processing data. Care should be taken to ensure that the statement is idempotent, and therefore would not cause issues when run multiple times after service restarts. If both `init_statement` and `init_files` are specified the `init_statement` is executed _after_ the `init_files`. If the statement fails for any reason a warning log will be emitted but the operation of this component will not be stopped. **Type**: `string` ```yaml # Examples: init_statement: | CREATE TABLE IF NOT EXISTS some_table ( foo varchar(50) not null, bar integer, baz varchar(50), primary key (foo) ) WITHOUT ROWID; ``` ### `prefix` Optional SQL text to add before the `SELECT` keyword, such as a `WITH` clause. **Type**: `string` ### `suffix` Optional SQL text to append after the generated `SELECT` statement, such as an `ORDER BY`, `LIMIT`, or locking clause. **Type**: `string` ### `table` The table to select from. **Type**: `string` ```yaml # Examples: table: foo ``` ### `where` An optional where clause to add. Placeholder arguments are populated with the `args_mapping` field. Always use question marks for placeholders. They are converted to dollar syntax (`$1`) when the `postgres`, `pgx`, or `clickhouse` driver is used, and to colon syntax (`:1`) when the `oracle` or `gocosmos` driver is used. **Type**: `string` ```yaml # Examples: where: type = ? and created_at > ? # --- where: user_id = ? ``` --- # Page 98: timeplus **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/timeplus.md --- # timeplus Executes a query on Timeplus Enterprise and creates a message from each row received. This input can execute a query on [Timeplus Enterprise](https://docs.timeplus.com/) Cloud, Timeplus Enterprise (self-hosted) or Timeplusd. A structured message will be created from each row received. If it is a streaming query, this input will keep running until the query is terminated. If it is a table query, this input will shut down once the rows from the query are exhausted. ```yml input: label: "" timeplus: query: "" # No default (required) url: tcp://localhost:8463 workspace: "" # No default (optional) apikey: "" # No default (optional) username: "" # No default (optional) password: "" # No default (optional) ``` ## Examples ### From Timeplus Enterprise Cloud via HTTP Create an API key in the Timeplus Enterprise Cloud web console, then set it in the `apikey` field. ```yaml input: timeplus: url: https://us-west-2.timeplus.cloud workspace: my_workspace_id query: select * from iot apikey: ``` ### From Timeplus Enterprise (self-hosted) via HTTP For self-hosted Timeplus Enterprise, specify the username and password as well as the URL of the app server. ```yaml input: timeplus: url: http://localhost:8000 workspace: my_workspace_id query: select * from iot username: username password: pw ``` ### From Timeplus Enterprise (self-hosted) via TCP Make sure the scheme of the `url` is `tcp`. ```yaml input: timeplus: url: tcp://localhost:8463 query: select * from iot username: timeplus password: timeplus ``` ## Fields ### `apikey` The API key for the Timeplus Enterprise REST API. You need to generate the key in the web console of Timeplus Enterprise (Cloud). This field is required if you are reading messages from Timeplus Enterprise (Cloud). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `password` The password for the Timeplus application server. This field is required if you are reading messages from Timeplus Enterprise (Self-Hosted) or `timeplusd`. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `query` The query to execute on Timeplus Enterprise (Cloud or Self-Hosted) or `timeplusd`. **Type**: `string` ```yaml # Examples: query: select * from iot # --- query: select count(*) from table(iot) ``` ### `url` The URL of your Timeplus instance, which should always include the schema and host. **Type**: `string` **Default**: `tcp://localhost:8463` ### `username` The username for the Timeplus application server. This field is required if you are reading messages from Timeplus Enterprise (Self-Hosted) or `timeplusd`. **Type**: `string` ### `workspace` The ID of the workspace you want to read messages from. This field is required if you are connecting to Timeplus Enterprise (Cloud or Self-Hosted) using HTTP. **Type**: `string` --- # Page 99: websocket **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/websocket.md --- # websocket Connects to a websocket server and continuously receives messages. It is possible to configure an `open_message`, which when set to a non-empty string will be sent to the websocket server each time a connection is first established. #### Common ```yml input: label: "" websocket: url: "" # No default (required) auto_replay_nacks: true ``` #### Advanced ```yml input: label: "" websocket: url: "" # No default (required) proxy_url: "" # No default (optional) open_message: "" # No default (optional) open_message_type: binary max_message_size: 33554432 auto_replay_nacks: true tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] connection: max_retries: 0 # No default (optional) oauth: enabled: false consumer_key: "" consumer_secret: "" access_token: "" access_token_secret: "" basic_auth: enabled: false username: "" password: "" jwt: enabled: false private_key_file: "" signing_method: "" claims: {} headers: {} ``` ## Fields ### `auto_replay_nacks` Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure. Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation. **Type**: `bool` **Default**: `true` ### `basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `connection` Customise how websocket connection attempts are made. **Type**: `object` ### `connection.max_retries` An optional limit to the number of consecutive retry attempts that will be made before abandoning the connection altogether and gracefully terminating the input. When all inputs terminate in this way the service (or stream) will shut down. If set to zero connections will never be reattempted upon a failure. If set below zero this field is ignored (effectively unset). **Type**: `int` ```yaml # Examples: max_retries: -1 # --- max_retries: 10 ``` ### `jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `max_message_size` A maximum size in bytes for individual messages received from the server. When a message exceeding this limit is received the connection is closed with a 1009 (message too big) status and the input reconnects. A value of 0 disables the limit, which allows the server to make this process allocate an unbounded amount of memory and is therefore not recommended. **Type**: `int` **Default**: `33554432` ### `oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `open_message` An optional message to send to the server upon connection. **Type**: `string` ### `open_message_type` An optional flag to indicate the data type of open_message. **Type**: `string` **Default**: `binary` | Option | Summary | | --- | --- | | `binary` | Binary data open_message. | | `text` | Text data open_message. The text message payload is interpreted as UTF-8 encoded text data. | ### `proxy_url` An optional HTTP proxy URL. **Type**: `string` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL to connect to. **Type**: `string` ```yaml # Examples: url: ws://localhost:4195/get/ws ``` --- # Page 100: Logger **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/logger/about.md --- # Logger Redpanda Connect logging prints to stdout (or stderr if your output is stdout) and is formatted as [logfmt](https://brandur.org/logfmt) by default. Use these configuration options to change both the logging formats as well as the destination of logs. #### Common ```yml logger: level: INFO format: logfmt add_timestamp: true static_fields: "@service": "redpanda-connect" ``` #### Advanced ```yml logger: level: INFO format: logfmt add_timestamp: true level_name: level timestamp_name: time message_name: msg static_fields: "@service": "redpanda-connect" file: path: "" rotate: false rotate_max_age_days: 0 ``` ## Fields ### `add_timestamp` Whether to include timestamps in logs. **Type**: `bool` **Default**: `true` ### `file` Experimental: Specify fields for optionally writing logs to a file. **Type**: `object` ### `file.path` The file path to write logs to, if the file does not exist it will be created. Leave this field empty or unset to disable file based logging. **Type**: `string` **Default**: `""` ### `file.rotate` Whether to rotate log files automatically. **Type**: `bool` **Default**: `false` ### `file.rotate_max_age_days` The maximum number of days to retain old log files based on the timestamp encoded in their filename, after which they are deleted. Setting to zero disables this mechanism. **Type**: `int` **Default**: `0` ### `format` Set the format of emitted logs. **Type**: `string` **Default**: `logfmt` **Options**: `json`, `logfmt` ### `level` Set the minimum severity level for emitting logs. **Type**: `string` **Default**: `INFO` **Options**: `OFF`, `FATAL`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`, `ALL`, `NONE` ### `level_name` The name of the level field added to logs when the `format` is `json`. **Type**: `string` **Default**: `level` ### `message_name` The name of the message field added to logs when the `format` is `json`. **Type**: `string` **Default**: `msg` ### `static_fields` A map of key/value pairs to add to each structured log. **Type**: `object` **Default**: ```yaml "@service": "redpanda-connect" ``` ### `timestamp_name` The name of the timestamp field added to logs when `add_timestamp` is set to `true` and the `format` is `json`. **Type**: `string` **Default**: `time` --- # Page 101: Metrics **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/about.md --- # Metrics Redpanda Connect emits lots of metrics in order to expose how components configured within your pipeline are behaving. You can configure exactly where these metrics end up with the config field `metrics`, which describes a metrics format and destination. For example, if you wished to push them via the StatsD protocol you could use this configuration: ```yaml metrics: statsd: address: localhost:8125 flush_period: 100ms ``` Redpanda Connect automatically [exports detailed metrics](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/monitor-connect/) for each component of your data pipeline to a Prometheus endpoint. ## Timings It’s worth noting that timing metrics within Redpanda Connect are measured in nanoseconds and are therefore named with a `_ns` suffix. However, some exporters do not support this level of precision and are downgraded, or have the unit converted for convenience. In these cases the exporter documentation outlines the conversion and why it is made. ## Metric names Each major Redpanda Connect component type emits one or more metrics with the name prefixed by the type. These metrics are intended to provide an overview of behavior, performance and health. Some specific component implementations may provide their own unique metrics on top of these standardized ones, these extra metrics can be found listed on their respective documentation pages. ## Inputs - `input_received`: A count of the number of messages received by the input. - `input_latency_ns`: Measures the roundtrip latency in nanoseconds from the point at which a message is read up to the moment the message has either been acknowledged by an output, has been stored within a buffer, or has been rejected (nacked). - `batch_created`: A count of each time an input-level batch has been created using a batching policy. Includes a label `mechanism` describing the particular mechanism that triggered it, one of; `count`, `size`, `period`, `check`. - `input_connection_up`: For continuous stream based inputs represents a count of the number of the times the input has successfully established a connection to the target source. For poll based inputs that do not retain an active connection this value will increment once. - `input_connection_failed`: For continuous stream based inputs represents a count of the number of times the input has failed to establish a connection to the target source. - `input_connection_lost`: For continuous stream based inputs represents a count of the number of times the input has lost a previously established connection to the target source. > ⚠️ **CAUTION** > > The behavior of connection metrics may differ based on input type due to certain libraries and protocols obfuscating the concept of a single connection. ### Buffers - `buffer_received`: A count of the number of messages written to the buffer. - `buffer_batch_received`: A count of the number of message batches written to the buffer. - `buffer_sent`: A count of the number of messages read from the buffer. - `buffer_batch_sent`: A count of the number of message batches read from the buffer. - `buffer_latency_ns`: Measures the roundtrip latency in nanoseconds from the point at which a message is read from the buffer up to the moment it has been acknowledged by the output. - `batch_created`: A count of each time a buffer-level batch has been created using a batching policy. Includes a label `mechanism` describing the particular mechanism that triggered it, one of; `count`, `size`, `period`, `check`. ### Processors - `processor_received`: A count of the number of messages the processor has been executed upon. - `processor_batch_received`: A count of the number of message batches the processor has been executed upon. - `processor_sent`: A count of the number of messages the processor has returned. - `processor_batch_sent`: A count of the number of message batches the processor has returned. - `processor_error`: A count of the number of times the processor has errored. In cases where an error is batch-wide the count is incremented by one, and therefore would not match the number of messages. - `processor_latency_ns`: Latency of message processing in nanoseconds. When a processor acts upon a batch of messages this latency measures the time taken to process all messages of the batch. ### Outputs - `output_sent`: A count of the number of messages sent by the output. - `output_batch_sent`: A count of the number of message batches sent by the output. - `output_error`: A count of the number of send attempts that have failed. On failed batched sends this count is incremented once only. - `output_latency_ns`: Latency of writes in nanoseconds. This metric may not be populated by outputs that are pull-based such as the `http_server`. - `batch_created`: A count of each time an output-level batch has been created using a batching policy. Includes a label `mechanism` describing the particular mechanism that triggered it, one of; `count`, `size`, `period`, `check`. - `output_connection_up`: For continuous stream based outputs represents a count of the number of the times the output has successfully established a connection to the target sink. For poll based outputs that do not retain an active connection this value will increment once. - `output_connection_failed`: For continuous stream based outputs represents a count of the number of times the output has failed to establish a connection to the target sink. - `output_connection_lost`: For continuous stream based outputs represents a count of the number of times the output has lost a previously established connection to the target sink. > ⚠️ **CAUTION** > > The behavior of connection metrics may differ based on output type due to certain libraries and protocols obfuscating the concept of a single connection. ### Caches All cache metrics have a label `operation` denoting the operation that triggered the metric series, one of; `add`, `get`, `set` or `delete`. - `cache_success`: A count of the number of successful cache operations. - `cache_error`: A count of the number of cache operations that resulted in an error. - `cache_latency_ns`: Latency of operations in nanoseconds. - `cache_not_found`: A count of the number of get operations that yielded no value due to the item not being found. This count is separate from `cache_error`. - `cache_duplicate`: A count of the number of add operations that were aborted due to the key already existing. This count is separate from `cache_error`. ### Rate limits - `rate_limit_checked`: A count of the number of times the rate limit has been probed. - `rate_limit_triggered`: A count of the number of times the rate limit has been triggered by a probe. - `rate_limit_error`: A count of the number of times the rate limit has errored when probed. ## Metric labels The standard metric names are unique to the component type, but a benthos config may consist of any number of component instantiations. In order to provide a metrics series that is unique for each instantiation Redpanda Connect adds labels (or tags) that uniquely identify the instantiation. These labels are as follows: ### `path` The `path` label contains a string representation of the position of a component instantiation within a config in a format that would locate it within a Bloblang mapping, beginning at `root`. This path is a best attempt and may not exactly represent the source component position in all cases and is intended to be used for assisting observability only. This is the highest cardinality label since paths will change as configs are updated and expanded. It is therefore worth removing this label with a [mapping](#metric-mapping) in cases where you wish to restrict the number of unique metric series. ### `label` The `label` label contains the unique label configured for a component emitting the metric series, or is empty for components that do not have a configured label. This is the most useful label for uniquely identifying a series for a component. ### `stream` The `stream` label is present in a metric series emitted from a stream config executed when Redpanda Connect is running in streams mode, and is populated with the stream name. ## Example The following Redpanda Connect configuration: ```yaml input: label: foo http_server: {} pipeline: processors: - mapping: | root.message = this root.meta.link_count = this.links.length() root.user.age = this.user.age.number() output: label: bar stdout: {} metrics: prometheus: {} ``` Would produce the following metrics series: ```text input_latency_ns{label="foo",path="root.input"} input_received{endpoint="post",label="foo",path="root.input"} input_received{endpoint="websocket",label="foo",path="root.input"} processor_batch_received{label="",path="root.pipeline.processors.0"} processor_batch_sent{label="",path="root.pipeline.processors.0"} processor_error{label="",path="root.pipeline.processors.0"} processor_latency_ns{label="",path="root.pipeline.processors.0"} processor_received{label="",path="root.pipeline.processors.0"} processor_sent{label="",path="root.pipeline.processors.0"} output_batch_sent{label="bar",path="root.output"} output_connection_failed{label="bar",path="root.output"} output_connection_lost{label="bar",path="root.output"} output_connection_up{label="bar",path="root.output"} output_error{label="bar",path="root.output"} output_latency_ns{label="bar",path="root.output"} output_sent{label="bar",path="root.output"} ``` ## Metric mapping Since Redpanda Connect emits a large variety of metrics it is often useful to restrict or modify the metrics that are emitted. This can be done using the [Bloblang mapping language](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) in the field `metrics.mapping`. This is a mapping executed for each metric that is registered within the Redpanda Connect service and allows you to delete an entire series, modify the series name and delete or modify individual labels. Within the mapping the input document (referenced by the keyword `this`) is a string value containing the metric name, and the resulting document (referenced by the keyword `root`) must be a string value containing the resulting name. As is standard in Bloblang mappings, if the value of `root` is not assigned within the mapping then the metric name remains unchanged. If the value of `root` is `deleted()` then the metric series is dropped. Labels can be referenced as metadata values with the function `meta`, where if the label does not exist in the series being mapped the value `null` is returned. Labels can be changed by using meta assignments, and can be assigned `deleted()` in order to remove them. For example, the following mapping removes all but the `label` label entirely, which reduces the cardinality of each series. It also renames the `label` (for some reason) so that labels containing meows now contain woofs. Finally, the mapping restricts the metrics emitted to only three series; one for the input count, one for processor errors, and one for the output count, it does this by looking up metric names in a static array of allowed names, and if not present the `root` is assigned `deleted()`: ```yaml metrics: mapping: | # Delete all pre-existing labels meta = deleted() # Re-add the `label` label with meows replaced with woofs meta label = meta("label").replace("meow", "woof") # Delete all metric series that aren't in our list root = if ![ "input_received", "processor_error", "output_sent", ].contains(this) { deleted() } prometheus: use_histogram_timing: false ``` --- # Page 102: none **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/none.md --- # none Disable metrics entirely. ## Common ```yml metrics: none: {} ``` ## Advanced ```yml metrics: none: {} ``` --- # Page 103: open_telemetry_collector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/open_telemetry_collector.md --- # open_telemetry_collector Sends metrics to one or more OpenTelemetry Collector endpoints. Exports Redpanda Connect metrics to one or more [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) endpoints, encoded with the OpenTelemetry metrics protocol (OTLP). Any collector endpoint that supports OTLP can receive them. You can configure HTTP and gRPC endpoints at the same time. Every configured endpoint receives the same metrics, which is useful for redundancy or for sending metrics to several observability platforms. ### Common ```yml metrics: open_telemetry_collector: service: benthos http: [] # No default (required) grpc: [] # No default (required) ``` ### Advanced ```yml metrics: open_telemetry_collector: service: benthos http: [] # No default (required) grpc: [] # No default (required) tags: {} ``` ## Fields ### `grpc[]` A list of grpc collectors. **Type**: `array` ### `grpc[].address` The endpoint of a collector to send events to. **Type**: `string` ```yaml # Examples: address: localhost:4317 ``` ### `grpc[].secure` Connect to the collector with client transport security **Type**: `bool` **Default**: `false` ### `http[]` A list of http collectors. **Type**: `array` ### `http[].address` The endpoint of a collector to send events to. **Type**: `string` ```yaml # Examples: address: localhost:4318 ``` ### `http[].secure` Connect to the collector over HTTPS **Type**: `bool` **Default**: `false` ### `service` The name of the service in metrics. **Type**: `string` **Default**: `benthos` ### `tags` A map of tags to add to all exported spans and metrics. **Type**: `object` **Default**: `{}` ## Usage The most common setup uses a local OpenTelemetry Collector running as a sidecar or daemon, which then forwards metrics to your observability backend: ```yaml metrics: open_telemetry_collector: service: my-service-name grpc: - address: localhost:4317 ``` For production deployments with remote collectors, enable TLS: ```yaml metrics: open_telemetry_collector: service: my-service-name grpc: - address: otel-collector.example.com:4317 secure: true ``` Use the `tags` field to add labels to all exported metrics for filtering and grouping in your observability platform: ```yaml metrics: open_telemetry_collector: service: my-service-name grpc: - address: localhost:4317 tags: environment: production cluster: kafka-01 ``` --- # Page 104: prometheus **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/prometheus.md --- # prometheus Host endpoints (`/metrics` and `/stats`) for Prometheus scraping. ### Common ```yml metrics: prometheus: {} ``` ### Advanced ```yml metrics: prometheus: use_histogram_timing: false histogram_timing_seconds_suffix: false histogram_buckets: [] summary_quantiles_objectives: - error: 0.05 quantile: 0.5 - error: 0.01 quantile: 0.9 - error: 0.001 quantile: 0.99 add_process_metrics: false add_go_metrics: false push_url: "" # No default (optional) push_interval: "" # No default (optional) push_job_name: benthos_push push_basic_auth: username: "" password: "" file_output_path: "" ``` ## Fields ### `add_go_metrics` Whether to export Go runtime metrics such as GC pauses in addition to Redpanda Connect metrics. **Type**: `bool` **Default**: `false` ### `add_process_metrics` Whether to export process metrics such as CPU and memory usage in addition to Redpanda Connect metrics. **Type**: `bool` **Default**: `false` ### `file_output_path` An optional file path to write all prometheus metrics on service shutdown. **Type**: `string` **Default**: `""` ### `histogram_buckets[]` Timing metrics histogram buckets (in seconds). If left empty defaults to DefBuckets ([https://pkg.go.dev/github.com/prometheus/client_golang/prometheus#pkg-variables](https://pkg.go.dev/github.com/prometheus/client_golang/prometheus#pkg-variables)). Applicable when `use_histogram_timing` is set to `true`. **Type**: `array` **Default**: `[]` ### `histogram_timing_seconds_suffix` Whether to rewrite a `_ns` timing metric name suffix to `_seconds` when `use_histogram_timing` is `true` (for example `processor_latency_ns` becomes `processor_latency_seconds`), reflecting that histogram timings are recorded in seconds. This also keeps the histogram series distinct from the summary series emitted when `use_histogram_timing` is `false`, which avoids Prometheus remote-write "multiple metric kinds" rejections when a fleet mixes the setting. Enabling this renames existing histogram timing series, so dashboards and alerts that query the `_ns` names must be updated. Has no effect when `use_histogram_timing` is `false`. **Type**: `bool` **Default**: `false` ### `push_basic_auth` The Basic Authentication credentials. **Type**: `object` ### `push_basic_auth.password` The Basic Authentication password. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `push_basic_auth.username` The Basic Authentication username. **Type**: `string` **Default**: `""` ### `push_interval` The period of time between each push when sending metrics to a Push Gateway. **Type**: `string` ### `push_job_name` An identifier for push jobs. **Type**: `string` **Default**: `benthos_push` ### `push_url` An optional [Push Gateway URL](#push-gateway) to push metrics to. **Type**: `string` ### `summary_quantiles_objectives[]` A list of timing metrics summary buckets (as quantiles). Applicable when `use_histogram_timing` is set to `false`. **Type**: `array` **Default**: ```yaml - error: 0.05 quantile: 0.5 - error: 0.01 quantile: 0.9 - error: 0.001 quantile: 0.99 ``` ```yaml # Examples: summary_quantiles_objectives: - error: 0.05 quantile: 0.5 - error: 0.01 quantile: 0.9 - error: 0.001 quantile: 0.99 ``` ### `summary_quantiles_objectives[].error` Permissible margin of error for quantile calculations. Precise calculations in a streaming context (without prior knowledge of the full dataset) can be resource-intensive. To balance accuracy with computational efficiency, an error margin is introduced. For instance, if the 90th quantile (`0.9`) is determined to be `100ms` with a 1% error margin (`0.01`), the true value will fall within the `[99ms, 101ms]` range.) **Type**: `float` **Default**: `0` ### `summary_quantiles_objectives[].quantile` Quantile value. **Type**: `float` **Default**: `0` ### `use_histogram_timing` Whether to export timing metrics as a histogram, if `false` a summary is used instead. When exporting histogram timings the delta values are converted from nanoseconds into seconds in order to better fit within bucket definitions. For more information on histograms and summaries refer to: [https://prometheus.io/docs/practices/histograms/](https://prometheus.io/docs/practices/histograms/). Instances that report to the same destination must use the same value, unless `histogram_timing_seconds_suffix` is enabled. See [Timing metrics](#timing-metrics). **Type**: `bool` **Default**: `false` ## Timing metrics Timing metrics such as `processor_latency_ns` are exported as a summary by default, or as a histogram when `use_histogram_timing` is `true`. Both variants are exported under the same metric name unless `histogram_timing_seconds_suffix` is also `true`. > ❗ **IMPORTANT** > > If several Redpanda Connect instances send metrics to the same destination, they must all use the same `use_histogram_timing` value. Otherwise, set `histogram_timing_seconds_suffix: true` on every instance that has `use_histogram_timing: true`. When a fleet mixes the setting without the suffix, one metric name is reported as a summary by some instances and as a histogram by others. Prometheus remote-write receivers such as Vector and Mimir reject the whole write request with an error like "multiple metric kinds given for metric name", so metrics from every instance in that request are dropped. The suffix only renames timing metrics whose names end in `_ns`. All built-in timing metrics do. Custom timing metrics from the `metric` processor with other names are not renamed, so give them an `_ns` suffix or keep `use_histogram_timing` consistent across the fleet. ## Push gateway The field `push_url` is optional and when set will trigger a push of metrics to a [Prometheus Push Gateway](https://prometheus.io/docs/instrumenting/pushing/) once Redpanda Connect shuts down. It is also possible to specify a `push_interval` which results in periodic pushes. The Push Gateway is useful for when Redpanda Connect instances are short lived. Do not include the `/metrics/jobs/…​` path in the push URL. If the Push Gateway requires HTTP Basic Authentication it can be configured with `push_basic_auth`. --- # Page 105: Outputs **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/about.md --- # Outputs An output config section looks like this: ```yaml output: label: my_s3_output aws_s3: bucket: TODO path: '${! meta("kafka_topic") }/${! json("message.id") }.json' # Optional list of processing steps processors: - mapping: '{"message":this,"meta":{"link_count":this.links.length()}}' ``` ## Back pressure Redpanda Connect outputs apply back pressure to components upstream. This means if your output target starts blocking traffic Redpanda Connect will gracefully stop consuming until the issue is resolved. ## Retries When a Redpanda Connect output fails to send a message the error is propagated back up to the input, where depending on the protocol it will either be pushed back to the source as a Noack (e.g. AMQP) or will be reattempted indefinitely with the commit withheld until success (e.g. Kafka). It’s possible to instead have Redpanda Connect indefinitely retry an output until success with a [`retry`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/retry/) output. Some other outputs, such as the [`broker`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/broker/), might also retry indefinitely depending on their configuration. ## Dead letter queues It’s possible to create fallback outputs for when an output target fails using a [`fallback`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/fallback/) output: ```yaml output: fallback: - aws_sqs: url: https://sqs.us-west-2.amazonaws.com/TODO/TODO max_in_flight: 20 - http_client: url: http://backup:1234/dlq verb: POST ``` ## Multiplexing outputs There are a few different ways of multiplexing in Redpanda Connect, here’s a quick run through: ### Interpolation multiplexing Some output fields support [field interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/), which is a super easy way to multiplex messages based on their contents in situations where you are multiplexing to the same service. For example, multiplexing against Kafka topics is a common pattern: ```yaml output: kafka: addresses: [ TODO:6379 ] topic: ${! meta("target_topic") } ``` Refer to the field documentation for a given output to see if it support interpolation. ### Switch multiplexing A more advanced form of multiplexing is to route messages to different output configurations based on a query. This is easy with the [`switch` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/switch/): ```yaml output: switch: cases: - check: this.type == "foo" output: amqp_1: urls: [ amqps://guest:guest@localhost:5672/ ] target_address: queue:/the_foos - check: this.type == "bar" output: gcp_pubsub: project: dealing_with_mike topic: mikes_bars - output: redis_streams: url: tcp://localhost:6379 stream: everything_else processors: - mapping: | root = this root.type = this.type.not_null() | "unknown" ``` ## Labels Outputs have an optional field `label` that can uniquely identify them in observability data such as metrics and logs. This can be useful when running configs with multiple outputs, otherwise their metrics labels will be generated based on their composition. For more information check out the [metrics documentation](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/about/). --- # Page 106: amqp_0_9 **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/amqp_0_9.md --- # amqp_0_9 Sends messages to an AMQP (0.91) exchange. AMQP is a messaging protocol used by various message brokers, including RabbitMQ. The metadata from each message are delivered as headers. It’s possible for this output type to create the target exchange by setting `exchange_declare.enabled` to `true`, if the exchange already exists then the declaration passively verifies that the settings match. TLS is automatic when connecting to an `amqps` URL, but custom settings can be enabled in the [`tls`](#tls) section. The fields `key`, `exchange` and `type` can be dynamically set using [function interpolations](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). #### Common ```yml output: label: "" amqp_0_9: urls: [] # No default (required) exchange: "" # No default (required) key: "" type: "" metadata: exclude_prefixes: [] max_in_flight: 64 ``` #### Advanced ```yml output: label: "" amqp_0_9: urls: [] # No default (required) exchange: "" # No default (required) exchange_declare: enabled: false type: direct durable: true arguments: {} # No default (optional) key: "" type: "" content_type: application/octet-stream content_encoding: "" correlation_id: "" reply_to: "" expiration: "" message_id: "" user_id: "" app_id: "" metadata: exclude_prefixes: [] priority: "" max_in_flight: 64 persistent: false mandatory: false immediate: false timeout: "" tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] ``` ## Fields ### `app_id` Set an application ID for each message using a dynamic interpolated expression. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `content_encoding` The content encoding attribute of each message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `content_type` The MIME type of each message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `application/octet-stream` ### `correlation_id` Set a unique correlation ID for each message using a dynamic interpolated expression to help match messages to responses. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `exchange` The AMQP exchange to publish messages to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `exchange_declare` Declares the target exchange (`exchange`) to check whether an exchange with the specified name exists and is configured correctly. If the exchange exists, the declaration verifies that the fields specified in this object match its properties. If the target exchange does not exist, this output creates it. **Type**: `object` ### `exchange_declare.arguments` Arguments for server-specific implementations of the exchange (optional). You can use arguments to configure additional parameters for exchange types that require them. **Type**: `object` ```yaml # Examples: arguments: alternate-exchange: my-ae ``` ### `exchange_declare.durable` Whether the declared exchange is durable. **Type**: `bool` **Default**: `true` ### `exchange_declare.enabled` Whether to enable exchange declaration. **Type**: `bool` **Default**: `false` ### `exchange_declare.type` The type of the exchange, which determines how messages are routed to queues. For `topic` exchanges, routing keys are matched as lists of words separated by dots (`.`). **Type**: `string` **Default**: `direct` **Options**: `direct`, `fanout`, `topic`, `headers`, `x-custom` ### `expiration` Set the TTL of each message in milliseconds. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `immediate` Whether to set the immediate flag on published messages. When set to `true`, if there are no active consumers for a queue, the message is dropped instead of waiting. **Type**: `bool` **Default**: `false` ### `key` The binding key to set for each message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `mandatory` Whether to set the mandatory flag on published messages. When set to `true`, a published message that cannot be routed to any queues is returned to the sender. **Type**: `bool` **Default**: `false` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `message_id` Set a message ID for each message using a dynamic interpolated expression. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `metadata` Configure which metadata values are added to messages as headers. This allows you to pass additional context information along with your messages. **Type**: `object` ### `metadata.exclude_prefixes[]` Provide a list of explicit metadata key prefixes to exclude when adding metadata to sent messages. **Type**: `array` **Default**: `[]` ### `persistent` Whether to store delivered messages on disk. By default, message delivery is transient. **Type**: `bool` **Default**: `false` ### `priority` Set the priority of each message using a dynamic interpolated expression. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ```yaml # Examples: priority: "0" # --- priority: ${! meta("amqp_priority") } # --- priority: ${! json("doc.priority") } ``` ### `reply_to` Set the name of the queue to which responses are sent using a dynamic interpolated expression. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `timeout` The maximum period to wait for a message acknowledgment before abandoning it and attempting a resend. If this value is not set, the system waits indefinitely. **Type**: `string` **Default**: `""` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `type` A custom message type to set for each message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `urls[]` A list of AMQP 0.9.1 broker URLs to connect to, in the form `amqp://user:password@host:port/vhost`. Each URL is tried in order until a connection is established, and that URL is then used until the connection is closed. When `tls` is enabled and a URL has no user credentials, the connection authenticates with the SASL `EXTERNAL` mechanism using the client certificate. If an item in the list contains commas, it is split into multiple URLs. **Type**: `array` ```yaml # Examples: urls: - "amqp://guest:guest@127.0.0.1:5672/" # --- urls: - "amqp://127.0.0.1:5672/,amqp://127.0.0.2:5672/" # --- urls: - "amqp://127.0.0.1:5672/" - "amqp://127.0.0.2:5672/" ``` ### `user_id` Set the user ID to the name of the publisher. If this property is set by a publisher, its value must match the name of the user that opened the connection. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` --- # Page 107: arc **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/arc.md --- # arc Writes data to an Arc database via the msgpack ingestion endpoint. This output sends data to an [Arc](https://github.com/Basekick-Labs/arc) columnar analytical database using its high-performance MessagePack ingestion endpoint. Arc supports two payload formats: - **columnar** (default): Transposes batched messages into column arrays. This is the recommended format, offering significantly faster ingestion. - **row**: Sends each message as an individual row record with fields and optional tags. Data is encoded as MessagePack and optionally compressed with zstd (recommended) or gzip before being sent to the Arc endpoint. > 📝 **NOTE** > > In columnar mode, all messages within a single batch must have the same set of fields. Arc validates that all column arrays have equal length and rejects batches with mismatched columns. Schema evolution across separate batches is fully supported. Use row format if messages within a batch have varying schemas. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" arc: base_url: "" # No default (required) timeout: 5s token: "" # No default (optional) database: default measurement: "" # No default (required) format: columnar tags_mapping: "" # No default (optional) compression: zstd max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" arc: base_url: "" # No default (required) timeout: 5s tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] proxy_url: "" disable_http2: false tps_limit: 0 tps_burst: 1 backoff: initial_interval: 1s max_interval: 30s max_retries: 3 tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s http: max_idle_conns: 100 max_idle_conns_per_host: 0 max_conns_per_host: 64 idle_conn_timeout: 1m30s tls_handshake_timeout: 10s expect_continue_timeout: 1s response_header_timeout: 0s disable_keep_alives: false disable_compression: false max_response_header_bytes: 1048576 max_response_body_bytes: 10485760 write_buffer_size: 4096 read_buffer_size: 4096 h2: strict_max_concurrent_requests: false max_decoder_header_table_size: 4096 max_encoder_header_table_size: 4096 max_read_frame_size: 16384 max_receive_buffer_per_connection: 1048576 max_receive_buffer_per_stream: 1048576 send_ping_timeout: 0s ping_timeout: 15s write_byte_timeout: 0s access_log_level: "" access_log_body_limit: 0 token: "" # No default (optional) database: default measurement: "" # No default (required) format: columnar timestamp_field: "" timestamp_unit: auto tags_mapping: "" # No default (optional) compression: zstd max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `access_log_body_limit` Maximum bytes of request/response body to include in logs. 0 to skip body logging. **Type**: `int` **Default**: `0` ### `access_log_level` Log level for HTTP request/response logging. Empty disables logging. **Type**: `string` **Default**: `""` **Options**: `""`, `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR` ### `backoff` Adaptive backoff configuration for 429 (Too Many Requests) responses. Always active. **Type**: `object` ### `backoff.initial_interval` Initial interval between retries on 429 responses. **Type**: `string` **Default**: `1s` ### `backoff.max_interval` Maximum interval between retries on 429 responses. **Type**: `string` **Default**: `30s` ### `backoff.max_retries` Maximum number of retries on 429 responses. **Type**: `int` **Default**: `3` ### `base_url` The base URL of the target service (for example, `https://api.example.com`). TLS is enabled automatically for `https` URLs. **Type**: `string` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `compression` Compression algorithm for the request body. `zstd` is recommended for best decompression performance in Arc. **Type**: `string` **Default**: `zstd` **Options**: `zstd`, `gzip`, `none` ### `database` The target database name. **Type**: `string` **Default**: `default` ### `disable_http2` Disable HTTP/2 and force HTTP/1.1. **Type**: `bool` **Default**: `false` ### `format` The payload format. `columnar` transposes batch messages into column arrays for best performance. `row` sends each message as an individual record. **Type**: `string` **Default**: `columnar` **Options**: `columnar`, `row` ### `http` HTTP transport settings controlling connection pooling, timeouts, and HTTP/2. **Type**: `object` ### `http.disable_compression` Disable automatic decompression of gzip responses. **Type**: `bool` **Default**: `false` ### `http.disable_keep_alives` Disable HTTP keep-alive connections; each request uses a new connection. **Type**: `bool` **Default**: `false` ### `http.expect_continue_timeout` Maximum time to wait for a server’s 100-continue response before sending the body. 0 means the body is sent immediately. **Type**: `string` **Default**: `1s` ### `http.h2` HTTP/2-specific transport settings. Only applied when HTTP/2 is enabled. **Type**: `object` ### `http.h2.max_decoder_header_table_size` Upper limit in bytes for the HPACK header table used to decode headers from the peer. Must be less than 4 MiB. **Type**: `int` **Default**: `4096` ### `http.h2.max_encoder_header_table_size` Upper limit in bytes for the HPACK header table used to encode headers sent to the peer. Must be less than 4 MiB. **Type**: `int` **Default**: `4096` ### `http.h2.max_read_frame_size` Largest HTTP/2 frame this endpoint will read. Valid range: 16 KiB to 16 MiB. **Type**: `int` **Default**: `16384` ### `http.h2.max_receive_buffer_per_connection` Maximum flow-control window size in bytes for data received on a connection. Must be at least 64 KiB and less than 4 MiB. **Type**: `int` **Default**: `1048576` ### `http.h2.max_receive_buffer_per_stream` Maximum flow-control window size in bytes for data received on a single stream. Must be less than 4 MiB. **Type**: `int` **Default**: `1048576` ### `http.h2.ping_timeout` Timeout waiting for a PING response before closing the connection. **Type**: `string` **Default**: `15s` ### `http.h2.send_ping_timeout` Idle timeout after which a PING frame is sent to verify connection health. 0 disables health checks. **Type**: `string` **Default**: `0s` ### `http.h2.strict_max_concurrent_requests` When true, new requests block when a connection’s concurrency limit is reached instead of opening a new connection. **Type**: `bool` **Default**: `false` ### `http.h2.write_byte_timeout` Timeout for writing data to a connection. The timer resets whenever bytes are written. 0 disables the timeout. **Type**: `string` **Default**: `0s` ### `http.idle_conn_timeout` How long an idle connection remains in the pool before being closed. 0 disables the timeout. **Type**: `string` **Default**: `1m30s` ### `http.max_conns_per_host` Maximum total connections (active + idle) per host. 0 means unlimited. **Type**: `int` **Default**: `64` ### `http.max_idle_conns` Maximum total number of idle (keep-alive) connections across all hosts. 0 means unlimited. **Type**: `int` **Default**: `100` ### `http.max_idle_conns_per_host` Maximum idle connections to keep per host. 0 (the default) uses GOMAXPROCS+1. **Type**: `int` **Default**: `0` ### `http.max_response_body_bytes` Maximum bytes of response body the client will read. The response body is wrapped with a limit reader; reads beyond this cap return EOF. 0 disables the limit. **Type**: `int` **Default**: `10485760` ### `http.max_response_header_bytes` Maximum bytes of response headers to allow. **Type**: `int` **Default**: `1048576` ### `http.read_buffer_size` Size in bytes of the per-connection read buffer. **Type**: `int` **Default**: `4096` ### `http.response_header_timeout` Maximum time to wait for response headers after writing the full request. 0 disables the timeout. **Type**: `string` **Default**: `0s` ### `http.tls_handshake_timeout` Maximum time to wait for a TLS handshake to complete. 0 disables the timeout. **Type**: `string` **Default**: `10s` ### `http.write_buffer_size` Size in bytes of the per-connection write buffer. **Type**: `int` **Default**: `4096` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `measurement` The measurement (table) name. Supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: measurement: cpu_metrics # --- measurement: ${!metadata("measurement")} # --- measurement: ${!json("type")} ``` ### `proxy_url` HTTP proxy URL. Empty string disables proxying. **Type**: `string` **Default**: `""` ### `tags_mapping` An optional Bloblang mapping to extract tags from each message. Only used in `row` format. The result must be a `map[string]string`. **Type**: `string` ```yaml # Examples: tags_mapping: 'root = {"host": this.hostname, "region": this.region}' ``` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `timeout` HTTP request timeout. **Type**: `string` **Default**: `5s` ### `timestamp_field` The field name within each message containing the timestamp. If empty, the current time is used. Supports Unix timestamps and RFC3339 strings. **Type**: `string` **Default**: `""` ### `timestamp_unit` The unit of a numeric timestamp field. `auto` detects the unit based on magnitude. Ignored when `timestamp_field` is empty. **Type**: `string` **Default**: `auto` **Options**: `us`, `ms`, `s`, `ns`, `auto` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `token` Bearer token for authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `tps_burst` Maximum burst size for rate limiting. **Type**: `int` **Default**: `1` ### `tps_limit` Rate limit in requests per second. 0 disables rate limiting. **Type**: `float` **Default**: `0` --- # Page 108: aws_dynamodb **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/aws_dynamodb.md --- # aws_dynamodb Inserts items into a DynamoDB table. The field `string_columns` is a map of column names to string values, where the values are [function interpolated](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries) per message of a batch. This allows you to populate string columns of an item by extracting fields within the document payload or metadata like follows: ```yml string_columns: id: ${!json("id")} title: ${!json("body.title")} topic: ${!meta("kafka_topic")} full_content: ${!content()} ``` The field `json_map_columns` is a map of column names to json paths, where the [dot path](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/field_paths/) is extracted from each document and converted into a map value. Both an empty path and the path `.` are interpreted as the root of the document. This allows you to populate map columns of an item like follows: ```yml json_map_columns: user: path.to.user whole_document: . ``` A column name can be empty: ```yml json_map_columns: "": . ``` In which case the top level document fields will be written at the root of the item, potentially overwriting previously defined column values. If a path is not found within a document the column will not be populated. ## Credentials By default Redpanda Connect will use a shared credentials file when connecting to AWS services. It’s also possible to set them explicitly at the component level, allowing you to transfer data across accounts. You can find out more in [AWS credentials](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" aws_dynamodb: table: "" # No default (required) string_columns: {} json_map_columns: {} max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" aws_dynamodb: table: "" # No default (required) string_columns: {} json_map_columns: {} ttl: "" ttl_key: "" max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) max_retries: 3 backoff: initial_interval: 1s max_interval: 5s max_elapsed_time: 30s ``` ## Fields ### `backoff` The exponential backoff between retry attempts. The wait starts at `initial_interval` and grows with each failed attempt, up to `max_interval`. **Type**: `object` ### `backoff.initial_interval` The initial period to wait between retry attempts. The retry interval increases for each failed attempt, up to the `backoff.max_interval` value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `1s` ### `backoff.max_elapsed_time` The maximum period to wait before retry attempts are abandoned. If zero then no limit is used. **Type**: `string` **Default**: `30s` ### `backoff.max_interval` The maximum period to wait between retry attempts. **Type**: `string` **Default**: `5s` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `json_map_columns` A map of column keys to [field paths](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/field_paths/) pointing to value data within messages. **Type**: `object` **Default**: `{}` ```yaml # Examples: json_map_columns: user: path.to.user whole_document: . # --- json_map_columns: "": . ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `max_retries` The maximum number of retries before giving up on the request. If set to zero there is no discrete limit. **Type**: `int` **Default**: `3` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `string_columns` A map of column keys to string values to store. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` **Default**: `{}` ```yaml # Examples: string_columns: full_content: ${!content()} id: ${!json("id")} title: ${!json("body.title")} topic: ${!meta("kafka_topic")} ``` ### `table` The table to store messages in. **Type**: `string` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `ttl` An optional TTL to set for items, calculated from the moment the message is sent. **Type**: `string` **Default**: `""` ### `ttl_key` The column key to place the TTL value within. The value is the expiry time as a Unix timestamp in seconds, stored as a number attribute, which is the format that DynamoDB TTL requires. A TTL value is only written when both this field and a TTL duration are set. **Type**: `string` **Default**: `""` --- # Page 109: aws_kinesis_firehose **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/aws_kinesis_firehose.md --- # aws_kinesis_firehose Sends messages to a Kinesis Firehose delivery stream. ## Credentials By default Redpanda Connect will use a shared credentials file when connecting to AWS services. It’s also possible to set them explicitly at the component level, allowing you to transfer data across accounts. You can find out more in [AWS credentials](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" aws_kinesis_firehose: stream: "" # No default (required) max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" aws_kinesis_firehose: stream: "" # No default (required) max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) max_retries: 0 backoff: initial_interval: 1s max_interval: 5s max_elapsed_time: 30s ``` ## Fields ### `backoff` The exponential backoff between retry attempts. The wait starts at `initial_interval` and grows with each failed attempt, up to `max_interval`. **Type**: `object` ### `backoff.initial_interval` The initial period to wait between retry attempts. The retry interval increases for each failed attempt, up to the `backoff.max_interval` value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `1s` ### `backoff.max_elapsed_time` The maximum period to wait before retry attempts are abandoned. If zero then no limit is used. **Type**: `string` **Default**: `30s` ### `backoff.max_interval` The maximum period to wait between retry attempts. **Type**: `string` **Default**: `5s` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `max_retries` The maximum number of retries before giving up on the request. If set to zero there is no discrete limit. **Type**: `int` **Default**: `0` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `stream` The stream to publish messages to. **Type**: `string` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` --- # Page 110: aws_kinesis **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/aws_kinesis.md --- # aws_kinesis Sends messages to a Kinesis stream. Both the `partition_key`(required) and `hash_key` (optional) fields can be dynamically set using function interpolations described [here](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). When sending batched messages the interpolations are performed per message part. ## Credentials By default Redpanda Connect will use a shared credentials file when connecting to AWS services. It’s also possible to set them explicitly at the component level, allowing you to transfer data across accounts. You can find out more in [AWS credentials](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" aws_kinesis: stream: "" # No default (required) partition_key: "" # No default (required) max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" aws_kinesis: stream: "" # No default (required) partition_key: "" # No default (required) hash_key: "" # No default (optional) max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) max_retries: 0 backoff: initial_interval: 1s max_interval: 5s max_elapsed_time: 30s ``` ## Fields ### `backoff` The exponential backoff between retry attempts. The wait starts at `initial_interval` and grows with each failed attempt, up to `max_interval`. **Type**: `object` ### `backoff.initial_interval` The initial period to wait between retry attempts. The retry interval increases for each failed attempt, up to the `backoff.max_interval` value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `1s` ### `backoff.max_elapsed_time` The maximum period to wait before retry attempts are abandoned. If zero then no limit is used. **Type**: `string` **Default**: `30s` ### `backoff.max_interval` The maximum period to wait between retry attempts. **Type**: `string` **Default**: `5s` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `hash_key` A optional hash key for partitioning messages. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `max_in_flight` The maximum number of parallel message batches to have in flight at any given time. **Type**: `int` **Default**: `64` ### `max_retries` The maximum number of retries before giving up on the request. If set to zero there is no discrete limit. **Type**: `int` **Default**: `0` ### `partition_key` A required key for partitioning messages. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `stream` The stream to publish messages to. Streams can either be specified by their name or full ARN. **Type**: `string` ```yaml # Examples: stream: foo # --- stream: arn:aws:kinesis:*:111122223333:stream/my-stream ``` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` --- # Page 111: aws_s3 **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/aws_s3.md --- # aws_s3 Sends message parts as objects to an Amazon S3 bucket. Each object is uploaded with the path specified with the `path` field. In order to have a different path for each object you should use function interpolations described in [Bloblang queries](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries), which are calculated per message of a batch. ## Metadata Metadata fields on messages will be sent as headers, in order to mutate these values (or remove them) check out the [metadata docs](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/metadata/). ## Tags The tags field allows you to specify key/value pairs to attach to objects as tags, where the values support [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries): ```yaml output: aws_s3: bucket: TODO path: ${!counter()}-${!timestamp_unix_nano()}.tar.gz tags: Key1: Value1 Timestamp: ${!meta("Timestamp")} ``` ## Credentials By default Redpanda Connect will use a shared credentials file when connecting to AWS services. It’s also possible to set them explicitly at the component level, allowing you to transfer data across accounts. You can find out more in [AWS credentials](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). ## Batching It’s common to want to upload messages to S3 as batched archives, the easiest way to do this is to batch your messages at the output level and join the batch of messages with an [`archive`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/archive/) and/or [`compress`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/compress/) processor. For example, if we wished to upload messages as a .tar.gz archive of documents we could achieve that with the following config: ```yaml output: aws_s3: bucket: TODO path: ${!counter()}-${!timestamp_unix_nano()}.tar.gz batching: count: 100 period: 10s processors: - archive: format: tar - compress: algorithm: gzip ``` Alternatively, if we wished to upload JSON documents as a single large document containing an array of objects we can do that with: ```yaml output: aws_s3: bucket: TODO path: ${!counter()}-${!timestamp_unix_nano()}.json batching: count: 100 processors: - archive: format: json_array ``` ## S3-compatible storage The `endpoint` and `force_path_style_urls` fields let you connect to S3-compatible storage services, such as Cloudflare R2, MinIO, or DigitalOcean Spaces. For example, to upload to Cloudflare R2, set `endpoint` to your account’s R2 endpoint URL, set `region` to `auto`, and enable `force_path_style_urls`: ```yaml output: aws_s3: bucket: r2-bucket path: ${!uuid_v4()}.json endpoint: https://.r2.cloudflarestorage.com force_path_style_urls: true region: auto credentials: id: secret: ``` To find your account ID and generate R2 API credentials, see [Cloudflare R2 authentication](https://developers.cloudflare.com/r2/api/tokens/). ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. ### Common ```yml output: label: "" aws_s3: bucket: "" # No default (required) path: ${!counter()}-${!timestamp_unix_nano()}.txt tags: {} content_type: application/octet-stream metadata: exclude_prefixes: [] max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" aws_s3: bucket: "" # No default (required) path: ${!counter()}-${!timestamp_unix_nano()}.txt tags: {} content_type: application/octet-stream content_encoding: "" cache_control: "" content_disposition: "" content_language: "" website_redirect_location: "" metadata: exclude_prefixes: [] storage_class: STANDARD kms_key_id: "" checksum_algorithm: "" server_side_encryption: "" force_path_style_urls: false max_in_flight: 64 timeout: 5s object_canned_acl: "" batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) ``` ## Bucket name format The `bucket` field accepts a bucket name only, not an ARN. For example, use `my-bucket`, not `arn:aws:s3:::my-bucket`. ## Fields ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `bucket` The name of the bucket to upload messages to, such as `my-bucket`. Use the bucket name, not the bucket ARN. **Type**: `string` ### `cache_control` The cache control to set for each object. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `checksum_algorithm` The algorithm used to create the checksum for each object, which Amazon S3 uses to validate the object during upload. **Type**: `string` **Default**: `""` **Options**: `CRC32`, `CRC32C`, `SHA1`, `SHA256` ### `content_disposition` The content disposition to set for each object. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `content_encoding` An optional `Content-Encoding` value, such as `gzip`, to store with each uploaded S3 object. When empty, S3 stores the object without a content encoding. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `content_language` The content language to set for each object. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `content_type` The MIME type to store as the `Content-Type` of each uploaded S3 object. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `application/octet-stream` ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `force_path_style_urls` Forces the client API to use path style URLs, which helps when connecting to custom endpoints. **Type**: `bool` **Default**: `false` ### `kms_key_id` An optional server-side encryption key. **Type**: `string` **Default**: `""` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `metadata` Specify which message metadata keys are stored as user-defined metadata on each S3 object, which S3 returns as `x-amz-meta-*` headers. **Type**: `object` ### `metadata.exclude_prefixes[]` Provide a list of explicit metadata key prefixes to exclude when adding metadata to sent messages. **Type**: `array` **Default**: `[]` ### `object_canned_acl` The object canned ACL value. Leave empty to omit the ACL from upload requests, which is required for buckets that have ACLs disabled (the AWS default since 2023). **Type**: `string` **Default**: `""` **Options**: `""`, `private`, `public-read`, `public-read-write`, `authenticated-read`, `aws-exec-read`, `bucket-owner-read`, `bucket-owner-full-control` ### `path` The path of each message to upload. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `${!counter()}-${!timestamp_unix_nano()}.txt` ```yaml # Examples: path: ${!counter()}-${!timestamp_unix_nano()}.txt # --- path: ${!meta("kafka_key")}.json # --- path: ${!json("doc.namespace")}/${!json("doc.id")}.json ``` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `server_side_encryption` An optional server-side encryption algorithm. **Type**: `string` **Default**: `""` ### `storage_class` The storage class to set for each object. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `STANDARD` **Options**: `STANDARD`, `REDUCED_REDUNDANCY`, `GLACIER`, `STANDARD_IA`, `ONEZONE_IA`, `INTELLIGENT_TIERING`, `DEEP_ARCHIVE` ### `tags` Key/value pairs to store with the object as tags. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` **Default**: `{}` ```yaml # Examples: tags: Key1: Value1 Timestamp: ${!meta("Timestamp")} ``` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `timeout` The maximum period to wait for every object in a message batch to upload to S3. When the timeout is reached, the batch upload is abandoned and reattempted. **Type**: `string` **Default**: `5s` ### `website_redirect_location` The website redirect location to set for each object. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` --- # Page 112: aws_sns **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/aws_sns.md --- # aws_sns Sends messages to an AWS SNS topic. ## Credentials By default Redpanda Connect will use a shared credentials file when connecting to AWS services. It’s also possible to set them explicitly at the component level, allowing you to transfer data across accounts. You can find out more in [AWS credentials](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. ### Common ```yml output: label: "" aws_sns: topic_arn: "" # No default (required) message_group_id: "" # No default (optional) message_deduplication_id: "" # No default (optional) subject: "" # No default (optional) max_in_flight: 64 metadata: exclude_prefixes: [] ``` ### Advanced ```yml output: label: "" aws_sns: topic_arn: "" # No default (required) message_group_id: "" # No default (optional) message_deduplication_id: "" # No default (optional) subject: "" # No default (optional) max_in_flight: 64 metadata: exclude_prefixes: [] timeout: 5s region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) ``` ## Fields ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `message_deduplication_id` An optional deduplication ID for messages published to an SNS FIFO topic. SNS discards a message whose deduplication ID it has already accepted within the deduplication interval. Not required when the topic has content-based deduplication enabled. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `message_group_id` An optional message group ID. Required when publishing to an SNS FIFO topic, which delivers messages that share a group ID in order. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `metadata` Specify which metadata values are sent as SNS message attributes of type `String`. Metadata keys that are not valid SNS attribute names are skipped. **Type**: `object` ### `metadata.exclude_prefixes[]` Provide a list of explicit metadata key prefixes to exclude when adding metadata to sent messages. **Type**: `array` **Default**: `[]` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `subject` An optional subject to set for messages. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `timeout` The maximum period to wait on a publish request before abandoning it and reattempting. **Type**: `string` **Default**: `5s` ### `topic_arn` The topic to publish to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` --- # Page 113: aws_sqs **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/aws_sqs.md --- # aws_sqs Sends messages to an SQS queue. Metadata values are sent along with the payload as attributes with the data type String. If the number of metadata values in a message exceeds the message attribute limit (10) then the top ten keys ordered alphabetically will be selected. The fields `message_group_id`, `message_deduplication_id` and `delay_seconds` can be set dynamically using [function interpolations](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries), which are resolved individually for each message of a batch. ## Credentials By default Redpanda Connect will use a shared credentials file when connecting to AWS services. It’s also possible to set them explicitly at the component level, allowing you to transfer data across accounts. You can find out more in [AWS credentials](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" aws_sqs: url: "" # No default (required) message_group_id: "" # No default (optional) message_deduplication_id: "" # No default (optional) delay_seconds: "" # No default (optional) max_in_flight: 64 metadata: exclude_prefixes: [] batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" aws_sqs: url: "" # No default (required) message_group_id: "" # No default (optional) message_deduplication_id: "" # No default (optional) delay_seconds: "" # No default (optional) max_in_flight: 64 metadata: exclude_prefixes: [] batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) max_records_per_request: 10 region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) max_retries: 0 backoff: initial_interval: 1s max_interval: 5s max_elapsed_time: 30s ``` ## Fields ### `backoff` The exponential backoff between retry attempts. The wait starts at `initial_interval` and grows with each failed attempt, up to `max_interval`. **Type**: `object` ### `backoff.initial_interval` The initial period to wait between retry attempts. The retry interval increases for each failed attempt, up to the `backoff.max_interval` value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `1s` ### `backoff.max_elapsed_time` The maximum period to wait before retry attempts are abandoned. If zero then no limit is used. **Type**: `string` **Default**: `30s` ### `backoff.max_interval` The maximum period to wait between retry attempts. **Type**: `string` **Default**: `5s` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `delay_seconds` An optional delay time in seconds for messages. The value must be between `0` and `900`. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `max_in_flight` The maximum number of parallel message batches to have in flight at any given time. **Type**: `int` **Default**: `64` ### `max_records_per_request` The maximum number of records delivered in a single SQS request. Enter a value from `1` to `10`. **Type**: `int` **Default**: `10` ### `max_retries` The maximum number of retries before giving up on the request. If set to zero there is no discrete limit. **Type**: `int` **Default**: `0` ### `message_deduplication_id` An optional deduplication ID for messages sent to an SQS FIFO queue. SQS accepts only the first message with a given deduplication ID within the five-minute deduplication interval. Not required when the queue has content-based deduplication enabled. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `message_group_id` An optional message group ID. Required when sending to an SQS FIFO queue, where messages that share a group ID are received in the order they were sent. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `metadata` Specify which metadata values are sent as SQS message attributes of type `String`. SQS allows at most 10 attributes per message, so only the first 10 matching keys in sorted order are sent. Keys that are not valid SQS attribute names are skipped. **Type**: `object` ### `metadata.exclude_prefixes[]` Provide a list of explicit metadata key prefixes to exclude when adding metadata to sent messages. **Type**: `array` **Default**: `[]` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `url` The URL of the target SQS queue. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` --- # Page 114: azure_blob_storage **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/azure_blob_storage.md --- # azure_blob_storage Sends message parts as objects to an Azure Blob Storage Account container. Each object is uploaded with the filename specified with the `container` field. In order to have a different path for each object you should use function interpolations described [here](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries), which are calculated per message of a batch. Supports multiple authentication methods but only one of the following is required: - `storage_connection_string` - `storage_account` and `storage_access_key` - `storage_account` and `storage_sas_token` - `storage_account` to access via [DefaultAzureCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DefaultAzureCredential) If multiple are set then the `storage_connection_string` is given priority. If the `storage_connection_string` does not contain the `AccountName` parameter, please specify it in the `storage_account` field. ## Tags The `tags` field allows you to attach key/value pairs to blobs as [blob index tags](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-manage-find-blobs), where the values support [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries): ```yaml output: azure_blob_storage: container: TODO path: ${!counter()}-${!timestamp_unix_nano()}.txt tags: Environment: production Source: ${!@kafka_topic} ``` Keys and values can contain only alphanumerics, spaces, and the characters `+ - . / : = _`. Only values support interpolation. Keys are static and are checked against Azure’s limits at startup. Values are resolved and checked per message, and a message with an invalid value fails before any upload. If authenticating with `storage_sas_token`, the token must include the `t` (tags) permission. When `blob_type` is `APPEND` the tags describe the blob rather than any single message, so they are applied only when this output creates the blob, and are not re-sent with subsequent appends. Two consequences are worth knowing: - A blob that already exists is never tagged, including one created by an earlier run of the pipeline. Appending to a long-lived blob therefore only picks up tags if this output created it. - Interpolated tag values resolve from the message that creates the blob. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. ### Common ```yml output: label: "" azure_blob_storage: storage_account: "" storage_access_key: "" storage_connection_string: "" storage_sas_token: "" container: "" # No default (required) path: ${!counter()}-${!timestamp_unix_nano()}.txt max_in_flight: 64 ``` ### Advanced ```yml output: label: "" azure_blob_storage: storage_account: "" storage_access_key: "" storage_connection_string: "" storage_sas_token: "" container: "" # No default (required) path: ${!counter()}-${!timestamp_unix_nano()}.txt tags: {} blob_type: BLOCK public_access_level: PRIVATE max_in_flight: 64 ``` ## Fields ### `blob_type` Block and Append blobs are made up of blocks, and each blob can support up to 50,000 blocks. The default value is `BLOCK`. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `BLOCK` **Options**: `BLOCK`, `APPEND` ### `container` The container for uploading the messages to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: container: messages-${!timestamp("2006")} ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `path` The path of each message to upload. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `${!counter()}-${!timestamp_unix_nano()}.txt` ```yaml # Examples: path: ${!counter()}-${!timestamp_unix_nano()}.json # --- path: ${!meta("kafka_key")}.json # --- path: ${!json("doc.namespace")}/${!json("doc.id")}.json ``` ### `public_access_level` The container’s public access level. The default value is `PRIVATE`. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `PRIVATE` **Options**: `PRIVATE`, `BLOB`, `CONTAINER` ### `storage_access_key` The access key for the storage account. Use this field along with `storage_account` for authentication. This field is ignored when the `storage_connection_string` field is populated. **Type**: `string` **Default**: `""` ### `storage_account` The storage account to access. This field is ignored when the `storage_connection_string` field is populated, unless the connection string does not contain the `AccountName` parameter. **Type**: `string` **Default**: `""` ### `storage_connection_string` The connection string for the storage account. This field is required if `storage_account` is not set. > 📝 **NOTE** > > If the `storage_connection_string` field does not contain the `AccountName` parameter value, specify it in the `storage_account` field. **Type**: `string` **Default**: `""` ### `storage_sas_token` The SAS token for the storage account. Use this field along with `storage_account` for authentication. This field is ignored when either the `storage_connection_string` or `storage_access_key` fields are populated. **Type**: `string` **Default**: `""` ### `tags` Key/value pairs to store with the blob as [blob index tags](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-manage-find-blobs). A maximum of 10 tags are permitted, tag keys must be between 1 and 128 characters, and tag values must be between 0 and 256 characters. Keys and values are case-sensitive and only support string values. Not supported on storage accounts with hierarchical namespace (Data Lake Gen2). This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` **Default**: `{}` ```yaml # Examples: tags: Environment: production Source: ${!@kafka_topic} ``` --- # Page 115: azure_cosmosdb **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/azure_cosmosdb.md --- # azure_cosmosdb Creates or updates messages as JSON documents in [Azure CosmosDB](https://learn.microsoft.com/en-us/azure/cosmos-db/introduction). When creating documents, each message must have the `id` property (case-sensitive) set (or use `auto_id: true`). It is the unique name that identifies the document, that is, no two documents share the same `id` within a logical partition. The `id` field must not exceed 255 characters. [See details](https://learn.microsoft.com/en-us/rest/api/cosmos-db/documents). The `partition_keys` field must resolve to the same value(s) across the entire message batch. ## Credentials You can use one of the following authentication mechanisms: - Set the `endpoint` field and the `account_key` field - Set only the `endpoint` field to use [DefaultAzureCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DefaultAzureCredential) - Set the `connection_string` field ## Batching CosmosDB limits the maximum batch size to 100 messages and the payload must not exceed 2MB ([details here](https://learn.microsoft.com/en-us/azure/cosmos-db/concepts-limits#per-request-limits)). ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" azure_cosmosdb: endpoint: "" # No default (optional) account_key: "" # No default (optional) connection_string: "" # No default (optional) database: "" # No default (required) container: "" # No default (required) partition_keys_map: "" # No default (required) operation: Create item_id: "" # No default (optional) batching: count: 0 byte_size: 0 period: "" check: "" max_in_flight: 64 ``` ### Advanced ```yml output: label: "" azure_cosmosdb: endpoint: "" # No default (optional) account_key: "" # No default (optional) connection_string: "" # No default (optional) database: "" # No default (required) container: "" # No default (required) partition_keys_map: "" # No default (required) operation: Create patch_operations: [] # No default (optional) patch_condition: "" # No default (optional) auto_id: true item_id: "" # No default (optional) batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) max_in_flight: 64 ``` ## Examples ### Create documents Create new documents in the `blobfish` container with partition key `/habitat`. ```yaml output: azure_cosmosdb: endpoint: http://localhost:8080 account_key: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw== database: blobbase container: blobfish partition_keys_map: root = json("habitat") operation: Create ``` ### Patch documents Execute the Patch operation on documents from the `blobfish` container. ```yaml output: azure_cosmosdb: endpoint: http://localhost:8080 account_key: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw== database: testdb container: blobfish partition_keys_map: root = json("habitat") item_id: ${! json("id") } operation: Patch patch_operations: # Add a new /diet field - operation: Add path: /diet value_map: root = json("diet") # Remove the first location from the /locations array field - operation: Remove path: /locations/0 # Add new location at the end of the /locations array field - operation: Add path: /locations/- value_map: root = "Challenger Deep" ``` ## Fields ### `account_key` Account key. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: account_key: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw== ``` ### `auto_id` Automatically set the item `id` field to a random UUID v4. If the `id` field is already set, then it will not be overwritten. Setting this to `false` can improve performance, since the messages will not have to be parsed. **Type**: `bool` **Default**: `true` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `connection_string` Connection string. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: connection_string: AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==; ``` ### `container` Container. **Type**: `string` ```yaml # Examples: container: testcontainer ``` ### `database` Database. **Type**: `string` ```yaml # Examples: database: testdb ``` ### `endpoint` CosmosDB endpoint. **Type**: `string` ```yaml # Examples: endpoint: https://localhost:8081 ``` ### `item_id` ID of item to replace or delete. Only used by the Replace and Delete operations This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: item_id: ${! json("id") } ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `operation` Operation. **Type**: `string` **Default**: `Create` | Option | Summary | | --- | --- | | `Create` | Create operation. | | `Delete` | Delete operation. | | `Patch` | Patch operation. | | `Replace` | Replace operation. | | `Upsert` | Upsert operation. | ### `partition_keys_map` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) which should evaluate to a single partition key value or an array of partition key values of type string, integer or boolean. Currently, hierarchical partition keys are not supported so only one value may be provided. **Type**: `string` ```yaml # Examples: partition_keys_map: root = "blobfish" # --- partition_keys_map: root = 41 # --- partition_keys_map: root = true # --- partition_keys_map: root = null # --- partition_keys_map: root = json("blobfish").depth ``` ### `patch_condition` Patch operation condition. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: patch_condition: from c where not is_defined(c.blobfish) ``` ### `patch_operations[]` Patch operations to be performed when `operation: Patch` . **Type**: `array` ### `patch_operations[].operation` Operation. **Type**: `string` **Default**: `Add` | Option | Summary | | --- | --- | | `Add` | Add patch operation. | | `Increment` | Increment patch operation. | | `Remove` | Remove patch operation. | | `Replace` | Replace patch operation. | | `Set` | Set patch operation. | ### `patch_operations[].path` Path. **Type**: `string` ```yaml # Examples: path: /foo/bar/baz ``` ### `patch_operations[].value_map` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) which should evaluate to a value of any type that is supported by CosmosDB. **Type**: `string` ```yaml # Examples: value_map: root = "blobfish" # --- value_map: root = 41 # --- value_map: root = true # --- value_map: root = json("blobfish").depth # --- value_map: root = [1, 2, 3] ``` ## CosmosDB emulator If you wish to run the CosmosDB emulator that is referenced in the documentation [here](https://learn.microsoft.com/en-us/azure/cosmos-db/linux-emulator), the following Docker command should do the trick: ```bash > docker run --rm -it -p 8081:8081 --name=cosmosdb -e AZURE_COSMOS_EMULATOR_PARTITION_COUNT=10 -e AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE=false mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator ``` Note: `AZURE_COSMOS_EMULATOR_PARTITION_COUNT` controls the number of partitions that will be supported by the emulator. The bigger the value, the longer it takes for the container to start up. Additionally, instead of installing the container self-signed certificate which is exposed via `https://localhost:8081/_explorer/emulator.pem`, you can run [mitmproxy](https://mitmproxy.org/) like so: ```bash > mitmproxy -k --mode "reverse:https://localhost:8081" ``` Then you can access the CosmosDB UI via `http://localhost:8080/_explorer/index.html` and use `http://localhost:8080` as the CosmosDB endpoint. --- # Page 116: azure_data_lake_gen2 **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/azure_data_lake_gen2.md --- # azure_data_lake_gen2 Sends message parts as files to an Azure Data Lake Gen2 filesystem. Each file is uploaded with the filename specified with the `path` field. This output writes files to an [Azure Data Lake Storage Gen2](https://learn.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction) file system. To set a different [`path`](#path) value (file name) for each file, use [function interpolations](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries), which are calculated per message of a batch. Supports multiple authentication methods but only one of the following is required: - `storage_connection_string` - `storage_account` and `storage_access_key` - `storage_account` and `storage_sas_token` - `storage_account` to access via [DefaultAzureCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DefaultAzureCredential) If multiple are set then the `storage_connection_string` is given priority. If the `storage_connection_string` does not contain the `AccountName` parameter, please specify it in the `storage_account` field. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. ```yml output: label: "" azure_data_lake_gen2: storage_account: "" storage_access_key: "" storage_connection_string: "" storage_sas_token: "" filesystem: "" # No default (required) path: ${!counter()}-${!timestamp_unix_nano()}.txt max_in_flight: 64 ``` ## Fields ### `filesystem` The name of the data lake storage file system you want to upload messages to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: filesystem: messages-${!timestamp("2006")} ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `path` The path (file name) of each message to upload to the data lake storage file system. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `${!counter()}-${!timestamp_unix_nano()}.txt` ```yaml # Examples: path: ${!counter()}-${!timestamp_unix_nano()}.json # --- path: ${!meta("kafka_key")}.json # --- path: ${!json("doc.namespace")}/${!json("doc.id")}.json ``` ### `storage_access_key` The access key for the storage account. Use this field along with `storage_account` for authentication. This field is ignored when the `storage_connection_string` field is populated. **Type**: `string` **Default**: `""` ### `storage_account` The storage account to access. This field is ignored when the `storage_connection_string` field is populated, unless the connection string does not contain the `AccountName` parameter. **Type**: `string` **Default**: `""` ### `storage_connection_string` The connection string for the storage account. This field is required if `storage_account` is not set. > 📝 **NOTE** > > If the `storage_connection_string` field does not contain the `AccountName` parameter value, specify it in the `storage_account` field. **Type**: `string` **Default**: `""` ### `storage_sas_token` The SAS token for the storage account. Use this field along with `storage_account` for authentication. This field is ignored when either the `storage_connection_string` or `storage_access_key` fields are populated. **Type**: `string` **Default**: `""` --- # Page 117: azure_queue_storage **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/azure_queue_storage.md --- # azure_queue_storage Sends messages to an Azure Storage Queue. Only one authentication method is required, `storage_connection_string` or `storage_account` and `storage_access_key`. If both are set then the `storage_connection_string` is given priority. In order to set the `queue_name` you can use function interpolations described [here](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries), which are calculated per message of a batch. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" azure_queue_storage: storage_account: "" storage_access_key: "" storage_connection_string: "" storage_sas_token: "" queue_name: "" # No default (required) max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" azure_queue_storage: storage_account: "" storage_access_key: "" storage_connection_string: "" storage_sas_token: "" queue_name: "" # No default (required) ttl: "" max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `max_in_flight` The maximum number of parallel message batches to have in flight at any given time. **Type**: `int` **Default**: `64` ### `queue_name` The name of the target Queue Storage queue. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `storage_access_key` The access key for the storage account. Use this field along with `storage_account` for authentication. This field is ignored when the `storage_connection_string` field is populated. **Type**: `string` **Default**: `""` ### `storage_account` The storage account to access. This field is ignored when the `storage_connection_string` field is populated, unless the connection string does not contain the `AccountName` parameter. **Type**: `string` **Default**: `""` ### `storage_connection_string` The connection string for the storage account. This field is required if `storage_account` is not set. > 📝 **NOTE** > > If the `storage_connection_string` field does not contain the `AccountName` parameter value, specify it in the `storage_account` field. **Type**: `string` **Default**: `""` ### `storage_sas_token` The SAS token for the storage account. Use this field along with `storage_account` for authentication. This field is ignored when either the `storage_connection_string` or `storage_access_key` fields are populated. **Type**: `string` **Default**: `""` ### `ttl` The TTL of each individual message as a duration string. Defaults to 0, meaning no retention period is set This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ```yaml # Examples: ttl: 60s # --- ttl: 5m # --- ttl: 36h ``` --- # Page 118: azure_table_storage **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/azure_table_storage.md --- # azure_table_storage Stores messages in an Azure Table Storage table. Only one authentication method is required, `storage_connection_string` or `storage_account` and `storage_access_key`. If both are set then the `storage_connection_string` is given priority. In order to set the `table_name`, `partition_key` and `row_key` you can use function interpolations described [here](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries), which are calculated per message of a batch. If the `properties` are not set in the config, all the `json` fields are marshalled and stored in the table, which will be created if it does not exist. The `object` and `array` fields are marshaled as strings. For example: The JSON message: ```json { "foo": 55, "bar": { "baz": "a", "bez": "b" }, "diz": ["a", "b"] } ``` Will store in the table the following properties: ```yml foo: '55' bar: '{ "baz": "a", "bez": "b" }' diz: '["a", "b"]' ``` It’s also possible to use function interpolations to get or transform the properties values. For example: ```yml properties: device: '${! json("device") }' timestamp: '${! json("timestamp") }' ``` ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" azure_table_storage: storage_account: "" storage_access_key: "" storage_connection_string: "" storage_sas_token: "" table_name: "" # No default (required) partition_key: "" row_key: "" properties: {} max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" azure_table_storage: storage_account: "" storage_access_key: "" storage_connection_string: "" storage_sas_token: "" table_name: "" # No default (required) partition_key: "" row_key: "" properties: {} transaction_type: INSERT max_in_flight: 64 timeout: 5s batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `max_in_flight` The maximum number of parallel message batches to have in flight at any given time. **Type**: `int` **Default**: `64` ### `partition_key` The partition key. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ```yaml # Examples: partition_key: ${! json("date") } ``` ### `properties` A map of properties to store into the table. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` **Default**: `{}` ### `row_key` The row key. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ```yaml # Examples: row_key: ${! json("device")}-${!uuid_v4() } ``` ### `storage_access_key` The access key for the storage account. Use this field along with `storage_account` for authentication. This field is ignored when the `storage_connection_string` field is populated. **Type**: `string` **Default**: `""` ### `storage_account` The storage account to access. This field is ignored when the `storage_connection_string` field is populated, unless the connection string does not contain the `AccountName` parameter. **Type**: `string` **Default**: `""` ### `storage_connection_string` The connection string for the storage account. This field is required if `storage_account` is not set. > 📝 **NOTE** > > If the `storage_connection_string` field does not contain the `AccountName` parameter value, specify it in the `storage_account` field. **Type**: `string` **Default**: `""` ### `storage_sas_token` The SAS token for the storage account. Use this field along with `storage_account` for authentication. This field is ignored when either the `storage_connection_string` or `storage_access_key` fields are populated. **Type**: `string` **Default**: `""` ### `table_name` The table to store messages into. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: table_name: ${! meta("kafka_topic") } # --- table_name: ${! json("table") } ``` ### `timeout` This field has no effect. The output parses the value but does not apply it to write requests. **Type**: `string` **Default**: `5s` ### `transaction_type` Type of transaction operation. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `INSERT` **Options**: `INSERT`, `INSERT_MERGE`, `INSERT_REPLACE`, `UPDATE_MERGE`, `UPDATE_REPLACE`, `DELETE` ```yaml # Examples: transaction_type: ${! json("operation") } # --- transaction_type: ${! meta("operation") } # --- transaction_type: INSERT ``` --- # Page 119: broker **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/broker.md --- # broker Routes messages to multiple child outputs using a range of brokering [Patterns](#patterns). The `broker` output doesn’t send messages anywhere by itself. It wraps other outputs and controls how messages are delivered across them. Use it to fan out the same message to multiple destinations, such as publishing events to Kafka while also writing them to a database, or to spread messages across a pool of outputs for load balancing. The `pattern` field decides whether each message goes to all outputs or to one of them, and whether writes happen in parallel or in sequence. > 📝 **NOTE** > > The name `broker` refers to the brokering pattern, not to a Redpanda broker. [Processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) can be listed to apply across individual outputs or all outputs: ```yaml output: broker: pattern: fan_out outputs: - resource: foo - resource: bar # Processors only applied to messages sent to bar. processors: - resource: bar_processor # Processors applied to messages sent to all brokered outputs. processors: - resource: general_processor ``` #### Common ```yml output: label: "" broker: pattern: fan_out outputs: [] # No default (required) batching: count: 0 byte_size: 0 period: "" check: "" ``` #### Advanced ```yml output: label: "" broker: copies: 1 pattern: fan_out outputs: [] # No default (required) batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `copies` The number of copies of each configured output to spawn. **Type**: `int` **Default**: `1` ### `outputs[]` A list of child outputs to broker. **Type**: `array` ### `pattern` The brokering pattern to use. **Type**: `string` **Default**: `fan_out` **Options**: `fan_out`, `fan_out_fail_fast`, `fan_out_sequential`, `fan_out_sequential_fail_fast`, `round_robin`, `greedy` ## Patterns The broker pattern determines how messages are distributed across outputs. Use `fan_out` (the default) when every output should receive every message. Use `round_robin` or `greedy` when you want to distribute messages across outputs for load balancing rather than duplication. The available patterns are: ### `fan_out` With the fan out pattern all outputs will be sent every message that passes through Redpanda Connect in parallel. If an output applies back pressure it will block all subsequent messages, and if an output fails to send a message it will be retried continuously until completion or service shut down. This mechanism is in place in order to prevent one bad output from causing a larger retry loop that results in a good output from receiving unbounded message duplicates. Sometimes it is useful to disable the back pressure or retries of certain fan out outputs and instead drop messages that have failed or were blocked. In this case you can wrap outputs with a [`drop_on` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/drop_on/). ### `fan_out_fail_fast` The same as the `fan_out` pattern, except that output failures will not be automatically retried. This pattern should be used with caution as busy retry loops could result in unlimited duplicates being introduced into the non-failure outputs. ### `fan_out_sequential` Similar to the fan out pattern except outputs are written to sequentially, meaning an output is only written to once the preceding output has confirmed receipt of the same message. If an output applies back pressure it will block all subsequent messages, and if an output fails to send a message it will be retried continuously until completion or service shut down. This mechanism is in place in order to prevent one bad output from causing a larger retry loop that results in a good output from receiving unbounded message duplicates. ### `fan_out_sequential_fail_fast` The same as the `fan_out_sequential` pattern, except that output failures will not be automatically retried. This pattern should be used with caution as busy retry loops could result in unlimited duplicates being introduced into the non-failure outputs. ### `round_robin` With the round robin pattern each message will be assigned a single output following their order. If an output applies back pressure it will block all subsequent messages. If an output fails to send a message then the message will be re-attempted with the next input, and so on. ### `greedy` The greedy pattern results in higher output throughput at the cost of potentially disproportionate message allocations to those outputs. Each message is sent to a single output, which is determined by allowing outputs to claim messages as soon as they are able to process them. This results in certain faster outputs potentially processing more messages at the cost of slower outputs. --- # Page 120: cache **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/cache.md --- # cache Stores each message in a [cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/). Caches are configured as [resources](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/), where there’s a wide variety to choose from. The `target` field must reference a configured cache resource label like follows: ```yaml output: cache: target: foo key: ${!json("document.id")} cache_resources: - label: foo memcached: addresses: - localhost:11211 default_ttl: 60s ``` In order to create a unique `key` value per item you should use function interpolations described in [Bloblang queries](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. ### Common ```yml output: label: "" cache: target: "" # No default (required) key: ${!timestamp_unix_nano()}-${!uuid_v4()} max_in_flight: 64 ``` ### Advanced ```yml output: label: "" cache: target: "" # No default (required) key: ${!timestamp_unix_nano()}-${!uuid_v4()} ttl: "" # No default (optional) max_in_flight: 64 ``` ## Fields ### `key` The key to store messages by, function interpolation should be used in order to derive a unique key for each message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `${!timestamp_unix_nano()}-${!uuid_v4()}` ```yaml # Examples: key: ${!timestamp_unix_nano()}-${!uuid_v4()} # --- key: ${!json("doc.id")} # --- key: ${!meta("kafka_key")} ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `target` The target cache to store messages in. **Type**: `string` ### `ttl` The TTL of each individual item as a duration string. After this period an item will be eligible for removal during the next compaction. Not all caches support per-key TTLs, and those that do not will fall back to their generally configured TTL setting. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: ttl: 60s # --- ttl: 5m # --- ttl: 36h ``` --- # Page 121: cyborgdb **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/cyborgdb.md --- # cyborgdb Inserts items into a CyborgDB encrypted vector index. This output allows you to write vectors to a CyborgDB encrypted index. CyborgDB provides end-to-end encrypted vector storage with automatic dimension detection and index optimization. All vector data is encrypted client-side before being sent to the server, ensuring complete data privacy. The encryption key never leaves your infrastructure. #### Common ```yaml output: label: "" cyborgdb: max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" host: "" # No default (required) api_key: "" # No default (required) index_name: redpanda-vectors index_key: "" # No default (required) operation: upsert id: "" # No default (required) vector_mapping: "" # No default (optional) metadata_mapping: "" # No default (optional) ``` #### Advanced ```yaml output: label: "" cyborgdb: max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) host: "" # No default (required) api_key: "" # No default (required) index_name: redpanda-vectors index_key: "" # No default (required) create_if_missing: false operation: upsert id: "" # No default (required) vector_mapping: "" # No default (optional) metadata_mapping: "" # No default (optional) ``` ## Fields ### `api_key` The API key for authenticating with the CyborgDB service. This key identifies your account and provides access to your CyborgDB indexes. Keep this key secure and avoid exposing it in logs or version control. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `create_if_missing` Whether to create the index if it doesn’t exist. When enabled, CyborgDB automatically detects the vector dimensions from your data and optimizes the index configuration for performance. This is useful for development and testing environments. **Type**: `bool` **Default**: `false` ### `host` The host URL for the CyborgDB instance, including the port number if required. The scheme is optional: if the value does not start with `http://` or `https://`, this output uses `https://`. **Type**: `string` ```yaml # Examples: host: api.cyborg.com # --- host: localhost:8000 ``` ### `id` The unique identifier for each vector entry, for example `${! json("id") }`. This ID is used to update existing vectors during upsert operations or to specify which vectors to delete. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `index_key` The base64-encoded encryption key for the CyborgDB index. This key must be exactly 32 bytes when decoded from base64. All vector data is encrypted client-side using this key before transmission, ensuring complete data privacy. Store this key securely as it cannot be recovered if lost. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: index_key: your-base64-encoded-32-byte-key ``` ### `index_name` The name of the CyborgDB index to write vectors to. If the index doesn’t exist and `create_if_missing` is enabled, CyborgDB will create it automatically with optimized settings based on your data. **Type**: `string` **Default**: `redpanda-vectors` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `metadata_mapping` An optional [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that extracts metadata to associate with the vector entry. The metadata can contain any JSON-serializable data that helps identify or categorize the vector. This data is stored encrypted alongside the vector. **Type**: `string` ```yaml # Examples: metadata_mapping: root = @ # --- metadata_mapping: root = metadata() # --- metadata_mapping: 'root = {"summary": this.summary, "category": this.category}' ``` ### `operation` The operation to perform against the CyborgDB index. Supported operations: - `upsert`: Insert new vectors or update existing ones (requires `vector_mapping`) - `delete`: Remove vectors from the index by `id` **Type**: `string` **Default**: `upsert` **Options**: `upsert`, `delete` ### `vector_mapping` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that extracts the vector from the message. The result must be an array of floating-point numbers representing the vector embeddings. This field is required for the `upsert` operation. **Type**: `string` ```yaml # Examples: vector_mapping: root = this.embeddings_vector # --- vector_mapping: root = [1.2, 0.5, 0.76] ``` --- # Page 122: drop_on **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/drop_on.md --- # drop_on Attempts to write messages to a child output and if the write fails for one of a list of configurable reasons the message is dropped (acked) instead of being reattempted (or nacked). Regular Redpanda Connect outputs will apply back pressure when downstream services aren’t accessible, and Redpanda Connect retries (or nacks) all messages that fail to be delivered. However, in some circumstances, or for certain output types, we instead might want to relax these mechanisms, which is when this output becomes useful. ```yml output: label: "" drop_on: error: false error_patterns: [] # No default (optional) back_pressure: "" # No default (optional) output: {} # No default (required) ``` ## Fields ### `back_pressure` An optional duration string that determines the maximum length of time to wait for a given message to be accepted by the child output before the message should be dropped instead. The most common reason for an output to block is when waiting for a lost connection to be re-established. Once a message has been dropped due to back pressure all subsequent messages are dropped immediately until the output is ready to process them again. Note that if `error` is set to `false` and this field is specified then messages dropped due to back pressure will return an error response (are nacked or reattempted). **Type**: `string` ```yaml # Examples: back_pressure: 30s # --- back_pressure: 1m ``` ### `error` Whether messages should be dropped when the child output returns an error of any type. For example, this could be when an `http_client` output gets a 4XX response code. In order to instead drop only on specific error patterns use the `error_matches` field instead. **Type**: `bool` **Default**: `false` ### `error_patterns[]` A list of regular expressions (re2) where if the child output returns an error that matches any part of any of these patterns the message will be dropped. **Type**: `array` ```yaml # Examples: error_patterns: - "and that was really bad$" # --- error_patterns: - "roughly [0-9]+ issues occurred" ``` ### `output` A child output to wrap with this drop mechanism. **Type**: `output` ## Examples ### Dropping failed HTTP requests In this example we have a fan_out broker, where we guarantee delivery to our Kafka output, but drop messages if they fail our secondary HTTP client output. ```yaml output: broker: pattern: fan_out outputs: - kafka: addresses: [ foobar:6379 ] topic: foo - drop_on: error: true output: http_client: url: http://example.com/foo/messages verb: POST ``` ### Dropping from outputs that cannot connect Most outputs that attempt to establish and long-lived connection will apply back-pressure when the connection is lost. The following example has a websocket output where if it takes longer than 10 seconds to establish a connection, or recover a lost one, pending messages are dropped. ```yaml output: drop_on: back_pressure: 10s output: websocket: url: ws://example.com/foo/messages ``` --- # Page 123: drop **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/drop.md --- # drop Drops all messages. The `drop` output acknowledges each message as soon as it receives it and then discards it, without errors or side effects. Because it adds almost no overhead, it’s useful for measuring input and processing throughput without an output bottleneck, for temporarily disabling output while you develop a pipeline, for discarding unwanted messages in a [`switch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/switch/) output, and as the final fallback in a [`fallback`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/fallback/) output. Use this reference to: - Look up drop output syntax and configuration - Find examples of drop in conditional routing - Identify use cases for drop output in pipelines ```yaml output: label: "" drop: {} ``` ## Examples ### Conditional filtering Use `drop` with the [`switch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/switch/) output to conditionally discard messages: ```yaml output: switch: cases: - check: this.type == "error" output: label: error_sink kafka: addresses: ["kafka:9092"] topic: errors - check: this.type == "debug" output: label: drop_debug drop: {} # Don't process debug messages in production - output: label: main_sink kafka: addresses: ["kafka:9092"] topic: events ``` ### Final fallback after a dead letter topic Use `drop` as the last output in a [`fallback`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/fallback/) chain, after a dead letter topic, so a message that neither output accepts is discarded instead of blocking the pipeline: ```yaml output: fallback: - redpanda: seed_brokers: ["redpanda:9092"] topic: primary_topic max_in_flight: 1 - redpanda: seed_brokers: ["redpanda:9092"] topic: dlq_topic - drop: {} # Last resort: drop if both outputs fail ``` ### Testing input throughput Measure how fast your input can consume data without output bottlenecks: ```yaml input: kafka: addresses: ["kafka:9092"] topics: ["test"] output: drop: {} # Measure input consumption speed without output overhead ``` For more patterns on message routing, filtering, and when to use `drop` vs. other approaches, see the [Message Routing Patterns](https://docs.redpanda.com/connect/cookbooks/message_routing/) cookbook. --- # Page 124: elasticsearch_v8 **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/elasticsearch_v8.md --- # elasticsearch_v8 Publishes messages into an Elasticsearch index. If the index does not exist then it is created with a dynamic mapping. This output publishes messages into an [Elasticsearch index](https://www.elastic.co/docs/manage-data/data-store/index-basics) using the [go-elasticsearch/v8](https://github.com/elastic/go-elasticsearch) client library. For the breaking changes from earlier versions, see [Elastic’s Migrating to 8.0 guide](https://www.elastic.co/guide/en/elasticsearch/reference/current/migrating-8.0.html#breaking_80_rest_api_changes). The [`id`](#id), [`index`](#index), [`action`](#action), [`pipeline`](#pipeline), and [`routing`](#routing) fields can be dynamically set using [function interpolations](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). When sending batched messages these interpolations are performed per message part. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). To help configure your own `elasticsearch_v8` output, this page includes [example pipeline configurations](#example-pipelines). > 📝 **NOTE** > > If the service only accepts connections from allowlisted IP addresses, add your cluster’s egress addresses to its allowlist before you deploy the pipeline. On BYOC clusters, see [Allow Pipeline Traffic Through External Firewalls](https://docs.redpanda.com/cloud-data-platform/networking/connect-external-allowlist/) to find the addresses. For Dedicated or Serverless clusters, contact Redpanda support for the addresses. ### Common ```yml output: label: "" elasticsearch_v8: urls: [] # No default (required) index: "" # No default (required) action: "" # No default (required) id: "" # No default (required) max_in_flight: 64 api_key: "" batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" elasticsearch_v8: urls: [] # No default (required) index: "" # No default (required) action: "" # No default (required) id: "" # No default (required) pipeline: "" routing: "" retry_on_conflict: 0 tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] max_in_flight: 64 api_key: "" basic_auth: enabled: false username: "" password: "" batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `action` The action to perform on each document. This field must resolve to one of the following action types: `index`, `update`, `delete`, `create`, or `upsert`. For more information on how the `update` action works, see the `Updating Documents` example. For examples of how to use the `create` and `upsert` actions, see the `Create Documents` and `Upserting Documents` examples. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `api_key` An API key to authenticate with. If set, it supersedes basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `basic_auth` Configure basic authentication credentials for connecting to Elasticsearch. When enabled, these credentials are sent with each request to authenticate with the cluster. **Type**: `object` ### `basic_auth.enabled` Whether to send the `username` and `password` credentials with each request. **Type**: `bool` **Default**: `false` ### `basic_auth.password` A password to authenticate with. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `basic_auth.username` A username to authenticate as. **Type**: `string` **Default**: `""` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `id` The ID for indexed messages. Use [function interpolations](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries) to dynamically create a unique ID for each message. **Type**: `string` ```yaml # Examples: id: ${!counter()}-${!timestamp_unix()} ``` ### `index` The Elasticsearch index where messages are published. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `pipeline` The ID of an optional ingest pipeline to preprocess incoming documents before they are indexed. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `retry_on_conflict` The number of times to retry an update operation when a version conflict occurs. **Type**: `int` **Default**: `0` ### `routing` A custom routing value for each document, which determines the shard it is stored on. When empty, the document ID is used. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `urls[]` A list of URLs to connect to. If an item in the list contains commas, it is split into multiple URLs. **Type**: `array` ```yaml # Examples: urls: - "http://localhost:9200" ``` ## Example pipelines ### Update documents To update documents in the target index, the top level of the request body must include at least one of the following fields: - `doc`: Performs partial updates on a document. - `upsert`: Updates an existing document or inserts a document if it doesn’t exist. - `script`: Performs an update using a scripting language, such as [Elasticsearch’s Painless scripting language](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting-painless.html). The following examples show how to configure mapping processors with this output to achieve different types of updates. Example 1: Partial document update ```yaml output: processors: # Sets the metadata ID field to the message ID then # performs a partial update on the document. - mapping: | meta id = this.id root.doc = this elasticsearch_v8: urls: [localhost:9200] # The URL of the Elasticsearch server. index: my_target_index # The name of the Elasticsearch index. id: ${! @id } # Sets the document ID to the value of the metadata ID field. action: update # The action to perform on each document. ``` Example 2: Scripted update ```yaml output: processors: # Sets the metadata ID field to the message ID then # increments the counter field by `1` using a script. - mapping: | meta id = this.id root.script.source = "ctx._source.counter += 1" elasticsearch_v8: urls: [localhost:9200] # The URL of the Elasticsearch server. index: my_target_index # The name of the Elasticsearch index. id: ${! @id } # Sets the document ID to the value of the metadata ID field. action: update # The action to perform on each document. ``` Example 3: Upsert ```yaml output: processors: # Sets the metadata ID field to the message ID. # If the product with the specified ID exists, update its product_price to 100. # If the document does not exist, insert a new document with the ID set to 1 # and the `product_price` set to 50. - mapping: | meta id = this.id root.doc.product_price = 100 root.upsert.product_price = 50 elasticsearch_v8: urls: [localhost:9200] # The URL of the Elasticsearch server. index: my_target_index # The name of the Elasticsearch index. id: ${! @id } # Sets the document ID to the value of the metadata ID field. action: update # The action to perform on each document. ``` For more information on the structures and behaviors of `doc`, `upsert`, and `script` fields, see the [Elasticsearch Update API](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html). ### Index documents from Redpanda Reads messages from a Redpanda cluster and writes them to an Elasticsearch index using a field from the message as the document ID. ```yaml # Reads messages from a Redpanda cluster. input: redpanda: seed_brokers: [localhost:19092] # The address of the Redpanda broker. topics: ["product_code"] # The topic to consume messages from. consumer_group: "rpcn3" # The consumer group ID. processors: # Sets the metadata ID field to the message ID and # sets the root of the message to the message content. - mapping: | meta id = this.id root = this # Writes messages to the specified Elasticsearch index. output: elasticsearch_v8: urls: ['http://localhost:9200'] # The URL of the Elasticsearch server. index: "product_code" # The name of the Elasticsearch index. action: "index" # The action to perform on each document. id: ${! meta("id") } # Sets the document ID to the value of the metadata ID field. ``` ### Index documents from AWS S3 Reads messages from a AWS S3 bucket and writes them to an Elasticsearch index using the S3 key as the ID for the Elasticsearch document. ```yaml # Reads messages from an AWS S3 bucket. input: aws_s3: bucket: "my_bucket" # The name of the S3 bucket. prefix: "prod_inventory/" # A prefix to filter objects in the bucket. scanner: to_the_end: {} # Scans the bucket to the end. # Writes messages to the specified Elasticsearch index. output: elasticsearch_v8: urls: ['http://localhost:9200'] # The URL of the Elasticsearch server. index: "current_prod_inventory" # The name of the Elasticsearch index. action: "index" # The action to perform on each document. id: ${! meta("s3_key") } # Sets the document ID to the S3 key. ``` --- # Page 125: fallback **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/fallback.md --- # fallback Attempts to send each message to a child output, starting from the first output on the list. If an output attempt fails then the next output in the list is attempted, and so on. This pattern is useful for triggering events in the case where certain output targets have broken. For example, if you had an output type `http_client` but wished to reroute messages whenever the endpoint becomes unreachable you could use this pattern: ```yaml output: fallback: - http_client: url: http://foo:4195/post/might/become/unreachable retries: 3 retry_period: 1s - http_client: url: http://bar:4196/somewhere/else retries: 3 retry_period: 1s processors: - mapping: 'root = "failed to send this message to foo: " + content()' - file: path: /usr/local/benthos/everything_failed.jsonl ``` ## Metadata When a given output fails the message routed to the following output will have a metadata value named `fallback_error` containing a string error message outlining the cause of the failure. The content of this string will depend on the particular output and can be used to enrich the message or provide information used to broker the data to an appropriate output using something like a `switch` output. ## Batching When an output within a fallback sequence uses batching, like so: ```yaml output: fallback: - aws_dynamodb: table: foo string_columns: id: ${!json("id")} content: ${!content()} batching: count: 10 period: 1s - file: path: /usr/local/benthos/failed_stuff.jsonl ``` Redpanda Connect makes a best attempt at inferring which specific messages of the batch failed, and only propagates those individual messages to the next fallback tier. However, depending on the output and the error returned it is sometimes not possible to determine the individual messages that failed, in which case the whole batch is passed to the next tier in order to preserve at-least-once delivery guarantees. ```yml output: label: "" fallback: [] ``` --- # Page 126: gcp_bigquery_write_api **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/gcp_bigquery_write_api.md --- # gcp_bigquery_write_api Streams data into BigQuery using the Storage Write API. Writes messages to a BigQuery table using the Storage Write API. This provides higher throughput and lower latency than the legacy streaming API or load jobs. Messages can be formatted as JSON (default) or raw protobuf bytes. When using JSON format the component automatically fetches the table schema and converts each message to the corresponding proto representation. > ⚠️ **WARNING** > > protojson encodes int64 and uint64 values as strings, bytes as base64-encoded strings, and timestamps as RFC 3339 strings. JSON messages must follow these conventions (for example, `"age": "30"`, `"data": "aGVsbG8="`, `"created_at": "2026-01-02T15:04:05Z"`); otherwise the write will fail with an unmarshalling error. When batching is enabled the table name is resolved from the first message in each batch. All messages in the same batch are written to that table. The interpolated table name is sanitized for BigQuery: dots, hyphens, slashes and whitespace are replaced with underscores, non-ASCII-alphanumeric characters are stripped, leading digits are prefixed with `_`, and the result is truncated to 1024 characters. A name that sanitizes to the empty string is rejected as a permanent error. ## Write modes The `write_mode` field selects between two write paths: - `default_stream` (default): the multiplexed default stream. Lowest latency, at-least-once semantics. - `pending_stream`: a fresh pending stream is allocated per batch; rows are written with sequential offsets, the stream is finalized, then atomically committed. Provides exactly-once semantics within a single committed batch. ## Auto-create When `auto_create_table` is true, the output creates missing tables on the fly using the configured `schema`, `time_partitioning`, and `clustering`. `AlreadyExists` errors from concurrent creators are treated as success. When the table name is interpolated, every auto-created table receives the same configuration. ## Exactly-once caveat The exactly-once guarantee of `pending_stream` is "exactly-once within a stream". If a BatchCommitWriteStreams RPC succeeds but its response is lost to a network failure, benthos retries the batch through a new pending stream and the data lands twice. This is a fundamental limitation of the BigQuery Storage Write API exactly-once contract and applies to every implementation. ## CDC migration When migrating from the load-jobs based `gcp_bigquery` output to CDC mode, see the [CDC migration guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bigquery_cdc_migration/). ### Common ```yml output: label: "" gcp_bigquery_write_api: project: "" dataset: "" # No default (required) table: "" # No default (required) message_format: json change_type: "" # No default (optional) change_sequence_number: "" # No default (optional) primary_keys: [] # No default (optional) max_in_flight: 4 batching: count: 0 byte_size: 0 period: "" check: "" credentials_json: "" ``` ### Advanced ```yml output: label: "" gcp_bigquery_write_api: project: "" dataset: "" # No default (required) table: "" # No default (required) message_format: json write_mode: default_stream change_type: "" # No default (optional) change_sequence_number: "" # No default (optional) primary_keys: [] # No default (optional) auto_create_table: false schema: [] time_partitioning: type: "" # No default (optional) field: "" expiration: 0s require_filter: false clustering: [] max_in_flight: 4 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) credentials_json: "" target_principal: "" delegates: [] stream_idle_timeout: 5m stream_sweep_interval: 1m max_cached_streams: 1024 schema_resolve_timeout: 15s schema_evolution_timeout: 30s endpoint: http: "" grpc: "" ``` ## Fields ### `auto_create_table` If true and the target table does not exist, the output creates it using the configured `schema`, `time_partitioning`, and `clustering`. AlreadyExists errors from concurrent creators are treated as success. When the table name is interpolated, every auto-created table receives the same schema and partition/clustering settings. **Type**: `bool` **Default**: `false` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `change_sequence_number` Optional Bloblang expression resolving to the `_CHANGE_SEQUENCE_NUMBER` pseudo-column value. Format: 1 to 4 sections of 1 to 16 hexadecimal characters each, separated by `/`. Example: `${! metadata("scn") }` or `${! "0/0/0/0" }`. When unset, BigQuery resolves ordering by arrival time. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `change_type` Bloblang expression resolving to the `_CHANGE_TYPE` pseudo-column value for each row. Must resolve to `UPSERT` or `DELETE` (case-insensitive). Required when `write_mode` is `upsert` or `upsert_delete`. Example: `${! metadata("operation") }`. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `clustering[]` Optional clustering columns (up to 4) applied during `auto_create_table`. All names must appear in `schema`. **Type**: `array` **Default**: `[]` ### `credentials_json` An optional JSON string containing GCP credentials. If empty, credentials are loaded from the environment. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `dataset` The BigQuery dataset ID. **Type**: `string` ### `delegates[]` Optional delegation chain for chained service account impersonation. Each service account must be granted roles/iam.serviceAccountTokenCreator on the next in the chain. **Type**: `array` **Default**: `[]` ### `endpoint` Optional endpoint overrides for the BigQuery and Storage Write API clients. **Type**: `object` ### `endpoint.grpc` Override the BigQuery Storage gRPC endpoint. Useful for local emulators. **Type**: `string` **Default**: `""` ### `endpoint.http` Override the BigQuery HTTP endpoint. Useful for local emulators. **Type**: `string` **Default**: `""` ### `max_cached_streams` Soft cap on the number of cached streams. When the cache exceeds this size, the least-recently-used stream is evicted. Set to 0 for unlimited (rely on idle-timeout sweeping only). Relevant when the table field uses interpolation to route to many tables. **Type**: `int` **Default**: `1024` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `4` ### `message_format` The format of input messages. Use 'json' to have the component convert JSON to proto automatically. Use 'protobuf' to supply raw proto-encoded bytes. **Type**: `string` **Default**: `json` **Options**: `json`, `protobuf` ### `primary_keys[]` Optional list of primary-key column names. Required when `auto_create_table` is true and `write_mode` is `upsert` or `upsert_delete`. A pre-existing table must already declare its PRIMARY KEY: this field cannot add one; when both are set they must match exactly (same columns, same order). Up to 16 columns; composite keys are supported in the same order they are listed. **Type**: `array` ### `project` The GCP project ID. If empty, the project is auto-detected from the environment. **Type**: `string` **Default**: `""` ### `schema[]` Column definitions used by `auto_create_table`. Required when `auto_create_table` is true. **Type**: `array` **Default**: `[]` ### `schema[].fields[]` For RECORD columns, the list of nested fields. Same shape as the top-level schema list. **Type**: `array` ### `schema[].mode` Column mode: NULLABLE (default), REQUIRED, or REPEATED. **Type**: `string` **Default**: `NULLABLE` ### `schema[].name` Column name. **Type**: `string` ### `schema[].type` BigQuery column type (STRING, BYTES, INTEGER/INT64, FLOAT/FLOAT64, NUMERIC, BIGNUMERIC, BOOLEAN/BOOL, TIMESTAMP, DATE, TIME, DATETIME, GEOGRAPHY, JSON, RECORD). **Type**: `string` ### `schema_evolution_timeout` Total time budget for a single schema evolution attempt (Metadata + Update across all CAS retries on HTTP 412). Bounds how long the WriteBatch retry loop can be starved by a wedged backend. **Type**: `string` **Default**: `30s` ### `schema_resolve_timeout` How long a single BigQuery table-metadata fetch can run before being aborted. Coalesced concurrent resolves share one fetch, so this bounds the time a wedged backend can stall every batch routing to the same table. On the auto_create_table path the budget covers Metadata→Create→Metadata, so it needs to absorb transient backend slowness on top of the metadata fetch itself. **Type**: `string` **Default**: `15s` ### `stream_idle_timeout` How long a cached stream can remain unused before being closed. Relevant when the table field uses interpolation to route to many tables. **Type**: `string` **Default**: `5m` ### `stream_sweep_interval` How often to check for idle streams to close. **Type**: `string` **Default**: `1m` ### `table` The BigQuery table ID. Supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). When batching, resolved from the first message in each batch. **Type**: `string` ### `target_principal` Service account email to impersonate. When set, the output obtains tokens acting as this service account. Requires the caller to have roles/iam.serviceAccountTokenCreator on the target. **Type**: `string` **Default**: `""` ### `time_partitioning` Optional time-partitioning settings applied during `auto_create_table`. Setting `type` is the trigger: when omitted, the block is treated as absent. **Type**: `object` ### `time_partitioning.expiration` Optional partition expiration. Zero means no expiration. **Type**: `string` **Default**: `0s` ### `time_partitioning.field` Column to partition on. Must be of type DATE, TIMESTAMP, or DATETIME. If empty, the table uses ingestion-time partitioning (`_PARTITIONTIME`). **Type**: `string` **Default**: `""` ### `time_partitioning.require_filter` If true, queries against the table must filter on the partition column. **Type**: `bool` **Default**: `false` ### `time_partitioning.type` Partitioning granularity. **Type**: `string` **Options**: `DAY`, `HOUR`, `MONTH`, `YEAR` ### `write_mode` How the output writes to BigQuery. `default_stream` uses the multiplexed default stream (at-least-once, lowest latency). `pending_stream` allocates a per-batch pending stream that commits atomically, providing exactly-once semantics within a single committed batch. `upsert` writes UPSERT-only rows to a BigQuery CDC-enabled table; the target table must have a PRIMARY KEY. `upsert_delete` allows both UPSERT and DELETE rows. Both CDC modes use the default stream as required by BigQuery. **Type**: `string` **Default**: `default_stream` **Options**: `default_stream`, `pending_stream`, `upsert`, `upsert_delete` --- # Page 127: gcp_bigquery **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/gcp_bigquery.md --- # gcp_bigquery Sends messages as new rows to a Google Cloud BigQuery table. ## Credentials By default Redpanda Connect will use a shared credentials file when connecting to GCP services. You can find out more in [GCP credentials](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/gcp/). ## Format This output currently supports only CSV, NEWLINE_DELIMITED_JSON and PARQUET, formats. Learn more about how to use GCP BigQuery with them here: - [`NEWLINE_DELIMITED_JSON`](https://cloud.google.com/bigquery/docs/loading-data-cloud-storage-json) - [`CSV`](https://cloud.google.com/bigquery/docs/loading-data-cloud-storage-csv) - [`PARQUET`](https://cloud.google.com/bigquery/docs/loading-data-cloud-storage-parquet) Each message may contain multiple elements separated by newlines. For example a single message containing: ```json {"key": "1"} {"key": "2"} ``` Is equivalent to two separate messages: ```json {"key": "1"} ``` And: ```json {"key": "2"} ``` The same is true for the CSV format. ### CSV For the CSV format when the field `csv.header` is specified a header row will be inserted as the first line of each message batch. If this field is not provided then the first message of each message batch must include a header line. ### Parquet For parquet, the data can be encoded using the [`parquet_encode`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/parquet_encode/) processor and each message that is sent to the output must be a full parquet message. For example: ```yaml input: generate: mapping: | root = { "foo": random_int(), "bar": uuid_v4(), "time": now(), } interval: 0 count: 1000 batch_size: 1000 pipeline: processors: - parquet_encode: schema: - name: foo type: INT64 - name: bar type: UTF8 - name: time type: UTF8 default_compression: zstd output: gcp_bigquery: project: "${PROJECT}" dataset: "my_bq_dataset" table: "redpanda_connect_ingest" format: PARQUET ``` ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" gcp_bigquery: project: "" job_project: "" dataset: "" # No default (required) table: "" # No default (required) format: NEWLINE_DELIMITED_JSON max_in_flight: 64 job_labels: {} credentials_json: "" csv: header: [] field_delimiter: "," batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" gcp_bigquery: project: "" job_project: "" dataset: "" # No default (required) table: "" # No default (required) format: NEWLINE_DELIMITED_JSON max_in_flight: 64 write_disposition: WRITE_APPEND create_disposition: CREATE_IF_NEEDED ignore_unknown_values: false max_bad_records: 0 auto_detect: false job_labels: {} credentials_json: "" csv: header: [] field_delimiter: "," allow_jagged_rows: false allow_quoted_newlines: false encoding: UTF-8 skip_leading_rows: 1 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `auto_detect` Whether this component automatically infers the options and schema for `CSV` and `NEWLINE_DELIMITED_JSON` sources. If this value is set to `false` and the destination table doesn’t exist, the output throws an insertion error as it is unable to insert data. > ⚠️ **CAUTION** > > This field delegates schema detection to the GCP BigQuery service. For the `CSV` format, values like `no` may be treated as booleans. **Type**: `bool` **Default**: `false` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `create_disposition` Specifies the circumstances under which a destination table is created. - Use `CREATE_IF_NEEDED` to create the destination table if it does not already exist. Tables are created atomically on successful completion of a job. - Use `CREATE_NEVER` if the destination table must already exist. Tables are not created automatically. **Type**: `string` **Default**: `CREATE_IF_NEEDED` **Options**: `CREATE_IF_NEEDED`, `CREATE_NEVER` ### `credentials_json` Sets the [Google Service Account Credentials JSON](https://developers.google.com/workspace/guides/create-credentials#create_credentials_for_a_service_account) (optional). > ⚠️ **WARNING** > > When using [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries) to populate this field, wrap the function in single quotes, not double quotes. For example, use `'$\{secrets.GCP_CREDENTIALS_JSON}'` instead of `"$\{secrets.GCP_CREDENTIALS_JSON}"`. Double quotes cause JSON parsing errors because the credentials already contain JSON content. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `csv` Specify how CSV data is interpreted. **Type**: `object` ### `csv.allow_jagged_rows` Set to `true` to tolerate missing trailing optional columns in CSV data. Missing values are treated as nulls. **Type**: `bool` **Default**: `false` ### `csv.allow_quoted_newlines` Whether quoted data sections containing new lines are allowed when reading CSV data. **Type**: `bool` **Default**: `false` ### `csv.encoding` The character encoding of CSV data. **Type**: `string` **Default**: `UTF-8` **Options**: `UTF-8`, `ISO-8859-1` ### `csv.field_delimiter` The separator for fields in a CSV file. The output uses this value when reading or exporting data. **Type**: `string` **Default**: `,` ### `csv.header[]` A list of values to use as the header for each batch of messages. If not specified, the first line of each message is used as the header. **Type**: `array` **Default**: `[]` ### `csv.skip_leading_rows` The number of rows at the top of a CSV file that BigQuery will skip when reading data. The default value is `1`, which allows Redpanda Connect to add the specified header in the first line of each batch sent to BigQuery. **Type**: `int` **Default**: `1` ### `dataset` The BigQuery Dataset ID. **Type**: `string` ### `format` The format of each incoming message. **Type**: `string` **Default**: `NEWLINE_DELIMITED_JSON` **Options**: `NEWLINE_DELIMITED_JSON`, `CSV`, `PARQUET` ### `ignore_unknown_values` Set this value to `true` to tolerate values that do not match the schema. Unknown values are ignored: - For the `CSV` format, extra values at the end of a line are ignored. - For the `NEWLINE_DELIMITED_JSON` format, values that do not match any column name are ignored. By default, this value is set to `false`, and records containing unknown values are treated as bad records. Use the `max_bad_records` field to customize how bad records are handled. **Type**: `bool` **Default**: `false` ### `job_labels` A map of labels to add to the load job. **Type**: `object` **Default**: `{}` ### `job_project` Specify the project ID in which jobs are executed. If not set, the `project` value is used. **Type**: `string` **Default**: `""` ### `max_bad_records` The maximum number of bad records that BigQuery ignores when reading data. This includes records with unknown values when `ignore_unknown_values` is `false`. If the number of bad records exceeds this value, the load job fails. **Type**: `int` **Default**: `0` ### `max_in_flight` The maximum number of message batches to write to BigQuery in parallel. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `project` Specify the project ID of the dataset to insert data into. If not set, the project ID is inferred from the project linked to the service account or read from the `GOOGLE_CLOUD_PROJECT` environment variable. **Type**: `string` **Default**: `""` ### `table` The table to insert messages into. **Type**: `string` ### `write_disposition` Specifies how existing data in a destination table is treated. **Type**: `string` **Default**: `WRITE_APPEND` **Options**: `WRITE_APPEND`, `WRITE_EMPTY`, `WRITE_TRUNCATE` --- # Page 128: gcp_cloud_storage **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/gcp_cloud_storage.md --- # gcp_cloud_storage Sends message parts as objects to a Google Cloud Storage bucket. Each object is uploaded with the path specified with the `path` field. In order to have a different path for each object you should use function interpolations described in [Bloblang queries](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries), which are calculated per message of a batch. ## Metadata Metadata fields on messages will be sent as headers, in order to mutate these values (or remove them) check out the [metadata docs](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/metadata/). ## Credentials By default Redpanda Connect will use a shared credentials file when connecting to GCP services. You can find out more in [GCP credentials](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/gcp/). ## Batching It’s common to want to upload messages to Google Cloud Storage as batched archives, the easiest way to do this is to batch your messages at the output level and join the batch of messages with an [`archive`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/archive/) and/or [`compress`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/compress/) processor. For example, if we wished to upload messages as a .tar.gz archive of documents we could achieve that with the following config: ```yaml output: gcp_cloud_storage: bucket: TODO path: ${!counter()}-${!timestamp_unix_nano()}.tar.gz batching: count: 100 period: 10s processors: - archive: format: tar - compress: algorithm: gzip ``` Alternatively, if we wished to upload JSON documents as a single large document containing an array of objects we can do that with: ```yaml output: gcp_cloud_storage: bucket: TODO path: ${!counter()}-${!timestamp_unix_nano()}.json batching: count: 100 processors: - archive: format: json_array ``` ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" gcp_cloud_storage: bucket: "" # No default (required) path: ${!counter()}-${!timestamp_unix_nano()}.txt content_type: application/octet-stream collision_mode: overwrite timeout: 3s credentials_json: "" max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" gcp_cloud_storage: bucket: "" # No default (required) path: ${!counter()}-${!timestamp_unix_nano()}.txt content_type: application/octet-stream content_encoding: "" collision_mode: overwrite chunk_size: 16777216 timeout: 3s credentials_json: "" max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `bucket` The bucket to upload messages to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `chunk_size` An optional chunk size which controls the maximum number of bytes of the object that the Writer will attempt to send to the server in a single request. If ChunkSize is set to zero, chunking will be disabled. **Type**: `int` **Default**: `16777216` ### `collision_mode` Determines how file path collisions should be dealt with. Options are "overwrite", which replaces the existing file with the new one, "append", which appends the message bytes to the original file, "error-if-exists", which returns an error and rejects the message if the file exists, and "ignore", does not modify the original file and drops the message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `overwrite` **Options**: `overwrite`, `append`, `error-if-exists`, `ignore` ### `content_encoding` An optional value for the `contentEncoding` metadata of each Cloud Storage object, such as `gzip` for objects that are stored compressed. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `content_type` The MIME type stored in the `contentType` metadata of each Cloud Storage object, which is returned as the `Content-Type` header when the object is downloaded. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `application/octet-stream` ### `credentials_json` The Google Service Account credentials in JSON format (optional). Provide the contents of the credentials file as plain JSON, not Base64-encoded. Use this field to authenticate with Google Cloud services. If this field is empty, the component uses [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials). For more information about creating service account credentials, see [Google’s service account documentation](https://developers.google.com/workspace/guides/create-credentials#create_credentials_for_a_service_account). This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `max_in_flight` The maximum number of message batches to have in flight at a given time. Increase this to improve throughput. **Type**: `int` **Default**: `64` ### `path` The path of each message to upload. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `${!counter()}-${!timestamp_unix_nano()}.txt` ```yaml # Examples: path: ${!counter()}-${!timestamp_unix_nano()}.txt # --- path: ${!meta("kafka_key")}.json # --- path: ${!json("doc.namespace")}/${!json("doc.id")}.json ``` ### `timeout` The maximum period to wait for a message batch to be written to Cloud Storage, including any collision checks and appends. When the timeout is reached, the write is abandoned and reattempted. **Type**: `string` **Default**: `3s` ```yaml # Examples: timeout: 1s # --- timeout: 500ms ``` --- # Page 129: gcp_pubsub **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/gcp_pubsub.md --- # gcp_pubsub Sends messages to a GCP Cloud Pub/Sub topic. [Metadata](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/metadata/) from messages are sent as attributes. For information on how to set up credentials, see [this guide](https://cloud.google.com/docs/authentication/production). ## Troubleshooting If you’re consistently seeing `Failed to send message to gcp_pubsub: context deadline exceeded` error logs without any further information it is possible that you are encountering [https://github.com/redpanda-data/connect/issues/1042](https://github.com/redpanda-data/connect/issues/1042), which occurs when metadata values contain characters that are not valid utf-8. This can frequently occur when consuming from Kafka as the key metadata field may be populated with an arbitrary binary value, but this issue is not exclusive to Kafka. If you are blocked by this issue then a work around is to delete either the specific problematic keys: ```yaml pipeline: processors: - mapping: | meta kafka_key = deleted() ``` Or delete all keys with: ```yaml pipeline: processors: - mapping: meta = deleted() ``` ### Common ```yml output: label: "" gcp_pubsub: project: "" # No default (required) credentials_json: "" topic: "" # No default (required) endpoint: "" max_in_flight: 64 count_threshold: 100 delay_threshold: 10ms byte_threshold: 1000000 metadata: exclude_prefixes: [] batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" gcp_pubsub: project: "" # No default (required) credentials_json: "" topic: "" # No default (required) endpoint: "" ordering_key: "" # No default (optional) max_in_flight: 64 count_threshold: 100 delay_threshold: 10ms byte_threshold: 1000000 publish_timeout: 1m0s validate_topic: true metadata: exclude_prefixes: [] flow_control: max_outstanding_bytes: -1 max_outstanding_messages: 1000 limit_exceeded_behavior: block batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `batching` Configures a batching policy on this output. While the PubSub client maintains its own internal buffering mechanism, preparing larger batches of messages can further trade-off some latency for throughput. **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `byte_threshold` Publish a batch when its size in bytes reaches this value. **Type**: `int` **Default**: `1000000` ### `count_threshold` Publish a pubsub buffer when it has this many messages **Type**: `int` **Default**: `100` ### `credentials_json` The Google Service Account credentials in JSON format (optional). Provide the contents of the credentials file as plain JSON, not Base64-encoded. Use this field to authenticate with Google Cloud services. If this field is empty, the component uses [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials). For more information about creating service account credentials, see [Google’s service account documentation](https://developers.google.com/workspace/guides/create-credentials#create_credentials_for_a_service_account). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `delay_threshold` Publish a non-empty pubsub buffer after this delay has passed. **Type**: `string` **Default**: `10ms` ### `endpoint` An optional endpoint that overrides the default of `pubsub.googleapis.com:443`. Use this field to connect to a region-specific Pub/Sub endpoint. For a list of valid values, see [Pub/Sub regional endpoints](https://cloud.google.com/pubsub/docs/reference/service_apis_overview#list_of_regional_endpoints). **Type**: `string` **Default**: `""` ```yaml # Examples: endpoint: us-central1-pubsub.googleapis.com:443 # --- endpoint: us-west3-pubsub.googleapis.com:443 ``` ### `flow_control` For a given topic, configures the PubSub client’s internal buffer for messages to be published. **Type**: `object` ### `flow_control.limit_exceeded_behavior` Configures the behavior when trying to publish additional messages while the flow controller is full. The available options are block (default), ignore (disable), and signal_error (publish results will return an error). **Type**: `string` **Default**: `block` **Options**: `ignore`, `block`, `signal_error` ### `flow_control.max_outstanding_bytes` Maximum size of buffered messages to be published. If less than or equal to zero, this is disabled. **Type**: `int` **Default**: `-1` ### `flow_control.max_outstanding_messages` Maximum number of buffered messages to be published. If less than or equal to zero, this is disabled. **Type**: `int` **Default**: `1000` ### `max_in_flight` The maximum number of messages to have in flight at a given time. Increasing this may improve throughput. **Type**: `int` **Default**: `64` ### `metadata` Specify criteria for which metadata values are sent as attributes, all are sent by default. **Type**: `object` ### `metadata.exclude_prefixes[]` Provide a list of explicit metadata key prefixes to exclude when adding metadata to sent messages. **Type**: `array` **Default**: `[]` ### `ordering_key` The ordering key to use for publishing messages. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `project` The project ID of the topic to publish to. **Type**: `string` ### `publish_timeout` The maximum length of time to wait before abandoning a publish attempt for a message. **Type**: `string` **Default**: `1m0s` ```yaml # Examples: publish_timeout: 10s # --- publish_timeout: 5m # --- publish_timeout: 60m ``` ### `topic` The topic to publish to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `validate_topic` Whether to validate the existence of the topic before publishing. If set to false and the topic does not exist, messages will be lost. **Type**: `bool` **Default**: `true` --- # Page 130: http_client **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/http_client.md --- # http_client Sends messages to an HTTP server. When the number of retries expires the output will reject the message, the behavior after this will depend on the pipeline but usually this simply means the send is attempted again until successful whilst applying back pressure. The URL and header values of this type can be dynamically set using function interpolations described in [Bloblang queries](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). The body of the HTTP request is the raw contents of the message payload. If the message has multiple parts (is a batch) the request will be sent according to [RFC1341](https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html). This behavior can be disabled by setting the field [`batch_as_multipart`](#batch_as_multipart) to `false`. ## Propagate responses It’s possible to propagate the response from each HTTP request back to the input source by setting `propagate_response` to `true`. Only inputs that support [synchronous responses](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/sync_responses/) are able to make use of these propagated responses. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" http_client: url: "" # No default (required) verb: POST headers: {} rate_limit: "" # No default (optional) timeout: 5s max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml # All configuration fields, showing default values output: label: "" http_client: url: "" # No default (required) verb: POST headers: {} metadata: include_prefixes: [] include_patterns: [] dump_request_log_level: "" # Optional oauth: enabled: false consumer_key: "" # Optional consumer_secret: "" # Optional access_token: "" # Optional access_token_secret: "" # Optional oauth2: enabled: false client_key: "" # Optional client_secret: "" # Optional token_url: "" # Optional scopes: [] endpoint_params: {} basic_auth: enabled: false username: "" # Optional password: "" # Optional jwt: enabled: false private_key_file: "" # Optional signing_method: "" # Optional claims: {} headers: {} tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] rate_limit: "" # No default (optional) timeout: 5s retry_period: 1s max_retry_backoff: 300s retries: 3 backoff_on: - 429 drop_on: [] successful_on: [] proxy_url: "" # No default (optional) batch_as_multipart: false max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" # Optional check: "" # Optional processors: [] # No default (optional) multipart: [] ``` ## Fields ### `backoff_on[]` A list of status codes that indicate a request failure and trigger retries with an increasing backoff period between attempts. **Type**: `array` **Default**: ```yaml - 429 ``` ### `basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `batch_as_multipart` When set to `true`, sends all messages in a batch as a single request using [RFC1341](https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html). When set to `false`, sends messages in a batch as individual requests. **Type**: `bool` **Default**: `false` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `disable_http2` Whether to disable HTTP/2. By default, HTTP/2 is enabled. **Type**: `bool` **Default**: `false` ### `drop_on[]` A list of status codes that indicate a request failure where retries should not be attempted. This helps avoid unnecessary retries for requests that are unlikely to succeed. > 📝 **NOTE** > > In these cases, the _request_ is dropped, but the _message_ that triggered the request is retained. **Type**: `array` **Default**: `[]` ### `dump_request_log_level` EXPERIMENTAL: Set the logging level for the request and response payloads of each HTTP request. **Type**: `string` **Default**: `""` **Options**: `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL`, `""` ### `extract_headers` Specify which response headers to add to the resulting synchronous response messages as metadata. Header keys are automatically converted to lowercase before matching, so make sure that your patterns target the lowercase versions of the expected header keys. This field is only applicable when `propagate_response` is set to `true`. **Type**: `object` ### `extract_headers.include_patterns[]` A list of explicit metadata key regular expression (re2) patterns to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_patterns: - .* # --- include_patterns: - _timestamp_unix$ ``` ### `extract_headers.include_prefixes[]` A list of explicit metadata key prefixes to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_prefixes: - foo_ - bar_ # --- include_prefixes: - kafka_ # --- include_prefixes: - content- ``` ### `follow_redirects` Whether to transparently follow redirects, that is, responses with HTTP status codes in the 300-399 range. If set to `false`, the response message includes the body, status, and headers from the redirect response, and the component does not make a request to the URL specified in the `Location` header. **Type**: `bool` **Default**: `true` ### `headers` A map of headers to add to the request. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` **Default**: `{}` ```yaml # Examples: headers: Content-Type: application/octet-stream traceparent: ${! tracing_span().traceparent } ``` ### `jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `max_in_flight` The maximum number of parallel message batches to have in flight at any given time. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `max_retry_backoff` The maximum period to wait between failed requests. **Type**: `string` **Default**: `300s` ### `metadata` Specify matching rules that determine which metadata keys should be added to the HTTP request as headers. **Type**: `object` ### `metadata.include_patterns[]` A list of explicit metadata key regular expression (re2) patterns to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_patterns: - .* # --- include_patterns: - _timestamp_unix$ ``` ### `metadata.include_prefixes[]` A list of explicit metadata key prefixes to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_prefixes: - foo_ - bar_ # --- include_prefixes: - kafka_ # --- include_prefixes: - content- ``` ### `multipart[]` EXPERIMENTAL: Create explicit multipart HTTP requests by specifying an array of parts to add to a request. Each part consists of content headers and a data field, which can be populated dynamically. If populated, this field overrides the default request creation behavior. **Type**: `array` **Default**: `[]` ### `multipart[].body` The body of the individual message part. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ```yaml # Examples: body: ${! this.data.part1 } ``` ### `multipart[].content_disposition` The content disposition of the individual message part. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ```yaml # Examples: content_disposition: form-data; name="bin"; filename='${! @AttachmentName } ``` ### `multipart[].content_type` The content type of the individual message part. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ```yaml # Examples: content_type: application/bin ``` ### `oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `oauth2` Configures authentication with OAuth version 2 using the client credentials token flow. To exchange a refresh token instead, add a `grant_type` parameter with the value `refresh_token` and a `refresh_token` parameter with the token to `endpoint_params`. **Type**: `object` ### `oauth2.client_key` A value used to identify the client to the token provider. **Type**: `string` **Default**: `""` ### `oauth2.client_secret` The secret used to establish ownership of the client key. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth2.enabled` Whether to use OAuth version 2 in requests. **Type**: `bool` **Default**: `false` ### `oauth2.endpoint_params` A map of optional parameters to send to the token provider with client credentials token requests. Each value must be an array of strings. **Type**: `object` **Default**: `{}` ```yaml # Examples: endpoint_params: audience: - https://example.com resource: - https://api.example.com ``` ### `oauth2.scopes[]` A list of requested permissions (optional). **Type**: `array` **Default**: `[]` ### `oauth2.token_url` The URL of the token provider. **Type**: `string` **Default**: `""` ### `propagate_response` Whether to [propagate server responses back](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/sync_responses/) to the input. **Type**: `bool` **Default**: `false` ### `proxy_url` An HTTP proxy URL (optional). **Type**: `string` ### `rate_limit` A [rate limit](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/about/) to throttle requests by (optional). **Type**: `string` ### `retries` The maximum number of retry attempts to make. **Type**: `int` **Default**: `3` ### `retry_period` The period to wait between failed requests before retrying. For status codes listed in `backoff_on`, this is the starting period, which increases with each attempt up to `max_retry_backoff`. **Type**: `string` **Default**: `1s` ### `successful_on[]` A list of HTTP status codes that should be considered successful, even if they are not 2XX codes. This is useful for handling cases where non-2XX codes indicate that the request was processed successfully, such as `303 See Other` or `409 Conflict`. By default, all 2XX codes are considered successful unless they are specified in the `backoff_on` or `drop_on` fields, regardless of this field. **Type**: `array` **Default**: `[]` ### `timeout` A static timeout to apply to requests. **Type**: `string` **Default**: `5s` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL to connect to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `verb` A verb to connect with. **Type**: `string` **Default**: `POST` ```yaml # Examples: verb: POST # --- verb: GET # --- verb: DELETE ``` --- # Page 131: iceberg **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/iceberg.md --- # iceberg Writes data to Apache Iceberg tables using the REST catalog API. This output supports: - Multiple storage backends (S3, GCS, Azure) - Automatic table creation with schema detection - Partition transforms (year, month, day, hour, bucket, truncate) - Schema evolution (automatic column addition) - Transaction retry logic for concurrent writes This output is designed to work with REST catalog implementations like Apache Polaris, AWS Glue Data Catalog, and the Databricks Unity Catalog. Tables are written using version 2 of the Iceberg specification. A pre-existing version 1 table is upgraded to version 2 automatically on first write, irreversibly, unless `merge_strategy` is `copy-on-write`, which only ever writes plain data files and therefore works on version 1 or version 2 tables without forcing the upgrade (see [Merge strategies](#merge-strategies)). ## Catalog integration ### Apache Polaris To use with [Apache Polaris](https://polaris.apache.org): - Set `catalog.url` to the Polaris REST endpoint (for example, `http://localhost:8181/api/catalog`). - Set `catalog.warehouse` to the catalog name configured in Polaris. - Configure `catalog.auth.oauth2` with client credentials granted access to the catalog. ### AWS Glue Data Catalog To use with AWS Glue Data Catalog: - Set `catalog.url` to `https://glue..amazonaws.com/iceberg` (the REST client appends the API version automatically). - Set `catalog.warehouse` to your AWS account ID (the Glue catalog identifier). - Set `schema_evolution.table_location` to an S3 prefix (for example, `s3://my-bucket/`; a trailing slash is optional) since Glue does not automatically assign table locations. - Configure `catalog.auth.aws_sigv4` with the appropriate region and set `service` to `glue`. - Configure `storage.aws_s3` with the same bucket and region. ## Storage ### Azure Blob Storage (ADLS Gen2) To use with Azure Data Lake Storage Gen2: - Configure `storage.azure_blob_storage` with your storage account name and container. - Authenticate using one of: `storage_access_key` (shared key), `storage_sas_token`, or `storage_connection_string`. - The storage account must have hierarchical namespace (HNS) enabled for ADLS Gen2 compatibility. ## Type mapping Values are mapped from Bloblang types to Iceberg types as follows: | Bloblang type | Iceberg type | | --- | --- | | string | string | | bytes | binary | | bool | boolean | | number | double | | timestamp | timestamp (with timezone) | | object | struct | | array | list | ## Row-level operations By default this output is append-only: every message becomes a new row (`row_operation: insert`), and existing configurations are unaffected. Set `row_operation` to apply a per-message operation, with `identifier_fields` defining the row identity: - `insert`: append the row. This is an unconditional append: it is **not** keyed or de-duplicated. - `upsert`: replace any existing rows matching `identifier_fields`, then append this row (equivalent to Iceberg’s Flink UPSERT mode). - `delete`: remove rows matching `identifier_fields`. `row_operation` supports interpolation, so the operation can be driven by the data itself (for example by mapping a change-data-capture stream’s operation field), but no CDC-specific format is assumed (see the change-data-capture example below). It is named `row_operation` to distinguish it from Iceberg’s snapshot-level operation. `upsert` and `delete` require `identifier_fields`. How those mutations are materialised on disk, and, critically, which query engines can then read the table, is controlled by `merge_strategy`. See [Merge strategies: merge-on-read vs copy-on-write](#merge-strategies) below for the decision guide, support matrix, and maintenance guidance. **Identifier fields.** `identifier_fields` must reference existing table columns of a primitive, non-floating-point type. A static `upsert`/`delete` is validated at startup; an interpolated `row_operation` is validated per message at write time, so an empty `identifier_fields` is not caught until the first `upsert`/`delete` message arrives. Identifier columns of a temporal type (`timestamp`, `timestamptz`, `date`, `time`) are interpreted exactly like their data columns: time values and RFC 3339 strings are unambiguous, and a bare numeric epoch is interpreted using the batch’s schema metadata when present, falling back to the same default units the insert path applies (the key is interpreted by the identical rules as the insert path, so it encodes what the insert stored whenever both batches carry the same unit declaration). Beware feeding numeric epochs **without** schema metadata in a unit other than that default: the key would silently match nothing; set `require_schema_metadata: true` to make an undeclared unit fail loudly instead, or convert to a timestamp upstream. If the table is partitioned, `merge-on-read` additionally requires every partition source column to be one of the `identifier_fields`, since equality deletes are partition-scoped; `copy-on-write` carries no such restriction (it rewrites whole files by filter and routes new rows by value, and can even move a key across partitions). See the support matrix for the merge-key types each strategy accepts. **Strict key and value typing.** Merge keys and row values on the `upsert`/`delete` paths are validated as strictly as the insert path has always been: a string-typed integer or boolean (for example `{"id": "42"}` into a `long` column, or `"true"` into a `boolean` column) previously worked by accident on the mutation paths and now fails the batch with an actionable error, matching the insert path’s rejections. Convert such values upstream (for example with Bloblang’s `.number()` or `.bool()`) if a source emits stringified scalars. Under `merge-on-read`, when this output auto-creates a table (via `schema_evolution`), the `identifier_fields` columns are created as **required** and registered as the table’s Iceberg identifier-field-ids, so downstream engines and other writers see the primary key. A consequence is that a null or missing value in an identifier column is rejected on write, even for `insert`; identifier columns must therefore be present at creation: in the first message or declared via `schema_metadata`. Under `copy-on-write` the identifier fields are used only as the connector-side merge key and are **not** registered as identifier-field-ids, so auto-created columns are not forced required (this is also what lets engine-backed catalogs such as the Databricks Unity Catalog, which rejects identifier-field-ids at table creation, accept the `CREATE TABLE`). Pre-existing tables are never modified. **Batching and ordering.** Within a single batch the last `upsert`/`delete` per `identifier_fields` key wins. Each batch containing an `upsert`/`delete` is committed as its own snapshot (these commits are never coalesced, which is required for correctness), so a high-throughput mutation workload produces one snapshot per batch. Size batches accordingly and run regular table maintenance (snapshot expiry and compaction) to keep metadata manageable. Pure `insert`-only batches keep the original append fast path, which does coalesce commits. Ordering only holds **within** a batch. With more than one batch in flight, concurrent batches can commit out of order, so a stale `upsert` may overwrite a newer one for the same key. Set `max_in_flight: 1` for keyed (change-data-capture) workloads to preserve per-key order: this is enforced by config linting whenever `row_operation` is anything other than a static `insert`. > ⚠️ **CAUTION** > > `insert` is an unconditional append and is **not** keyed or de-duplicated. For keyed data (including change-data-capture), map create/read events to `upsert`, never `insert`: mixing `insert` with `upsert`/`delete` on the same key in one batch produces duplicate rows. ### Merge strategies: merge-on-read vs copy-on-write `merge_strategy` controls how `upsert`/`delete` mutations are written, which sets both the write cost and, most importantly, which query engines can read the table. - `merge-on-read` (the default) writes Iceberg v2 equality-delete files and applies them at read time. Writes stay cheap and streaming-friendly, but only catalog-native / Flink-world engines (Apache Polaris, Flink, Trino, Spark) can read equality deletes. Engine-backed catalogs (Snowflake and the Databricks Unity Catalog) cannot. It requires table format version 2, so a version-1 table is automatically upgraded to version 2 on the first `upsert`/`delete`; **this upgrade is irreversible**. - `copy-on-write` instead rewrites whole data files so the table only ever holds plain data files: no equality- or positional-delete files. Every engine that reads Iceberg data files can read the result: Snowflake and the Databricks Unity Catalog as well as Polaris, Flink and Trino. Because it writes only plain data files it works on version-1 or version-2 tables and never forces the irreversible v1→v2 upgrade. **Which to choose.** - Choose `merge-on-read` for streaming or high-throughput mutation into a lake read by Polaris, Flink, Trino or Spark, where write cost must stay low. - Choose `copy-on-write` when the table must be correct on Snowflake or the Databricks Unity Catalog (or any engine that cannot read equality deletes), and the workload is batch or moderate-throughput so the write amplification is acceptable. **Copy-on-write support matrix.** - **Column types:** all flat primitives (`boolean`, `int`, `long`, `float`, `double`, `string`, `date`, `time`, `timestamp`, `timestamptz`, `decimal`, `uuid`, `binary`, `fixed`), and nested `struct`/`list`/`map` columns whose leaves are all supported primitives. - **Merge-key (`identifier_fields`) types:** `int`, `long`, `string`, `date`, `time`, `timestamp`, `timestamptz` and `uuid`. `decimal` and `boolean` merge keys are **not** supported and error with a message pointing you at `merge-on-read` (an upstream limitation in the Iceberg library’s overwrite filter; it cannot apply a `decimal` or `boolean` predicate when rewriting files); both are fine as non-key columns. - **Partitioned tables:** supported, with no requirement that the partition columns be a subset of `identifier_fields`. A `copy-on-write` `upsert` can even move a key from one partition to another. - **Table format:** version 1 or version 2, with no forced upgrade. **Write amplification and throughput.** `copy-on-write` rewrites every data file that contains a row for a touched key, so the cost of a batch depends on how many files its keys' rows are spread across, not on how many keys it touches: keys that cluster into a few files rewrite only those files, and even one key can rewrite many files if its rows (for example, duplicates from `insert`) are spread across them. Touching even a single key in a file rewrites that whole file, so a one-row change to a 512 MB file rewrites all 512 MB. To keep amplification low, sort the table by the identifier key so a batch’s keys cluster into as few files as possible, and use large batches. This is a batch / moderate-throughput mode, not a streaming one. **Memory.** Under `copy-on-write` the whole new-row batch is materialised in memory as a single Arrow record while the batch commits, so a keyed batch’s memory scales with its total row bytes. Size keyed batches to stay within the process memory budget rather than making them arbitrarily large. **Maintenance.** Because every mutating batch rewrites files and adds a snapshot, a high-churn `copy-on-write` workload accumulates data files and snapshots quickly. Run regular table maintenance: compaction (rewrite / bin-pack data files), snapshot expiry, and orphan-file removal. Orphan-file removal matters specifically for commits that fail **ambiguously** (the catalog may or may not have recorded them): the connector deliberately never deletes those attempts' newly-written data files, because the commit may still land and reference them; they are left for orphan-file removal to reclaim. The connector’s own best-effort cleanup covers only commits whose failure was a definitive catalog rejection (and superseded attempts of a retried success). Setting `commit.cleanup_on_failure` to `false` turns that connector-side cleanup off altogether, on every write path, which makes periodic orphan-file removal mandatory rather than merely advisable. **Commit retries.** Leave the standard Iceberg table property `commit.retry.num-retries` at its default `0` on tables this output writes to. The output’s own commit retry (`commit.max_retries`) re-stages every attempt from a freshly reloaded table snapshot, which is safe under concurrent writers; the library-level replay a non-zero `commit.retry.num-retries` arms instead re-submits the original updates built against a now-stale snapshot, and under concurrent writers that replay can drop a peer commit’s files from the table state. The output logs a warning when it finds the property armed on a table it writes to. **Copy-on-write limitations.** - A `decimal` merge key is not supported: use `merge-on-read` for a decimal key (a `decimal` non-key column is fine). - Schema evolution covers new **top-level** columns only; new fields appearing inside an existing nested `struct`/`list`/`map` column are not auto-surfaced for evolution. - It is a batch / moderate-throughput mode: expect heavy write amplification under scattered, high-frequency keyed mutations. - Tables pinned to the legacy timestamp encoding whose schema contains a no-timezone `timestamp` column reject `upsert`/`delete`: see [Timestamp encoding on existing tables](#timestamp-encoding) for why and for the migration path. - A table whose `write.delete.mode` property is **explicitly** set to `merge-on-read` (for example by a Spark `TBLPROPERTIES` clause) rejects `copy-on-write` mutations with an actionable error: the connector will not silently override a table-level setting other engines read, and honouring it would produce the delete files this strategy exists to avoid. Unset the property, set it to `copy-on-write`, or use `merge_strategy: merge-on-read`. (Previous releases silently overrode the property.) ### Timestamp encoding on existing tables Older versions of this output annotated no-timezone `timestamp` columns in the parquet files they wrote with `isAdjustedToUTC=true`: the annotation the Iceberg spec reserves for `timestamptz`. The stored microsecond instants are correct, and appends and most readers are unaffected, but the annotation makes some readers treat the column as UTC-adjusted, and it prevents `copy-on-write` from rewriting those files (the file’s annotation reads back as `timestamptz`, which cannot be written into a `timestamp` column). Current versions write the spec-correct `isAdjustedToUTC=false`. To guarantee an existing table never ends up with a mix of the two annotations, the encoding is pinned **per table** via the table property `redpanda-connect.timestamp-encoding` (`spec` or `legacy`): - Tables created by this output carry `redpanda-connect.timestamp-encoding: spec` from creation. - For an existing table without the property, the output resolves the encoding automatically on first contact and stamps the result onto the table: if the schema has no no-timezone `timestamp` column, or the table has no data files, it resolves `spec`; otherwise the output inspects one data file’s parquet footer and adopts whatever that file already contains (`legacy` for `isAdjustedToUTC=true`). A table that cannot be probed fails the write rather than risk mixing annotations, whether because a footer is unreadable, or because the first 1000 parquet data files probed (in manifest order) carry no no-timezone `timestamp` column at all (possible when the column was added by later schema evolution on a large table); in the latter case the error names the fix: set the property on the table explicitly and the probe never runs. The stamp itself is a `SetProperties` catalog commit, so the principal this output authenticates as needs permission to write table properties in addition to writing data; a principal without it turns a previously-healthy insert pipeline into a hard failure on first contact after upgrading, until the permission is granted or the property is set out-of-band. On a catalog that forbids **all** custom table properties, the set-it-explicitly escape hatch is unavailable by the same rule (the `redpanda-connect.` prefix carries connector semantics and is never silently stripped), so such writes fail loudly rather than risk mixing annotations. - Once stamped, the property is authoritative and the probe never runs again. An unrecognised property value is a hard error. A table pinned `legacy` keeps receiving the legacy annotation on every new file, byte-identical to what previous releases wrote, so appends and `merge-on-read` continue working unchanged forever. The one restriction is mutating `copy-on-write` (`upsert`/`delete`): it must rewrite existing files, which the legacy annotation prevents, so such writes fail upfront with an actionable error (pure `insert` batches still work). To migrate a legacy table to the spec encoding: rewrite/compact the table’s data files with an engine that writes the spec annotation (for example, Spark’s `rewrite_data_files`), then set the table property `redpanda-connect.timestamp-encoding` to `spec`, keeping any running instances of this output that write to the table stopped (or restarting them) around the migration: a live writer only re-reads the property when its writer is recreated. A table whose existing files already mix both annotations (for example one written to by several engines or connector versions over time) can be pinned either way by the probe, depending on which file it happens to read first, and a `copy-on-write` mutation on such a table may then fail mid-rewrite with the underlying library’s type-promotion error rather than the upfront migration message: compact or rewrite such a table to a single encoding before mutating it. Alternatively, keep the table on `merge-on-read`. ## Data file compression Compression of the parquet data files this output writes is resolved per table, in this order: 1. `parquet.compression`, if you set it. 2. otherwise the table’s own `write.parquet.compression-codec` property, if the table has one. 3. otherwise uncompressed. `parquet.compression` is optional rather than defaulted precisely so that step 2 is reachable: an unset field means "whatever the table says", which is not the same as explicitly choosing `uncompressed`. **Prefer the table property for compression settings whenever possible.** `parquet.compression` only applies to files this connector writes directly. The Iceberg library can perform additional writes, such as copy-on-write rewrites and equality-delete files, and these do not honour this field. They follow the table’s `write.parquet.compression-codec` property instead, which defaults to `zstd`. Setting the table property is the only way to get one codec for every file in the table. Use this field when you cannot set table properties, for example on Databricks Unity Catalog. > 📝 **NOTE** > > The uncompressed default applies only to a table whose property is genuinely absent. A table created through the Iceberg library (which includes tables this output creates itself) comes back carrying `write.parquet.compression-codec: zstd`, set at creation, so an otherwise unconfigured pipeline writing to such a table produces `zstd` throughout rather than anything uncompressed. Either way a table may end up holding a mixture of codecs, which is legal and transparent: parquet records its codec per column chunk, readers handle mixed files, and changing compression never requires rewriting existing data. **Codec support.** `snappy`, `gzip` and `zstd` are read by every engine this output targets. Parquet permits others that are not offered here: the original `lz4` codec was ambiguously specified and readers disagree on what it means, `lz4_raw` is its unambiguous replacement but has younger and less universal reader support, and `brotli` and `lzo` are patchily supported. If the table property names one of those it is reported in the log and the files this output writes are uncompressed instead. That governs only those files; the Iceberg library does map those codecs, so if the intent is that nothing writes one, change the table property rather than relying on this. **Cost.** Negligible impact on write throughput; the size savings depend heavily on how compressible your data is. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" iceberg: catalog: url: "" # No default (required) warehouse: "" # No default (optional) auth: oauth2: server_uri: /v1/oauth/tokens client_id: "" # No default (required) client_secret: "" # No default (required) scope: "" # No default (optional) bearer: "" # No default (optional) aws_sigv4: {} namespace: "" # No default (required) table: "" # No default (required) storage: aws_s3: bucket: "" # No default (required) region: "" # No default (optional) endpoint: "" # No default (optional) gcp_cloud_storage: bucket: "" # No default (required) credentials_type: "" # No default (optional) credentials_file: "" # No default (optional) credentials_json: "" # No default (optional) azure_blob_storage: storage_account: "" # No default (required) container: "" # No default (required) storage_sas_token: "" # No default (optional) storage_connection_string: "" # No default (optional) storage_access_key: "" # No default (optional) batching: count: 0 byte_size: 0 period: "" check: "" max_in_flight: 4 ``` ### Advanced ```yml output: label: "" iceberg: catalog: url: "" # No default (required) warehouse: "" # No default (optional) auth: oauth2: server_uri: /v1/oauth/tokens client_id: "" # No default (required) client_secret: "" # No default (required) scope: "" # No default (optional) bearer: "" # No default (optional) aws_sigv4: region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) service: "" # No default (optional) headers: {} # No default (optional) tls_skip_verify: false namespace: "" # No default (required) table: "" # No default (required) case_sensitive_columns: true row_operation: insert identifier_fields: [] merge_strategy: merge-on-read storage: aws_s3: bucket: "" # No default (required) region: "" # No default (optional) endpoint: "" # No default (optional) force_path_style_urls: false credentials: id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) gcp_cloud_storage: bucket: "" # No default (required) endpoint: "" # No default (optional) credentials_type: "" # No default (optional) credentials_file: "" # No default (optional) credentials_json: "" # No default (optional) azure_blob_storage: storage_account: "" # No default (required) container: "" # No default (required) endpoint: "" # No default (optional) storage_sas_token: "" # No default (optional) storage_connection_string: "" # No default (optional) storage_access_key: "" # No default (optional) schema_evolution: enabled: false partition_spec: () table_location: "" # No default (optional) schema_metadata: "" new_column_type_mapping: "" # No default (optional) require_schema_metadata: false commit: manifest_merge_enabled: true max_snapshot_age: 24h max_retries: 3 cleanup_on_failure: true parquet: string_encoding: delta_length_byte_array compression: "" # No default (optional) batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) max_in_flight: 4 ``` ## Fields ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `case_sensitive_columns` Controls how message field names are matched against table column names, and how column references in the partition spec are resolved. When `true` (the default), names must match exactly. When `false`, matching is case-insensitive; set this when your downstream catalog or query engine treats column names as case-insensitive (the iceberg specification’s recommended convention) so that, for example, a message keyed `"COLUMN"` lands in an existing `column` rather than triggering schema evolution. Ambiguous case-only duplicates in the input are rejected. **Type**: `bool` **Default**: `true` ### `catalog` REST catalog configuration. **Type**: `object` ### `catalog.auth` Authentication configuration for the REST catalog. Only one authentication method can be active at a time. **Type**: `object` ### `catalog.auth.aws_sigv4` AWS SigV4 authentication (for AWS Glue Data Catalog or API Gateway). **Type**: `object` ### `catalog.auth.aws_sigv4.credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `catalog.auth.aws_sigv4.credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `catalog.auth.aws_sigv4.credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `catalog.auth.aws_sigv4.credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `catalog.auth.aws_sigv4.credentials.role` The ARN of the role to assume. **Type**: `string` ### `catalog.auth.aws_sigv4.credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `catalog.auth.aws_sigv4.credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `catalog.auth.aws_sigv4.credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `catalog.auth.aws_sigv4.endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `catalog.auth.aws_sigv4.region` The AWS region in which your resources are hosted. **Type**: `string` ### `catalog.auth.aws_sigv4.service` AWS service name for SigV4 signing. **Type**: `string` ### `catalog.auth.aws_sigv4.tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `catalog.auth.aws_sigv4.tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `catalog.auth.aws_sigv4.tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `catalog.auth.aws_sigv4.tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `catalog.auth.aws_sigv4.tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `catalog.auth.aws_sigv4.tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `catalog.auth.aws_sigv4.tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `catalog.auth.bearer` Static bearer token for authentication. For testing only, not recommended for production. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `catalog.auth.oauth2` OAuth2 authentication configuration. **Type**: `object` ### `catalog.auth.oauth2.client_id` OAuth2 client identifier. **Type**: `string` ### `catalog.auth.oauth2.client_secret` OAuth2 client secret. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `catalog.auth.oauth2.scope` OAuth2 scope to request. **Type**: `string` ### `catalog.auth.oauth2.server_uri` OAuth2 token endpoint URI. **Type**: `string` **Default**: `/v1/oauth/tokens` ### `catalog.headers` Custom HTTP headers to include in all requests to the catalog. **Type**: `object` ```yaml # Examples: headers: X-Api-Key: your-api-key ``` ### `catalog.tls_skip_verify` Skip TLS certificate verification. Not recommended for production. **Type**: `bool` **Default**: `false` ### `catalog.url` The REST catalog endpoint URL. **Type**: `string` ```yaml # Examples: url: http://localhost:8181/api/catalog # --- url: https://polaris.example.com/api/catalog # --- url: https://glue.us-east-1.amazonaws.com/iceberg ``` ### `catalog.warehouse` The REST catalog warehouse. **Type**: `string` ```yaml # Examples: warehouse: redpanda-catalog ``` ### `commit` Commit behavior configuration. **Type**: `object` ### `commit.cleanup_on_failure` Whether to remove the files a failed commit had already written. A commit’s data files (and, under `merge-on-read`, its equality-delete files) are written to storage before the catalog commit, so a failed commit leaves them referenced by no snapshot; the default `true` removes them best-effort to limit orphaned objects. The same sweep reclaims the superseded files of earlier attempts when a `copy-on-write` commit succeeds on retry (each attempt re-stages fresh rewrites). This applies to every write path: append, `merge-on-read`, and `copy-on-write`. Cleanup is already skipped automatically whenever a commit’s outcome is ambiguous, since such a commit may still land server-side, and deleting files a landed snapshot references would corrupt the table. Those leftovers are always deferred to table maintenance regardless of this setting. Setting this to `false` disables cleanup entirely, as a safety valve: writes then never delete anything, and every failed commit leaves its files orphaned in storage for Iceberg orphan-file maintenance (snapshot expiry plus `remove_orphan_files`) to reclaim. See the [Merge strategies](#merge-strategies) section above for that maintenance guidance. **Type**: `bool` **Default**: `true` ### `commit.manifest_merge_enabled` Merge small manifest files during commits to reduce metadata overhead. **Type**: `bool` **Default**: `true` ### `commit.max_retries` Maximum number of times to retry a failed transaction commit. **Type**: `int` **Default**: `3` ### `commit.max_snapshot_age` Maximum age of snapshots to retain for time-travel queries. Set to zero to disable removing old snapshots. **Type**: `string` **Default**: `24h` ### `identifier_fields[]` The columns forming the row identity (the Iceberg identifier fields, or equality-delete key) used by `upsert` and `delete`. Required when `row_operation` can evaluate to `upsert` or `delete`, and must reference existing table columns of a primitive, non-floating-point type. See the Row-level operations section above for the full constraints, including the temporal-type and partitioning rules and when the requirement is enforced. **Type**: `array` **Default**: `[]` ```yaml # Examples: identifier_fields: - id # --- identifier_fields: - tenant_id - user_id ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `4` ### `merge_strategy` How `upsert` and `delete` are materialised on disk. - `merge-on-read` (the default) writes Iceberg v2 equality-delete files. Deletes are applied at read time, so writes stay cheap and streaming-friendly, but only catalog-native / Flink-world engines can read the result. Engine-backed catalogs such as Snowflake and the Databricks Unity Catalog cannot read equality deletes. - `copy-on-write` rewrites whole data files so the table only ever contains plain data files (no delete files), which every engine can read, including Snowflake and Databricks Unity Catalog. It works on version-1 or version-2 tables and never forces the irreversible v1→v2 upgrade. The trade-off is heavy write amplification: each mutating batch rewrites every data file that contains a touched key, so it is a batch / moderate-throughput mode. Sort the table by the identifier key and use large batches so each rewrite touches as few files as possible. See the [Merge strategies](#merge-strategies) section above for the full decision guide, copy-on-write support matrix (column and merge-key types, partitioning, table format), and maintenance guidance. **Type**: `string` **Default**: `merge-on-read` **Options**: `merge-on-read`, `copy-on-write` ### `namespace` The Iceberg namespace for the table, dot delimiters are split as nested namespaces. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: namespace: analytics.events # --- namespace: production ``` ### `parquet` Parquet writer configuration. **Type**: `object` ### `parquet.compression` The compression codec for data files this output writes. **Optional on purpose**: when it is not set, the codec is taken from the table’s own `write.parquet.compression-codec` property, and when that is absent too, data files are written uncompressed. Setting the table property rather than this field is usually the better choice, because the property is also honoured by the copy-on-write rewrite path (which writes its files inside the Iceberg library, out of reach of this field). The property is what gets every file in the table onto one codec, whereas this field governs only the data files this output writes itself: appends and merge-on-read data files, not copy-on-write rewrites or equality-delete files. Use this field when the property cannot be set, for example on catalogs that reject client-set table properties. If you rely on the table property instead, use a lower-case codec name: this field accepts any casing, but the Iceberg library’s own property lookup is lower-case only and silently falls back to uncompressed for anything else. A property of `ZSTD` would give you compressed appends and uncompressed copy-on-write rewrites. Only codecs that every engine this output targets can read are offered. If the table property names something else (`lz4`, `lz4_raw`, `brotli`, `lzo`), it is reported in the log and the data files this output writes are uncompressed instead. Measurement found no throughput penalty worth planning around, at one core or four; the size benefit though is entirely data-dependent, ranging from ~15x smaller on a repetitive record shape to ~2% on random content. Note also that the uncompressed fallback applies only when the table property is absent, and tables created through the Iceberg library carry a `zstd` property by default. See [Data file compression](#data-file-compression) for the resolution order and the copy-on-write caveat. **Type**: `string` **Options**: `uncompressed`, `snappy`, `gzip`, `zstd` ### `parquet.string_encoding` The encoding to use for string and binary columns. Use `plain` for compatibility with readers that do not support `DELTA_LENGTH_BYTE_ARRAY` encoding, such as AWS Redshift Spectrum. **Type**: `string` **Default**: `delta_length_byte_array` **Options**: `plain`, `delta_length_byte_array` ### `row_operation` The row-level operation to apply for each message: `insert` (append), `upsert` (replace rows matching `identifier_fields`, then append), or `delete` (remove rows matching `identifier_fields`). Supports interpolation so the operation can be driven by the data, such as a change-data-capture stream’s operation field. Defaults to `insert`, preserving the original append-only behavior. See the Row-level operations section above for the full semantics, the format-version-2 upgrade, batching behavior, and important caveats. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `insert` ```yaml # Examples: row_operation: insert # --- row_operation: ${! metadata("op") } # --- row_operation: ${! if this.op == "d" { "delete" } else { "upsert" } } ``` ### `schema_evolution` Schema evolution configuration. **Type**: `object` ### `schema_evolution.enabled` Enable automatic schema evolution. When enabled, new columns will be automatically added to the table. **Type**: `bool` **Default**: `false` ### `schema_evolution.new_column_type_mapping` An optional Bloblang mapping to customize column types during schema evolution. This mapping is executed for each new column and can override the inferred or schema-metadata-derived type. The mapping receives an object with fields `name` (column name), `path` (dot-separated path), `value` (sample value), `inferred_type` (the type that would be used without this mapping), `message` (the full message body), `namespace`, and `table`. It must return a string with a valid Iceberg type name: `boolean`, `int`, `long`, `float`, `double`, `string`, `binary`, `date`, `time`, `timestamp`, `timestamptz`, `uuid`, `decimal(p,s)`, or `fixed[n]`. **Type**: `string` ### `schema_evolution.partition_spec` A Bloblang expression to evaluate when a new table is created to determine the table’s partition spec. The result of the mapping should be an Iceberg partition spec in the same string format as the [Redpanda Streaming topic property](https://docs.redpanda.com/streaming/current/manage/iceberg/iceberg-performance-tuning/#use-custom-partitioning). This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `()` ```yaml # Examples: partition_spec: (col1) # --- partition_spec: (nested.col) # --- partition_spec: (year(my_ts_col)) # --- partition_spec: (year(my_ts_col), col2) # --- partition_spec: (hour(my_ts_col), truncate(42, col2)) # --- partition_spec: (day(my_ts_col), bucket(4, nested.col)) # --- partition_spec: (day(my_ts_col), void(`non.nested column.with.dots`), identity(nested.column)) ``` ### `schema_evolution.require_schema_metadata` When `true`, writing a numeric value into a `timestamp`, `timestamptz`, `date`, or `time` column without `schema_metadata` registered for that column is a hard error. The default `false` permits a fallback path that interprets bare numeric timestamps as Unix seconds and bare numeric times as already-microseconds; convenient, but silently wrong if upstream produced milliseconds. Enable this when you cannot guarantee the upstream attaches schema metadata and want to fail loudly rather than corrupt dates by ~50,000 years. No effect on time-typed columns receiving `time.Time`/`time.Duration` Go values, which carry their own unit unambiguously, and no effect on non-time columns. Requires `schema_metadata` to be set. **Type**: `bool` **Default**: `false` ### `schema_evolution.schema_metadata` The name of a message metadata field containing a schema definition. When set, the schema is used to determine column types during schema evolution and table creation instead of inferring types from values. The schema must be in the standard common schema format (the same format used by the `parquet_encode` processor’s `schema_metadata` field). For batches of messages, the first message’s schema is used. Record presence drives schema shape: fields declared in the schema metadata that are absent from the record are not added to the table, while the metadata controls column ordering, naming, and types for fields that are present. In case-insensitive mode, top-level column names use the metadata’s casing; record keys are matched by case-folding and the metadata’s name is what lands in the table. **Type**: `string` **Default**: `""` ### `schema_evolution.table_location` A prefix used as the location for new tables when the catalog does not automatically assign one. For example, AWS Glue requires explicit table locations. When set, table locations are derived by appending the namespace and table name to the prefix, in the form `/
`. **Type**: `string` ```yaml # Examples: table_location: s3://my-iceberg-bucket/ ``` ### `storage` Storage backend configuration for data files. Exactly one of `aws_s3`, `gcp_cloud_storage`, or `azure_blob_storage` must be specified. **Type**: `object` ### `storage.aws_s3` S3 storage configuration. **Type**: `object` ### `storage.aws_s3.bucket` The S3 bucket name. **Type**: `string` ```yaml # Examples: bucket: my-iceberg-data ``` ### `storage.aws_s3.credentials` Static AWS credentials for S3 access. When not specified, credentials are loaded from the default AWS credential chain. **Type**: `object` ### `storage.aws_s3.credentials.id` The AWS access key ID. **Type**: `string` ### `storage.aws_s3.credentials.secret` The AWS secret access key. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `storage.aws_s3.credentials.token` The AWS session token, required when using short term credentials. **Type**: `string` ### `storage.aws_s3.endpoint` Custom endpoint for S3-compatible storage (for example, MinIO). **Type**: `string` ```yaml # Examples: endpoint: http://localhost:9000 ``` ### `storage.aws_s3.force_path_style_urls` Forces the client API to use path style URLs, which is often required when connecting to custom endpoints. **Type**: `bool` **Default**: `false` ### `storage.aws_s3.region` The AWS region. **Type**: `string` ```yaml # Examples: region: us-west-2 ``` ### `storage.azure_blob_storage` Azure Blob Storage (ADLS Gen2) configuration. **Type**: `object` ### `storage.azure_blob_storage.container` The Azure blob container name. **Type**: `string` ```yaml # Examples: container: iceberg-data ``` ### `storage.azure_blob_storage.endpoint` Custom endpoint for Azure-compatible storage. **Type**: `string` ### `storage.azure_blob_storage.storage_access_key` Azure storage access key for shared key authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `storage.azure_blob_storage.storage_account` The Azure storage account name. **Type**: `string` ```yaml # Examples: storage_account: mystorageaccount ``` ### `storage.azure_blob_storage.storage_connection_string` Azure storage connection string. Use this or other auth methods, not both. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `storage.azure_blob_storage.storage_sas_token` SAS token for authentication. Prefix with the container name followed by a dot if container-specific. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `storage.gcp_cloud_storage` Google Cloud Storage configuration. **Type**: `object` ### `storage.gcp_cloud_storage.bucket` The GCS bucket name. **Type**: `string` ```yaml # Examples: bucket: my-iceberg-data ``` ### `storage.gcp_cloud_storage.credentials_file` Path to a GCP credentials JSON file. **Type**: `string` ### `storage.gcp_cloud_storage.credentials_json` GCP credentials JSON content. Use this or `credentials_file`, not both. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `storage.gcp_cloud_storage.credentials_type` The type of credentials to use. Valid values: `service_account`, `authorized_user`, `impersonated_service_account`, `external_account`. **Type**: `string` ```yaml # Examples: credentials_type: service_account ``` ### `storage.gcp_cloud_storage.endpoint` Custom endpoint for GCS-compatible storage. **Type**: `string` ### `table` The destination Iceberg table name. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: table: user_events # --- table: events_${!meta("topic")} ``` ## Examples ### Change-data-capture upsert/delete Materialize a change-data-capture stream into an Iceberg table. A mapping derives the row operation from the source’s operation field (here Debezium’s `op`: ``c`reate / `r`ead / `u`pdate map to `upsert``, ``d`elete maps to `delete``) and selects the row image, while `identifier_fields` is the primary key. Note that creates map to `upsert`, never `insert`, so re-delivered or snapshot rows do not duplicate. ```yaml input: redpanda: seed_brokers: [ localhost:9092 ] topics: [ dbserver.inventory.customers ] consumer_group: iceberg_sink pipeline: processors: - mapping: | meta op = match this.op { "d" => "delete", _ => "upsert", } # Debezium puts the row image in 'after' (or 'before' for deletes). root = this.after | this.before output: iceberg: catalog: url: http://localhost:8181/api/catalog namespace: inventory table: customers row_operation: ${! metadata("op") } identifier_fields: [ id ] # Keyed writes must stay ordered: a single batch in flight prevents # concurrent batches from committing a stale update over a newer one. max_in_flight: 1 storage: aws_s3: bucket: my-iceberg-data region: us-east-1 ``` ### CDC into a Snowflake- or Databricks-readable table (copy-on-write) Materialize a change-data-capture stream into an Iceberg table that must be read by an engine-backed catalog such as Snowflake or the Databricks Unity Catalog, which cannot read merge-on-read equality deletes. `merge_strategy: copy-on-write` rewrites whole data files so the table only ever holds plain data files that every engine can read. As with any keyed workload it requires `max_in_flight: 1`; because copy-on-write rewrites every file containing a touched key, prefer large batches and a table sorted by the identifier key, and run regular compaction and snapshot expiry. ```yaml input: redpanda: seed_brokers: [ localhost:9092 ] topics: [ dbserver.inventory.customers ] consumer_group: iceberg_sink_cow pipeline: processors: - mapping: | meta op = match this.op { "d" => "delete", _ => "upsert", } root = this.after | this.before output: iceberg: catalog: url: http://localhost:8181/api/catalog namespace: inventory table: customers row_operation: ${! metadata("op") } identifier_fields: [ id ] # copy-on-write produces only plain data files, so Snowflake and the # Databricks Unity Catalog can read the result (unlike equality deletes). merge_strategy: copy-on-write # Keyed writes must stay ordered; a single batch in flight prevents a stale # update from overwriting a newer one for the same key. max_in_flight: 1 # Amortise the file rewrites over larger commits. batching: count: 5000 period: 30s storage: aws_s3: bucket: my-iceberg-data region: us-east-1 ``` --- # Page 132: inproc **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/inproc.md --- # inproc ```yml output: label: "" inproc: "" ``` Sends data directly to Redpanda Connect inputs by connecting to a unique ID. It is possible to connect multiple inputs to the same inproc ID, resulting in messages dispatching in a round-robin fashion to connected inputs. However, only one output can assume an inproc ID, and will replace existing outputs if a collision occurs. --- # Page 133: kafka_franz **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/kafka_franz.md --- # kafka_franz > ⚠️ **WARNING** > > This component is deprecated and will be removed in a future version. A Kafka output using the [Franz Kafka client library](https://github.com/twmb/franz-go). This output is deprecated as of version 4.113.0. Use the [`redpanda` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda/) instead. Writes a batch of messages to Kafka brokers and waits for acknowledgement before propagating it back to the input. This output often out-performs the traditional `kafka` output as well as providing more useful logs and error messages. #### Common ```yml output: label: "" kafka_franz: seed_brokers: [] # No default (required) topic: "" # No default (required) key: "" # No default (optional) partition: "" # No default (optional) metadata: include_prefixes: [] include_patterns: [] max_in_flight: 10 batching: count: 0 byte_size: 0 period: "" check: "" ``` #### Advanced ```yml output: label: "" kafka_franz: seed_brokers: [] # No default (required) client_id: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] sasl: [] # No default (optional) metadata_max_age: 1m request_timeout_overhead: 10s conn_idle_timeout: 20s tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s topic: "" # No default (required) key: "" # No default (optional) partition: "" # No default (optional) metadata: include_prefixes: [] include_patterns: [] timestamp_ms: "" # No default (optional) tombstone: "" # No default (optional) max_in_flight: 10 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) partitioner: "" # No default (optional) idempotent_write: true acks: all compression: snappy allow_auto_topic_creation: true timeout: 10s max_message_bytes: 1MiB broker_write_max_bytes: 100MiB max_buffered_records: 10000 max_buffered_bytes: "0" max_in_flight_requests: 1 record_retries: 0 record_delivery_timeout: 0s ``` ## Fields ### `acks` The number of acknowledgements the leader broker must receive from ISR brokers before responding to the produce request. When `idempotent_write` is enabled this must be set to `all`. **Type**: `string` **Default**: `all` | Option | Summary | | --- | --- | | `all` | Wait for all in-sync replicas to acknowledge (acks=-1). Required when idempotent_write is enabled. | | `leader` | Wait for the leader broker to acknowledge (acks=1). Messages are lost if the leader fails before replication. | | `none` | Do not wait for any acknowledgement (acks=0). Highest throughput but messages may be lost. | ### `allow_auto_topic_creation` Enables topics to be auto created if they do not exist when fetching their metadata. If set to `false`, the topic must already exist. **Type**: `bool` **Default**: `true` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `broker_write_max_bytes` The maximum number of bytes this output can write to a broker connection in a single write. This field corresponds to Kafka’s `socket.request.max.bytes`. **Type**: `string` **Default**: `100MiB` ```yaml # Examples: broker_write_max_bytes: 128MB # --- broker_write_max_bytes: 50mib ``` ### `client_id` An identifier for the client connection. This identifier appears in broker logs and metrics, which helps you identify the Redpanda Connect instance that is connecting. **Type**: `string` **Default**: `redpanda-connect` ### `compression` The compression codec for produced record batches. A batch that compression does not make smaller is sent uncompressed, whichever codec you choose. **Type**: `string` **Default**: `snappy` **Options**: `lz4`, `snappy`, `gzip`, `none`, `zstd` ### `conn_idle_timeout` The approximate amount of time that connections can remain idle before they are closed. In the worst case, a connection can stay idle for up to twice this value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `20s` ### `idempotent_write` Enable the idempotent write producer option. When enabled, the producer initializes a producer ID and uses it to guarantee exactly-once semantics per partition, so retries do not produce duplicates. This option requires the `IDEMPOTENT_WRITE` permission on the `CLUSTER` resource. Disable this option if the `IDEMPOTENT_WRITE` permission is unavailable, for example in some managed Kafka services or Redpanda clusters with strict ACLs. Disabling this option only affects retry behavior: duplicates may occur on producer retries, but the pipeline continues to function normally. **Type**: `bool` **Default**: `true` ### `key` An optional key to populate for each message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `max_buffered_bytes` The maximum number of bytes the client will buffer in memory before blocking. When this limit is reached, `Produce()` calls will block until buffered records are delivered. Set to `0` to disable the byte-level limit (only `max_buffered_records` applies). This limit is checked after `max_buffered_records`. **Type**: `string` **Default**: `0` ```yaml # Examples: max_buffered_bytes: 256MB # --- max_buffered_bytes: 50mib ``` ### `max_buffered_records` The maximum number of records the client will buffer in memory before blocking. When this limit is reached, `Produce()` calls will block until buffered records are delivered and space frees up. Increase this value for high-throughput pipelines to avoid back-pressure stalls. **Type**: `int` **Default**: `10000` ### `max_in_flight` The maximum number of message batches to send in parallel at any given time. **Type**: `int` **Default**: `10` ### `max_in_flight_requests` The maximum number of produce requests in flight per broker connection. While `idempotent_write` is enabled (the default) this must be `1`, as the client relies on a single in-flight request per broker to guarantee ordering. To use higher values you must set `idempotent_write` to `false`, which allows requests to be pipelined for throughput but may cause duplicate and out-of-order delivery on retries. Note that this is distinct from the output’s `max_in_flight` field, which counts message batches being written in parallel rather than produce requests on the wire. A value of `1` is not a throughput ceiling: records from concurrent writes are coalesced into fewer, larger produce requests. **Type**: `int` **Default**: `1` ### `max_message_bytes` The maximum size of a produced record batch in bytes. A `MESSAGE_TOO_LARGE` error is returned if a batch exceeds this limit. This field maps to the `max.message.bytes` Kafka property. Ensure the Redpanda broker’s [`kafka_batch_max_bytes`](https://docs.redpanda.com/streaming/current/reference/properties/cluster-properties/#kafka_batch_max_bytes) property is at least as large as this value. **Type**: `string` **Default**: `1MiB` ```yaml # Examples: max_message_bytes: 100MB # --- max_message_bytes: 50mib ``` ### `metadata` Determines which metadata values are added to messages as headers. **Type**: `object` ### `metadata.include_patterns[]` A list of explicit metadata key regular expression (re2) patterns to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_patterns: - .* # --- include_patterns: - _timestamp_unix$ ``` ### `metadata.include_prefixes[]` A list of explicit metadata key prefixes to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_prefixes: - foo_ - bar_ # --- include_prefixes: - kafka_ # --- include_prefixes: - content- ``` ### `metadata_max_age` The maximum period of time after which metadata is refreshed. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Lower values provide more responsive topic and partition discovery but may increase broker load. Higher values reduce broker queries but can delay detection of topology changes. This interval also controls how frequently regex topic patterns are re-evaluated to discover new matching topics. **Type**: `string` **Default**: `1m` ### `partition` An optional explicit partition to set for each message. This field is only relevant when the `partitioner` is set to `manual`. The provided interpolation string must be a valid integer. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: partition: ${! meta("partition") } ``` ### `partitioner` Override the default murmur2 hashing partitioner. **Type**: `string` | Option | Summary | | --- | --- | | `least_backup` | Chooses the least backed up partition (the partition with the fewest amount of buffered records). Partitions are selected per batch. | | `manual` | Manually select a partition for each message, requires the field `partition` to be specified. | | `murmur2_hash` | Kafka’s default hash algorithm that uses a 32-bit murmur2 hash of the key to compute which partition the record will be on. | | `round_robin` | Round-robin’s messages through all available partitions. This algorithm has lower throughput and causes higher CPU load on brokers, but can be useful if you want to ensure an even distribution of records to partitions. | ### `record_delivery_timeout` The maximum time a record can sit in the producer buffer before it is failed, roughly equivalent to Kafka’s `delivery.timeout.ms`. This is evaluated before writing a request or after a produce response. When a record times out, all records in the same partition are also failed. Set to `0s` for no timeout (the default). With `idempotent_write` enabled, timeouts are only enforced when safe to do so without creating invalid sequence numbers. **Type**: `string` **Default**: `0s` ### `record_retries` The maximum number of times a record produce is retried on failure before the record is failed. When a record fails, all records buffered in the same partition are also failed to preserve gapless ordering. Set to `0` for unlimited retries (the default). With `idempotent_write` enabled, retries are only enforced when safe to do so without creating invalid sequence numbers. **Type**: `int` **Default**: `0` ### `request_timeout_overhead` Additional time to apply as overhead when calculating request deadlines. For most requests, the deadline is this overhead alone. For requests that define their own timeout field, the overhead is added on top of that timeout, which helps prevent premature timeouts. This field is roughly equivalent to Apache Kafka’s `request.timeout.ms` parameter, but grants extra time to requests that have timeout fields. **Type**: `string` **Default**: `10s` ### `sasl[]` Specify one or more methods or mechanisms of SASL authentication. They are tried in order. If the broker supports the first SASL mechanism, all connections use it. If the first mechanism fails, the client picks the first supported mechanism. If the broker does not support any client mechanisms, all connections fail. **Type**: `array` ```yaml # Examples: sasl: - mechanism: SCRAM-SHA-512 password: bar username: foo ``` ### `sasl[].aws` Contains AWS-specific fields for when `sasl.mechanism` is set to `AWS_MSK_IAM`. **Type**: `object` ### `sasl[].aws.credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `sasl[].aws.credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `sasl[].aws.credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `sasl[].aws.credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `sasl[].aws.credentials.role` The ARN of the role to assume. **Type**: `string` ### `sasl[].aws.credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `sasl[].aws.credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `sasl[].aws.credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `sasl[].aws.endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `sasl[].aws.region` The AWS region in which your resources are hosted. **Type**: `string` ### `sasl[].aws.tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `sasl[].aws.tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].aws.tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `sasl[].aws.tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `sasl[].aws.tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].extensions` Key/value pairs to add to OAUTHBEARER authentication requests. **Type**: `object` ### `sasl[].mechanism` The SASL mechanism to use for authentication. **Type**: `string` | Option | Summary | | --- | --- | | `AWS_MSK_IAM` | AWS IAM based authentication as specified by the 'aws-msk-iam-auth' java library. | | `OAUTHBEARER` | OAuth Bearer based authentication. | | `PLAIN` | Plain text authentication. | | `REDPANDA_CLOUD_SERVICE_ACCOUNT` | Redpanda Cloud Service Account authentication when running in Redpanda Cloud. | | `SCRAM-SHA-256` | SCRAM based authentication as specified in RFC5802. | | `SCRAM-SHA-512` | SCRAM based authentication as specified in RFC5802. | | `none` | Disable sasl authentication | ### `sasl[].password` The password to use for PLAIN or SCRAM-* authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `sasl[].token` The token to use for a single session’s OAUTHBEARER authentication. **Type**: `string` **Default**: `""` ### `sasl[].username` The username to use for PLAIN or SCRAM-* authentication. **Type**: `string` **Default**: `""` ### `seed_brokers[]` A list of broker addresses used to establish connections. If an item of the list contains commas, it is expanded into multiple addresses. **Type**: `array` ```yaml # Examples: seed_brokers: - "localhost:9092" # --- seed_brokers: - "foo:9092" - "bar:9092" # --- seed_brokers: - "foo:9092,bar:9092" ``` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `timeout` The maximum period of time to wait for message sends before abandoning the request and retrying. **Type**: `string` **Default**: `10s` ### `timestamp_ms` An optional timestamp to set for each message, in milliseconds since the Unix epoch. When left empty, the current timestamp is used. You cannot set both `timestamp` and `timestamp_ms`. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: timestamp_ms: ${! timestamp_unix_milli() } # --- timestamp_ms: ${! metadata("kafka_timestamp_ms") } ``` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `tombstone` An optional boolean that, when it resolves to `true` for a message, writes that message as a tombstone: a record with a null value. The message payload is ignored for tombstones. Use this to delete keys on compacted topics, or to keep tombstones intact when mirroring a topic. An empty payload is not a tombstone. The interpolation must resolve to a value that can be parsed as a boolean, otherwise the write fails. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: tombstone: ${! @kafka_tombstone_message } # --- tombstone: ${! @operation == "delete" } ``` ### `topic` A topic to write messages to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` --- # Page 134: kafka **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/kafka.md --- # kafka > ⚠️ **WARNING** > > This component is deprecated and will be removed in a future version. The kafka output type writes a batch of messages to Kafka brokers and waits for acknowledgement before propagating it back to the input. This output is deprecated as of version 4.113.0. Use the [`redpanda` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda/) instead. The config field `ack_replicas` determines whether we wait for acknowledgement from all replicas or just a single broker. Both the `key` and `topic` fields can be dynamically set using function interpolations described in [Bloblang queries](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). [Metadata](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/metadata/) will be added to each message sent as headers (version 0.11+), but can be restricted using the field [`metadata`](#metadata). ## Strict ordering and retries When strict ordering is required for messages written to topic partitions it is important to ensure that both the field `max_in_flight` is set to `1` and that the field `retry_as_batch` is set to `true`. You must also ensure that failed batches are never rerouted back to the same output. This can be done by setting the field `max_retries` to `0` and `backoff.max_elapsed_time` to empty, which will apply back pressure indefinitely until the batch is sent successfully. However, this also means that manual intervention will eventually be required in cases where the batch cannot be sent due to configuration problems such as an incorrect `max_msg_bytes` estimate. A less strict but automated alternative would be to route failed batches to a dead letter queue using a [`fallback` broker](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/fallback/), but this would allow subsequent batches to be delivered in the meantime whilst those failed batches are dealt with. ## Troubleshooting - I’m seeing logs that report `Failed to connect to kafka: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)`, but the brokers are definitely reachable. Unfortunately this error message will appear for a wide range of connection problems even when the broker endpoint can be reached. Double check your authentication configuration and also ensure that you have [enabled TLS](#tls-enabled) if applicable. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" kafka: addresses: [] # No default (required) topic: "" # No default (required) target_version: "" # No default (optional) key: "" partitioner: fnv1a_hash compression: none static_headers: {} # No default (optional) metadata: exclude_prefixes: [] max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" kafka: addresses: [] # No default (required) tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] sasl: mechanism: none user: "" password: "" access_token: "" token_cache: "" token_key: "" topic: "" # No default (required) client_id: benthos target_version: "" # No default (optional) rack_id: "" key: "" partitioner: fnv1a_hash partition: "" custom_topic_creation: enabled: false partitions: -1 replication_factor: -1 compression: none static_headers: {} # No default (optional) metadata: exclude_prefixes: [] inject_tracing_map: "" # No default (optional) max_in_flight: 64 idempotent_write: false ack_replicas: false max_msg_bytes: 1000000 timeout: 5s retry_as_batch: false batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) max_retries: 0 backoff: initial_interval: 3s max_interval: 10s max_elapsed_time: 30s timestamp_ms: "" # No default (optional) ``` ## Fields ### `ack_replicas` Ensure that messages have been copied across all replicas before acknowledging receipt. When `idempotent_write` is `true`, the output acts as if this field is `true`. **Type**: `bool` **Default**: `false` ### `addresses[]` A list of broker addresses to connect to. List items that contain commas are expanded into multiple addresses. **Type**: `array` ```yaml # Examples: addresses: - "localhost:9092" # --- addresses: - "localhost:9041,localhost:9042" # --- addresses: - "localhost:9041" - "localhost:9042" ``` ### `backoff` The exponential backoff between attempts to resend messages that failed to send. **Type**: `object` ### `backoff.initial_interval` The initial period to wait between retry attempts. The retry interval increases for each failed attempt, up to the `max_interval` value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `3s` ```yaml # Examples: initial_interval: 50ms # --- initial_interval: 1s ``` ### `backoff.max_elapsed_time` The maximum overall period of time to spend on retry attempts before the request is aborted. Setting this value to a zeroed duration (such as `0s`) will result in unbounded retries. **Type**: `string` **Default**: `30s` ```yaml # Examples: max_elapsed_time: 1m # --- max_elapsed_time: 1h ``` ### `backoff.max_interval` The maximum period to wait between retry attempts **Type**: `string` **Default**: `10s` ```yaml # Examples: max_interval: 5s # --- max_interval: 1m ``` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `client_id` The client ID sent to brokers with every request, which lets brokers attribute requests to this client in their logs, metrics, and client quotas. **Type**: `string` **Default**: `benthos` ### `compression` The compression algorithm to use. **Type**: `string` **Default**: `none` **Options**: `none`, `snappy`, `lz4`, `gzip`, `zstd` ### `custom_topic_creation` If enabled, topics will be created with the specified number of partitions and replication factor if they do not already exist. **Type**: `object` ### `custom_topic_creation.enabled` Whether to enable custom topic creation. **Type**: `bool` **Default**: `false` ### `custom_topic_creation.partitions` The number of partitions to create for new topics. Leave at -1 to use the broker configured default. Must be >= 1. **Type**: `int` **Default**: `-1` ### `custom_topic_creation.replication_factor` The replication factor to use for new topics. Leave at -1 to use the broker configured default. Must be an odd number, and less then or equal to the number of brokers. **Type**: `int` **Default**: `-1` ### `idempotent_write` Enable the idempotent write producer option, so that retries do not write duplicate messages. This requires the `IDEMPOTENT_WRITE` permission on `CLUSTER` and can be disabled if this permission is not available. When enabled, the output waits for acknowledgement from all in-sync replicas, as if `ack_replicas` is `true`. It also sends only one request at a time on each broker connection. **Type**: `bool` **Default**: `false` ### `inject_tracing_map` EXPERIMENTAL: A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) used to inject an object containing tracing propagation information into outbound messages. The specification of the injected fields will match the format used by the service wide tracer. **Type**: `string` ```yaml # Examples: inject_tracing_map: meta = @.merge(this) # --- inject_tracing_map: root.meta.span = this ``` ### `key` An optional key to populate for each message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `max_msg_bytes` The maximum size in bytes of messages sent to the target topic. **Type**: `int` **Default**: `1000000` ### `max_retries` The maximum number of retries before giving up on the request. If set to zero there is no discrete limit. **Type**: `int` **Default**: `0` ### `metadata` Specify which metadata values are added to each record as Kafka headers. Headers are only sent when `target_version` is `0.11.0` or later. **Type**: `object` ### `metadata.exclude_prefixes[]` Provide a list of explicit metadata key prefixes to exclude when adding metadata to sent messages. **Type**: `array` **Default**: `[]` ### `partition` The manually-specified partition to publish messages to, relevant only when the field `partitioner` is set to `manual`. Must be able to parse as a 32-bit integer. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `partitioner` The partitioning algorithm to use. **Type**: `string` **Default**: `fnv1a_hash` **Options**: `fnv1a_hash`, `murmur2_hash`, `random`, `round_robin`, `manual` ### `rack_id` A rack identifier for this client. **Type**: `string` **Default**: `""` ### `retry_as_batch` When enabled forces an entire batch of messages to be retried if any individual message fails on a send, otherwise only the individual messages that failed are retried. Disabling this helps to reduce message duplicates during intermittent errors, but also makes it impossible to guarantee strict ordering of messages. **Type**: `bool` **Default**: `false` ### `sasl` Enables SASL authentication. **Type**: `object` ### `sasl.access_token` A static OAUTHBEARER access token **Type**: `string` **Default**: `""` ### `sasl.mechanism` The SASL authentication mechanism, if left empty SASL authentication is not used. **Type**: `string` **Default**: `none` | Option | Summary | | --- | --- | | `OAUTHBEARER` | OAuth Bearer based authentication. | | `PLAIN` | Plain text authentication. NOTE: When using plain text auth it is extremely likely that you’ll also need to [enable TLS](#tls-enabled). | | `SCRAM-SHA-256` | Authentication using the SCRAM-SHA-256 mechanism. | | `SCRAM-SHA-512` | Authentication using the SCRAM-SHA-512 mechanism. | | `none` | Default, no SASL authentication. | ### `sasl.password` A PLAIN password. It is recommended that you use environment variables to populate this field. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: ${PASSWORD} ``` ### `sasl.token_cache` Instead of using a static `access_token` allows you to query a [`cache`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) resource to fetch OAUTHBEARER tokens from **Type**: `string` **Default**: `""` ### `sasl.token_key` Required when using a `token_cache`, the key to query the cache with for tokens. **Type**: `string` **Default**: `""` ### `sasl.user` A PLAIN username. It is recommended that you use environment variables to populate this field. **Type**: `string` **Default**: `""` ```yaml # Examples: user: ${USER} ``` ### `static_headers` An optional map of static headers that should be added to messages in addition to metadata. **Type**: `object` ```yaml # Examples: static_headers: first-static-header: value-1 second-static-header: value-2 ``` ### `target_version` The version of the Kafka protocol to use. This limits the capabilities used by the client and should ideally match the version of your brokers. Defaults to the oldest supported stable version. **Type**: `string` ```yaml # Examples: target_version: 2.8.0 # --- target_version: 3.1.0 ``` ### `timeout` The maximum period of time to wait for message sends before abandoning the request and retrying. **Type**: `string` **Default**: `5s` ### `timestamp_ms` An optional timestamp to set for each message, in milliseconds since the Unix epoch. When left empty, the current timestamp is used. You cannot set both `timestamp` and `timestamp_ms`. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: timestamp_ms: ${! timestamp_unix_milli() } # --- timestamp_ms: ${! metadata("kafka_timestamp_ms") } ``` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `topic` The topic to publish messages to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` --- # Page 135: mongodb **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/mongodb.md --- # mongodb Inserts items into a MongoDB collection. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). > 📝 **NOTE** > > If the service only accepts connections from allowlisted IP addresses, add your cluster’s egress addresses to its allowlist before you deploy the pipeline. On BYOC clusters, see [Allow Pipeline Traffic Through External Firewalls](https://docs.redpanda.com/cloud-data-platform/networking/connect-external-allowlist/) to find the addresses. For Dedicated or Serverless clusters, contact Redpanda support for the addresses. ### Common ```yml output: label: "" mongodb: url: "" # No default (required) database: "" # No default (required) username: "" password: "" collection: "" # No default (required) operation: update-one write_concern: w: majority j: false w_timeout: "" document_map: "" filter_map: "" hint_map: "" upsert: false max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" mongodb: url: "" # No default (required) database: "" # No default (required) username: "" password: "" app_name: benthos aws: enabled: false region: "" # No default (optional) session_duration: 1h id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) roles: [] # No default (optional) collection: "" # No default (required) operation: update-one write_concern: w: majority j: false w_timeout: "" document_map: "" filter_map: "" hint_map: "" upsert: false max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `app_name` The client application name. **Type**: `string` **Default**: `benthos` ### `aws` AWS IAM authentication using the `MONGODB-AWS` mechanism, for example against MongoDB Atlas. When enabled, IAM credentials are used instead of a static username and password. Role-derived session credentials are resolved when the component connects and are re-resolved whenever it reconnects. The `mongodb` processor and cache establish their client once at creation and cannot refresh expiring session credentials, so `role`, `roles` and session tokens are rejected for those components; use the ambient credential chain or long-lived access keys with them. For long-running pipelines, prefer the ambient credential chain (leave keys and roles unset), which the driver refreshes automatically. **Type**: `object` ### `aws.enabled` Enable AWS IAM authentication using the driver-native `MONGODB-AWS` mechanism. The MongoDB Atlas database user must be created with the AWS IAM authentication type, and connections require TLS. When no static credentials or roles are configured, the ambient AWS credential chain (environment variables, EC2 instance profile, EKS pod role) is used and expiring credentials are refreshed automatically. **Type**: `bool` **Default**: `false` ### `aws.id` The AWS access key ID to authenticate with. When empty, the default AWS credential chain is used. **Type**: `string` ### `aws.region` The AWS region used when assuming roles (for STS calls). Only used when `role` or `roles` are configured; the ambient and static-key paths ignore it. If no region is specified then the environment default is used. **Type**: `string` ### `aws.role` Optional AWS IAM role ARN to assume for authentication. Cannot be combined with `roles`; use the `roles` array instead when chaining multiple roles. **Type**: `string` ### `aws.role_external_id` Optional external ID to use when assuming the role set in `role`. Each entry in `roles` sets its own external ID. **Type**: `string` ### `aws.roles[]` Optional array of AWS IAM roles to assume for authentication. Roles are assumed in sequence, each using the credentials of the previous one, enabling chaining for purposes such as cross-account access. Each role can optionally specify an external ID. Cannot be combined with `role`. **Type**: `array` ### `aws.roles[].role` AWS IAM role ARN to assume. **Type**: `string` **Default**: `""` ### `aws.roles[].role_external_id` Optional external ID for the role assumption. **Type**: `string` **Default**: `""` ### `aws.secret` The AWS secret access key that pairs with `id`. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `aws.session_duration` The duration of the STS session requested when assuming roles. AWS requires at least 15 minutes and caps sessions created through role chaining at one hour. Only used when `role` or `roles` are configured. For long-running pipelines, prefer the ambient credential chain over a fixed session duration, since the driver refreshes ambient credentials automatically as they near expiry. **Type**: `string` **Default**: `1h` ### `aws.token` The AWS session token to use with `id` and `secret`. Required only when using short-term credentials. **Type**: `string` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `collection` The name of the target collection. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `database` The name of the target MongoDB database. **Type**: `string` ### `document_map` A Bloblang map that represents a document to store in MongoDB, expressed as [extended JSON in canonical form](https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/). The `document_map` parameter is required for the following database operations: `insert-one`, `replace-one`, `update-one`, and `aggregate`. **Type**: `string` **Default**: `""` ```yaml # Examples: document_map: |- root.a = this.foo root.b = this.bar ``` ### `filter_map` A Bloblang map that represents a filter for a MongoDB command, expressed as [extended JSON in canonical form](https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/). The `filter_map` parameter is required for all database operations except `insert-one`. The `filter_map` is used to find documents for the specified operation. For example, for a `delete-one` operation, the filter map should include the fields required to locate the document for deletion. **Type**: `string` **Default**: `""` ```yaml # Examples: filter_map: |- root.a = this.foo root.b = this.bar ``` ### `hint_map` A Bloblang map that represents a hint or index for a MongoDB command to use, expressed as [extended JSON in canonical form](https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/). This map is optional, and is used with all operations except `insert-one`. Define a `hint_map` to improve performance when finding documents in the MongoDB database. **Type**: `string` **Default**: `""` ```yaml # Examples: hint_map: |- root.a = this.foo root.b = this.bar ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `operation` The MongoDB database operation to perform. **Type**: `string` **Default**: `update-one` **Options**: `insert-one`, `delete-one`, `delete-many`, `replace-one`, `update-one` ### `password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `upsert` The `upsert` parameter is optional, and only applies for `update-one` and `replace-one` operations. If the filter specified in `filter_map` matches an existing document, this operation updates or replaces the document, otherwise a new document is created. **Type**: `bool` **Default**: `false` ### `url` The URL of the target MongoDB server. **Type**: `string` ```yaml # Examples: url: mongodb://localhost:27017 ``` ### `username` The username to connect to the database. **Type**: `string` **Default**: `""` ### `write_concern` The [write concern settings](https://www.mongodb.com/docs/manual/reference/write-concern/) for the MongoDB connection. **Type**: `object` ### `write_concern.j` The `j` option requests acknowledgement from MongoDB that write operations are written to the journal. **Type**: `bool` **Default**: `false` ### `write_concern.w` The `w` option requests acknowledgement that write operations propagate to the specified number of MongoDB instances. Set it to `majority` to wait for a calculated majority of nodes to acknowledge the write operation, to an integer to specify the minimum number of nodes that must acknowledge the operation, or to the name of a custom write concern configured in the cluster. **Type**: `string` **Default**: `majority` ### `write_concern.w_timeout` The write concern timeout. **Type**: `string` **Default**: `""` --- # Page 136: mqtt **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/mqtt.md --- # mqtt Pushes messages to an MQTT broker. The `topic` field can be dynamically set using function interpolations described [here](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). When sending batched messages these interpolations are performed per message part. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. ### Common ```yml output: label: "" mqtt: urls: [] # No default (required) client_id: "" connect_timeout: 30s topic: "" # No default (required) qos: 1 write_timeout: 3s retained: false max_in_flight: 64 ``` ### Advanced ```yml output: label: "" mqtt: urls: [] # No default (required) client_id: "" dynamic_client_id_suffix: "" # No default (optional) connect_timeout: 30s will: enabled: false qos: 0 retained: false topic: "" payload: "" user: "" password: "" keepalive: 30 tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] topic: "" # No default (required) qos: 1 write_timeout: 3s retained: false retained_interpolated: "" # No default (optional) max_in_flight: 64 ``` ## Fields ### `client_id` The client identifier sent to the MQTT broker when connecting, which the broker uses to identify the client session. Use `dynamic_client_id_suffix` to give each run of the pipeline a unique identifier. **Type**: `string` **Default**: `""` ### `connect_timeout` The maximum amount of time to wait in order to establish a connection before the attempt is abandoned. **Type**: `string` **Default**: `30s` ```yaml # Examples: connect_timeout: 1s # --- connect_timeout: 500ms ``` ### `dynamic_client_id_suffix` Append a dynamically generated suffix to the specified `client_id` on each run of the pipeline. This can be useful when clustering Redpanda Connect producers. **Type**: `string` | Option | Summary | | --- | --- | | `nanoid` | append a nanoid of length 21 characters | ### `keepalive` Max seconds of inactivity before a keepalive message is sent. **Type**: `int` **Default**: `30` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `password` A password to connect with. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `qos` The QoS value to set for each message. Has options 0, 1, 2. **Type**: `int` **Default**: `1` ### `retained` Set message as retained on the topic. **Type**: `bool` **Default**: `false` ### `retained_interpolated` Override the value of `retained` with an interpolable value, this allows it to be dynamically set based on message contents. The value must resolve to either `true` or `false`. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `topic` The topic to publish messages to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `urls[]` A list of URLs to connect to. Use the format `scheme://host:port`, where: - `scheme` is one of the following: `tcp`, `ssl`, `ws` - `host` is the IP address or hostname - `port` is the port on which the MQTT broker accepts connections If an item in the list contains commas, it is expanded into multiple URLs. **Type**: `array` ```yaml # Examples: urls: - "tcp://localhost:1883" ``` ### `user` A username to connect with. **Type**: `string` **Default**: `""` ### `will` Set last will message in case of Redpanda Connect failure **Type**: `object` ### `will.enabled` Whether to enable last will messages. **Type**: `bool` **Default**: `false` ### `will.payload` Set payload for last will message. **Type**: `string` **Default**: `""` ### `will.qos` Set QoS for last will message. Valid values are: 0, 1, 2. **Type**: `int` **Default**: `0` ### `will.retained` Set retained for last will message. **Type**: `bool` **Default**: `false` ### `will.topic` Set topic for last will message. **Type**: `string` **Default**: `""` ### `write_timeout` The maximum amount of time to wait to write data before the attempt is abandoned. **Type**: `string` **Default**: `3s` ```yaml # Examples: write_timeout: 1s # --- write_timeout: 500ms ``` --- # Page 137: nats_jetstream **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/nats_jetstream.md --- # nats_jetstream Writes messages to a NATS JetStream subject. ## Connection name When monitoring and managing a production [NATS system](https://docs.nats.io/nats-concepts/overview), it is often useful to know which connection a message was sent or received from. This can be achieved by setting the connection name option when creating a NATS connection. Redpanda Connect will automatically set the connection name based off the label of the given NATS component, so that monitoring tools between NATS and Redpanda Connect can stay in sync. ## Authentication There are several components within Redpanda Connect which uses NATS services. You will find that each of these components support optional advanced authentication parameters for [NKeys](https://docs.nats.io/nats-server/configuration/securing_nats/auth_intro/nkey_auth) and [User Credentials](https://docs.nats.io/using-nats/developer/connecting/creds). See an [in-depth tutorial](https://docs.nats.io/running-a-nats-service/nats_admin/security/jwt). ### NKey file The NATS server can use these NKeys in several ways for authentication. The simplest is for the server to be configured with a list of known public keys. The server then generates a challenge for each connection request from a client, and the client must respond to the challenge by signing it with its private NKey configured in the `nkey_file` or `nkey` field. [More details](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth). ### User credentials NATS server supports decentralized authentication based on JSON Web Tokens (JWT). Clients need an [user JWT](https://docs.nats.io/nats-server/configuration/securing_nats/jwt#json-web-tokens) and a corresponding [NKey secret](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth) when connecting to a server which is configured to use this authentication scheme. The `user_credentials_file` field should point to a file containing both the private key and the JWT and can be generated with the [nsc tool](https://docs.nats.io/nats-tools/nsc). Alternatively, the `user_jwt` field can contain a plain text JWT and the `user_nkey_seed` field can contain the plain text NKey Seed. [More details](https://docs.nats.io/using-nats/developer/connecting/creds). ### Token The `token` field can contain a plain text token string for [token-based authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/tokens). ### User and password The `user` and `password` fields can be used for [username/password authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/username_password). #### Common ```yml output: label: "" nats_jetstream: urls: [] # No default (required) subject: "" # No default (required) headers: {} metadata: include_prefixes: [] include_patterns: [] max_in_flight: 1024 ``` #### Advanced ```yml output: label: "" nats_jetstream: urls: [] # No default (required) max_reconnects: 0 # No default (optional) subject: "" # No default (required) headers: {} metadata: include_prefixes: [] include_patterns: [] max_in_flight: 1024 tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] tls_handshake_first: false auth: nkey_file: "" # No default (optional) nkey: "" # No default (optional) user_credentials_file: "" # No default (optional) user_jwt: "" # No default (optional) user_nkey_seed: "" # No default (optional) user: "" # No default (optional) password: "" # No default (optional) token: "" # No default (optional) inject_tracing_map: "" # No default (optional) ``` ## Fields ### `auth` Optional configuration of NATS authentication parameters. **Type**: `object` ### `auth.nkey` Your NKey seed (private key) for NATS authentication. NKeys provide cryptographic authentication without passwords. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: nkey: UDXU4RCSJNZOIQHZNWXHXORDPRTGNJAHAHFRGZNEEJCPQTT2M7NLCNF4 ``` ### `auth.nkey_file` An optional file containing a NKey seed. **Type**: `string` ```yaml # Examples: nkey_file: ./seed.nk ``` ### `auth.password` An optional plain text password (given along with the corresponding user name). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.token` An optional plain text token. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user` An optional plain text user name (given along with the corresponding user password). **Type**: `string` ### `auth.user_credentials_file` An optional file containing user credentials which consist of a user JWT and corresponding NKey seed. **Type**: `string` ```yaml # Examples: user_credentials_file: ./user.creds ``` ### `auth.user_jwt` An optional plaintext user JWT to use along with the corresponding user NKey seed. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user_nkey_seed` An optional plaintext user NKey seed to use along with the corresponding user JWT. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `headers` Explicit message headers to add to messages. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` **Default**: `{}` ```yaml # Examples: headers: Content-Type: application/json Timestamp: ${!meta("Timestamp")} ``` ### `inject_tracing_map` EXPERIMENTAL: A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) used to inject an object containing tracing propagation information into outbound messages. The specification of the injected fields will match the format used by the service wide tracer. **Type**: `string` ```yaml # Examples: inject_tracing_map: meta = @.merge(this) # --- inject_tracing_map: root.meta.span = this ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `1024` ### `max_reconnects` The maximum number of times to attempt to reconnect to the server. If negative, it will never stop trying to reconnect. **Type**: `int` ### `metadata` Specify which metadata values are added to messages as NATS headers, alongside any explicit `headers`. **Type**: `object` ### `metadata.include_patterns[]` A list of explicit metadata key regular expression (re2) patterns to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_patterns: - .* # --- include_patterns: - _timestamp_unix$ ``` ### `metadata.include_prefixes[]` A list of explicit metadata key prefixes to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_prefixes: - foo_ - bar_ # --- include_prefixes: - kafka_ # --- include_prefixes: - content- ``` ### `subject` A subject to write to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: subject: foo.bar.baz # --- subject: ${! meta("kafka_topic") } # --- subject: foo.${! json("meta.type") } ``` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `tls_handshake_first` Whether to perform the initial TLS handshake before sending the NATS INFO protocol message. This is required when connecting to some NATS servers that expect TLS to be established immediately after connection, before any protocol negotiation. **Type**: `bool` **Default**: `false` ### `urls[]` A list of URLs to connect to. If a list item contains commas, it will be expanded into multiple URLs. **Type**: `array` ```yaml # Examples: urls: - "nats://127.0.0.1:4222" # --- urls: - "nats://username:password@127.0.0.1:4222" ``` --- # Page 138: nats_kv **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/nats_kv.md --- # nats_kv Puts messages in a NATS key-value bucket. The field `key` supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries), allowing you to create a unique key for each message. ## Connection name When monitoring and managing a production [NATS system](https://docs.nats.io/nats-concepts/overview), it is often useful to know which connection a message was sent or received from. This can be achieved by setting the connection name option when creating a NATS connection. Redpanda Connect will automatically set the connection name based off the label of the given NATS component, so that monitoring tools between NATS and Redpanda Connect can stay in sync. ## Authentication There are several components within Redpanda Connect which uses NATS services. You will find that each of these components support optional advanced authentication parameters for [NKeys](https://docs.nats.io/nats-server/configuration/securing_nats/auth_intro/nkey_auth) and [User Credentials](https://docs.nats.io/using-nats/developer/connecting/creds). See an [in-depth tutorial](https://docs.nats.io/running-a-nats-service/nats_admin/security/jwt). ### NKey file The NATS server can use these NKeys in several ways for authentication. The simplest is for the server to be configured with a list of known public keys. The server then generates a challenge for each connection request from a client, and the client must respond to the challenge by signing it with its private NKey configured in the `nkey_file` or `nkey` field. [More details](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth). ### User credentials NATS server supports decentralized authentication based on JSON Web Tokens (JWT). Clients need an [user JWT](https://docs.nats.io/nats-server/configuration/securing_nats/jwt#json-web-tokens) and a corresponding [NKey secret](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth) when connecting to a server which is configured to use this authentication scheme. The `user_credentials_file` field should point to a file containing both the private key and the JWT and can be generated with the [nsc tool](https://docs.nats.io/nats-tools/nsc). Alternatively, the `user_jwt` field can contain a plain text JWT and the `user_nkey_seed` field can contain the plain text NKey Seed. [More details](https://docs.nats.io/using-nats/developer/connecting/creds). ### Token The `token` field can contain a plain text token string for [token-based authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/tokens). ### User and password The `user` and `password` fields can be used for [username/password authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/username_password). #### Common ```yml output: label: "" nats_kv: urls: [] # No default (required) bucket: "" # No default (required) key: "" # No default (required) max_in_flight: 1024 ``` #### Advanced ```yml output: label: "" nats_kv: urls: [] # No default (required) max_reconnects: 0 # No default (optional) bucket: "" # No default (required) key: "" # No default (required) max_in_flight: 1024 tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] tls_handshake_first: false auth: nkey_file: "" # No default (optional) nkey: "" # No default (optional) user_credentials_file: "" # No default (optional) user_jwt: "" # No default (optional) user_nkey_seed: "" # No default (optional) user: "" # No default (optional) password: "" # No default (optional) token: "" # No default (optional) ``` ## Fields ### `auth` Optional configuration of NATS authentication parameters. **Type**: `object` ### `auth.nkey` Your NKey seed (private key) for NATS authentication. NKeys provide cryptographic authentication without passwords. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: nkey: UDXU4RCSJNZOIQHZNWXHXORDPRTGNJAHAHFRGZNEEJCPQTT2M7NLCNF4 ``` ### `auth.nkey_file` An optional file containing a NKey seed. **Type**: `string` ```yaml # Examples: nkey_file: ./seed.nk ``` ### `auth.password` An optional plain text password (given along with the corresponding user name). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.token` An optional plain text token. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user` An optional plain text user name (given along with the corresponding user password). **Type**: `string` ### `auth.user_credentials_file` An optional file containing user credentials which consist of a user JWT and corresponding NKey seed. **Type**: `string` ```yaml # Examples: user_credentials_file: ./user.creds ``` ### `auth.user_jwt` An optional plaintext user JWT to use along with the corresponding user NKey seed. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user_nkey_seed` An optional plaintext user NKey seed to use along with the corresponding user JWT. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `bucket` The name of the KV bucket. **Type**: `string` ```yaml # Examples: bucket: my_kv_bucket ``` ### `key` The key for each message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: key: foo # --- key: foo.bar.baz # --- key: foo.${! json("meta.type") } ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `1024` ### `max_reconnects` The maximum number of times to attempt to reconnect to the server. If negative, it will never stop trying to reconnect. **Type**: `int` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `tls_handshake_first` Whether to perform the initial TLS handshake before sending the NATS INFO protocol message. This is required when connecting to some NATS servers that expect TLS to be established immediately after connection, before any protocol negotiation. **Type**: `bool` **Default**: `false` ### `urls[]` A list of URLs to connect to. If a list item contains commas, it will be expanded into multiple URLs. **Type**: `array` ```yaml # Examples: urls: - "nats://127.0.0.1:4222" # --- urls: - "nats://username:password@127.0.0.1:4222" ``` --- # Page 139: nats **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/nats.md --- # nats Publishes to a NATS subject. This output will interpolate functions within the subject field, you can find a list of functions [here](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ## Connection name When monitoring and managing a production [NATS system](https://docs.nats.io/nats-concepts/overview), it is often useful to know which connection a message was sent or received from. This can be achieved by setting the connection name option when creating a NATS connection. Redpanda Connect will automatically set the connection name based off the label of the given NATS component, so that monitoring tools between NATS and Redpanda Connect can stay in sync. ## Authentication There are several components within Redpanda Connect which uses NATS services. You will find that each of these components support optional advanced authentication parameters for [NKeys](https://docs.nats.io/nats-server/configuration/securing_nats/auth_intro/nkey_auth) and [User Credentials](https://docs.nats.io/using-nats/developer/connecting/creds). See an [in-depth tutorial](https://docs.nats.io/running-a-nats-service/nats_admin/security/jwt). ### NKey file The NATS server can use these NKeys in several ways for authentication. The simplest is for the server to be configured with a list of known public keys. The server then generates a challenge for each connection request from a client, and the client must respond to the challenge by signing it with its private NKey configured in the `nkey_file` or `nkey` field. [More details](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth). ### User credentials NATS server supports decentralized authentication based on JSON Web Tokens (JWT). Clients need an [user JWT](https://docs.nats.io/nats-server/configuration/securing_nats/jwt#json-web-tokens) and a corresponding [NKey secret](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth) when connecting to a server which is configured to use this authentication scheme. The `user_credentials_file` field should point to a file containing both the private key and the JWT and can be generated with the [nsc tool](https://docs.nats.io/nats-tools/nsc). Alternatively, the `user_jwt` field can contain a plain text JWT and the `user_nkey_seed` field can contain the plain text NKey Seed. [More details](https://docs.nats.io/using-nats/developer/connecting/creds). ### Token The `token` field can contain a plain text token string for [token-based authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/tokens). ### User and password The `user` and `password` fields can be used for [username/password authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/username_password). #### Common ```yml output: label: "" nats: urls: [] # No default (required) subject: "" # No default (required) headers: {} metadata: include_prefixes: [] include_patterns: [] max_in_flight: 64 ``` #### Advanced ```yml output: label: "" nats: urls: [] # No default (required) max_reconnects: 0 # No default (optional) subject: "" # No default (required) headers: {} metadata: include_prefixes: [] include_patterns: [] max_in_flight: 64 tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] tls_handshake_first: false auth: nkey_file: "" # No default (optional) nkey: "" # No default (optional) user_credentials_file: "" # No default (optional) user_jwt: "" # No default (optional) user_nkey_seed: "" # No default (optional) user: "" # No default (optional) password: "" # No default (optional) token: "" # No default (optional) inject_tracing_map: "" # No default (optional) ``` ## Fields ### `auth` Optional configuration of NATS authentication parameters. **Type**: `object` ### `auth.nkey` Your NKey seed (private key) for NATS authentication. NKeys provide cryptographic authentication without passwords. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: nkey: UDXU4RCSJNZOIQHZNWXHXORDPRTGNJAHAHFRGZNEEJCPQTT2M7NLCNF4 ``` ### `auth.nkey_file` An optional file containing a NKey seed. **Type**: `string` ```yaml # Examples: nkey_file: ./seed.nk ``` ### `auth.password` An optional plain text password (given along with the corresponding user name). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.token` An optional plain text token. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user` An optional plain text user name (given along with the corresponding user password). **Type**: `string` ### `auth.user_credentials_file` An optional file containing user credentials which consist of a user JWT and corresponding NKey seed. **Type**: `string` ```yaml # Examples: user_credentials_file: ./user.creds ``` ### `auth.user_jwt` An optional plaintext user JWT to use along with the corresponding user NKey seed. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user_nkey_seed` An optional plaintext user NKey seed to use along with the corresponding user JWT. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `headers` Explicit message headers to add to messages. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` **Default**: `{}` ```yaml # Examples: headers: Content-Type: application/json Timestamp: ${!meta("Timestamp")} ``` ### `inject_tracing_map` EXPERIMENTAL: A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) used to inject an object containing tracing propagation information into outbound messages. The specification of the injected fields will match the format used by the service wide tracer. **Type**: `string` ```yaml # Examples: inject_tracing_map: meta = @.merge(this) # --- inject_tracing_map: root.meta.span = this ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `max_reconnects` The maximum number of times to attempt to reconnect to the server. If negative, it will never stop trying to reconnect. **Type**: `int` ### `metadata` Specify which metadata values are added to messages as NATS headers, alongside any explicit `headers`. **Type**: `object` ### `metadata.include_patterns[]` A list of explicit metadata key regular expression (re2) patterns to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_patterns: - .* # --- include_patterns: - _timestamp_unix$ ``` ### `metadata.include_prefixes[]` A list of explicit metadata key prefixes to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_prefixes: - foo_ - bar_ # --- include_prefixes: - kafka_ # --- include_prefixes: - content- ``` ### `subject` The subject to publish to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: subject: foo.bar.baz ``` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `tls_handshake_first` Whether to perform the initial TLS handshake before sending the NATS INFO protocol message. This is required when connecting to some NATS servers that expect TLS to be established immediately after connection, before any protocol negotiation. **Type**: `bool` **Default**: `false` ### `urls[]` A list of URLs to connect to. If a list item contains commas, it will be expanded into multiple URLs. **Type**: `array` ```yaml # Examples: urls: - "nats://127.0.0.1:4222" # --- urls: - "nats://username:password@127.0.0.1:4222" ``` --- # Page 140: opensearch **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/opensearch.md --- # opensearch Publishes messages into an Elasticsearch index. If the index does not exist then it is created with a dynamic mapping. Both the `id` and `index` fields can be dynamically set using function interpolations described [here](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). When sending batched messages these interpolations are performed per message part. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" opensearch: urls: [] # No default (required) index: "" # No default (required) action: "" # No default (required) id: "" # No default (required) max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" opensearch: urls: [] # No default (required) index: "" # No default (required) action: "" # No default (required) id: "" # No default (required) pipeline: "" routing: "" tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] compress_request_body: false max_in_flight: 64 basic_auth: enabled: false username: "" password: "" batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) aws: enabled: false region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) ``` ## Examples ### Updating Documents When [updating documents](https://opensearch.org/docs/latest/api-reference/document-apis/update-document/) the request body should contain a combination of a `doc`, `upsert`, and/or `script` fields at the top level, this should be done via mapping processors. ```yaml output: processors: - mapping: | meta id = this.id root.doc = this opensearch: urls: [ TODO ] index: foo id: ${! @id } action: update ``` ## Fields ### `action` The action to take on the document. This field must resolve to one of the following action types: `index`, `update` or `delete`. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `aws` Enables and customises connectivity to Amazon Elastic Service. **Type**: `object` ### `aws.credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `aws.credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `aws.credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `aws.credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `aws.credentials.role` The ARN of the role to assume. **Type**: `string` ### `aws.credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `aws.credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `aws.credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `aws.enabled` Whether to connect to Amazon Elastic Service. **Type**: `bool` **Default**: `false` ### `aws.endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `aws.region` The AWS region in which your resources are hosted. **Type**: `string` ### `aws.tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `aws.tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `aws.tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `aws.tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `aws.tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `aws.tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `aws.tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `basic_auth` Configure basic authentication credentials for connecting to OpenSearch. When enabled, these credentials are sent with each request to authenticate with the cluster. **Type**: `object` ### `basic_auth.enabled` Whether to send the `username` and `password` credentials with each request. **Type**: `bool` **Default**: `false` ### `basic_auth.password` A password to authenticate with. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `basic_auth.username` A username to authenticate as. **Type**: `string` **Default**: `""` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `compress_request_body` Enable gzip compression of HTTP request bodies on the OpenSearch client. OpenSearch 2.x servers accept `Content-Encoding: gzip` natively; this is useful to reduce bandwidth on cross-cloud or cross-region bulk writes. **Type**: `bool` **Default**: `false` ### `id` The ID for indexed messages. Use [function interpolations](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries) to dynamically create a unique ID for each message. **Type**: `string` ```yaml # Examples: id: ${!counter()}-${!timestamp_unix()} ``` ### `index` The OpenSearch index where messages are published. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `pipeline` The ID of an optional ingest pipeline to preprocess incoming documents before they are indexed. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `routing` A custom routing value for each document, which determines the shard it is stored on. When empty, the document ID is used. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `urls[]` A list of URLs to connect to. If an item in the list contains commas, it is split into multiple URLs. **Type**: `array` ```yaml # Examples: urls: - "http://localhost:9200" ``` --- # Page 141: otlp_grpc **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/otlp_grpc.md --- # otlp_grpc Send OpenTelemetry traces, logs, and metrics via OTLP/gRPC protocol. Sends OpenTelemetry telemetry data to a remote collector via OTLP/gRPC protocol. Accepts batches of Redpanda OTEL v1 messages (spans, log records, or metrics) and converts them to OTLP format for transmission to OpenTelemetry collectors. ## Input format This output expects messages in Redpanda OTEL v1 format (protobuf or JSON, detected automatically) with the following metadata: - `otel_signal_type`: The signal type (`trace`, `log`, or `metric`) Messages produced by the `otlp_grpc` and `otlp_http` inputs already include this metadata. Each batch must contain messages of the same signal type. The entire batch is converted to a single OTLP export request and sent via gRPC. ## Authentication This output supports OAuth v2 authentication using the `oauth2` configuration block. OAuth v2 requires TLS to be enabled. To send a static bearer token, add an `authorization` header using the `headers` field. ### Common ```yml output: label: "" otlp_grpc: endpoint: "" # No default (required) max_in_flight: 64 ``` ### Advanced ```yml output: label: "" otlp_grpc: endpoint: "" # No default (required) headers: {} timeout: 30s compression: gzip tls: enabled: false skip_cert_verify: false cert_file: "" key_file: "" tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s oauth2: enabled: false client_key: "" client_secret: "" token_url: "" scopes: [] endpoint_params: {} max_in_flight: 64 ``` ## Fields ### `compression` Compression type for gRPC requests. Options: 'gzip' or 'none'. **Type**: `string` **Default**: `gzip` **Options**: `gzip`, `none` ### `endpoint` The gRPC endpoint of the remote OTLP collector. **Type**: `string` ### `headers` A map of headers to add to the gRPC request metadata. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` **Default**: `{}` ```yaml # Examples: headers: X-Custom-Header: value traceparent: ${! tracing_span().traceparent } ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `oauth2` Configures authentication with OAuth version 2 using the client credentials token flow. To exchange a refresh token instead, add a `grant_type` parameter with the value `refresh_token` and a `refresh_token` parameter with the token to `endpoint_params`. **Type**: `object` ### `oauth2.client_key` A value used to identify the client to the token provider. **Type**: `string` **Default**: `""` ### `oauth2.client_secret` The secret used to establish ownership of the client key. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth2.enabled` Whether to use OAuth version 2 in requests. **Type**: `bool` **Default**: `false` ### `oauth2.endpoint_params` A map of optional parameters to send to the token provider with client credentials token requests. Each value must be an array of strings. **Type**: `object` **Default**: `{}` ```yaml # Examples: endpoint_params: audience: - https://example.com resource: - https://api.example.com ``` ### `oauth2.scopes[]` A list of requested permissions (optional). **Type**: `array` **Default**: `[]` ### `oauth2.token_url` The URL of the token provider. **Type**: `string` **Default**: `""` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `timeout` Timeout for gRPC requests. **Type**: `string` **Default**: `30s` ### `tls` TLS configuration for gRPC client. **Type**: `object` ### `tls.cert_file` Path to the TLS certificate file for client authentication. **Type**: `string` **Default**: `""` ### `tls.enabled` Enable TLS connections. **Type**: `bool` **Default**: `false` ### `tls.key_file` Path to the TLS key file for client authentication. **Type**: `string` **Default**: `""` ### `tls.skip_cert_verify` Skip certificate verification (insecure). **Type**: `bool` **Default**: `false` --- # Page 142: otlp_http **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/otlp_http.md --- # otlp_http Send OpenTelemetry traces, logs, and metrics via OTLP/HTTP protocol. Sends OpenTelemetry telemetry data to a remote collector via OTLP/HTTP protocol. Accepts batches of Redpanda OTEL v1 messages (spans, log records, or metrics) and converts them to OTLP format for transmission to OpenTelemetry collectors. ## Input format This output expects messages in Redpanda OTEL v1 format (protobuf or JSON, detected automatically) with the following metadata: - `otel_signal_type`: The signal type (`trace`, `log`, or `metric`) Messages produced by the `otlp_grpc` and `otlp_http` inputs already include this metadata. Each batch must contain messages of the same signal type. The entire batch is converted to a single OTLP export request and sent via HTTP POST. ## Endpoints The output automatically appends the signal type path to the base endpoint: - Traces: `{endpoint}/v1/traces` - Logs: `{endpoint}/v1/logs` - Metrics: `{endpoint}/v1/metrics` ## Content types The `content_type` field supports two content types: - `protobuf` (default): `application/x-protobuf` - `json`: `application/json` ## Authentication This output supports the following authentication methods: - Basic authentication - OAuth v1 - OAuth v2 (requires TLS to be enabled) - JWT ### Common ```yml output: label: "" otlp_http: endpoint: "" # No default (required) max_in_flight: 64 ``` ### Advanced ```yml output: label: "" otlp_http: endpoint: "" # No default (required) content_type: protobuf headers: {} timeout: 30s proxy_url: "" follow_redirects: false disable_http2: false tls: enabled: false skip_cert_verify: false cert_file: "" key_file: "" tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s oauth: enabled: false consumer_key: "" consumer_secret: "" access_token: "" access_token_secret: "" basic_auth: enabled: false username: "" password: "" jwt: enabled: false private_key_file: "" signing_method: "" claims: {} headers: {} oauth2: enabled: false client_key: "" client_secret: "" token_url: "" scopes: [] endpoint_params: {} max_in_flight: 64 ``` ## Fields ### `basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `content_type` Content type for HTTP requests. Options: 'protobuf' or 'json'. **Type**: `string` **Default**: `protobuf` **Options**: `protobuf`, `json` ### `disable_http2` Whether or not to disable HTTP/2. **Type**: `bool` **Default**: `false` ### `endpoint` The HTTP endpoint of the remote OTLP collector (without the signal path). **Type**: `string` ### `follow_redirects` Whether to follow redirects, which are responses with 300-399 status codes, from the OTLP endpoint. When disabled, the output does not request the URL in the `Location` header, and the write fails with an unexpected status error. **Type**: `bool` **Default**: `false` ### `headers` A map of headers to add to the request. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` **Default**: `{}` ```yaml # Examples: headers: X-Custom-Header: value traceparent: ${! tracing_span().traceparent } ``` ### `jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `oauth2` Configures authentication with OAuth version 2 using the client credentials token flow. To exchange a refresh token instead, add a `grant_type` parameter with the value `refresh_token` and a `refresh_token` parameter with the token to `endpoint_params`. **Type**: `object` ### `oauth2.client_key` A value used to identify the client to the token provider. **Type**: `string` **Default**: `""` ### `oauth2.client_secret` The secret used to establish ownership of the client key. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth2.enabled` Whether to use OAuth version 2 in requests. **Type**: `bool` **Default**: `false` ### `oauth2.endpoint_params` A map of optional parameters to send to the token provider with client credentials token requests. Each value must be an array of strings. **Type**: `object` **Default**: `{}` ```yaml # Examples: endpoint_params: audience: - https://example.com resource: - https://api.example.com ``` ### `oauth2.scopes[]` A list of requested permissions (optional). **Type**: `array` **Default**: `[]` ### `oauth2.token_url` The URL of the token provider. **Type**: `string` **Default**: `""` ### `proxy_url` An optional HTTP proxy URL. **Type**: `string` **Default**: `""` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `timeout` Timeout for HTTP requests. **Type**: `string` **Default**: `30s` ### `tls` TLS configuration for HTTP client. **Type**: `object` ### `tls.cert_file` Path to the TLS certificate file for client authentication. **Type**: `string` **Default**: `""` ### `tls.enabled` Enable TLS connections. **Type**: `bool` **Default**: `false` ### `tls.key_file` Path to the TLS key file for client authentication. **Type**: `string` **Default**: `""` ### `tls.skip_cert_verify` Skip certificate verification (insecure). **Type**: `bool` **Default**: `false` --- # Page 143: pinecone **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/pinecone.md --- # pinecone Inserts items into a Pinecone index. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" pinecone: max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" host: "" # No default (required) api_key: "" # No default (required) operation: upsert-vectors id: "" # No default (required) vector_mapping: "" # No default (optional) metadata_mapping: "" # No default (optional) ``` ### Advanced ```yml output: label: "" pinecone: max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) host: "" # No default (required) api_key: "" # No default (required) operation: upsert-vectors namespace: "" id: "" # No default (required) vector_mapping: "" # No default (optional) metadata_mapping: "" # No default (optional) ``` ## Fields ### `api_key` The Pinecone API key. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `host` The host for the Pinecone index. **Type**: `string` ### `id` The ID for the index entry in Pinecone. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `metadata_mapping` An optional mapping of message to metadata in the Pinecone index entry. **Type**: `string` ```yaml # Examples: metadata_mapping: root = @ # --- metadata_mapping: root = metadata() # --- metadata_mapping: 'root = {"summary": this.summary, "foo": this.other_field}' ``` ### `namespace` The namespace to write to - writes to the default namespace by default. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `operation` The operation to perform against the Pinecone index. **Type**: `string` **Default**: `upsert-vectors` **Options**: `update-vector`, `upsert-vectors`, `delete-vectors` ### `vector_mapping` The mapping to extract out the vector from the document. The result must be a floating point array. Required if not a delete operation. **Type**: `string` ```yaml # Examples: vector_mapping: root = this.embeddings_vector # --- vector_mapping: root = [1.2, 0.5, 0.76] ``` --- # Page 144: qdrant **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/qdrant.md --- # qdrant Adds items to a [Qdrant](https://qdrant.tech/) collection. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" qdrant: max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" grpc_host: "" # No default (required) api_token: "" collection_name: "" # No default (required) id: "" # No default (required) vector_mapping: "" # No default (required) payload_mapping: root = {} ``` ### Advanced ```yml output: label: "" qdrant: max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) grpc_host: "" # No default (required) api_token: "" tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] collection_name: "" # No default (required) id: "" # No default (required) vector_mapping: "" # No default (required) payload_mapping: root = {} ``` ## Fields ### `api_token` The Qdrant API token for authentication. Defaults to an empty string. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `collection_name` The name of the collection in Qdrant. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `grpc_host` The gRPC host of the Qdrant server. **Type**: `string` ```yaml # Examples: grpc_host: localhost:6334 # --- grpc_host: xyz-example.eu-central.aws.cloud.qdrant.io:6334 ``` ### `id` The ID of the point to insert. Can be a UUID string or positive integer. **Type**: `string` ```yaml # Examples: id: root = "dc88c126-679f-49f5-ab85-04b77e8c2791" # --- id: root = 832 ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `payload_mapping` An optional mapping of message to payload associated with the point. **Type**: `string` **Default**: `root = {}` ```yaml # Examples: payload_mapping: 'root = {"field": this.value, "field_2": 987}' # --- payload_mapping: root = metadata() ``` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `vector_mapping` The mapping to extract the vector from the document. **Type**: `string` ```yaml # Examples: vector_mapping: 'root = {"dense_vector": [0.352,0.532,0.754],"sparse_vector": {"indices": [23,325,532],"values": [0.352,0.532,0.532]}, "multi_vector": [[0.352,0.532],[0.352,0.532]]}' # --- vector_mapping: root = [1.2, 0.5, 0.76] # --- vector_mapping: root = this.vector # --- vector_mapping: root = [[0.352,0.532,0.532,0.234],[0.352,0.532,0.532,0.234]] # --- vector_mapping: 'root = {"some_sparse": {"indices":[23,325,532],"values":[0.352,0.532,0.532]}}' # --- vector_mapping: 'root = {"some_multi": [[0.352,0.532,0.532,0.234],[0.352,0.532,0.532,0.234]]}' # --- vector_mapping: 'root = {"some_dense": [0.352,0.532,0.532,0.234]}' ``` --- # Page 145: questdb **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/questdb.md --- # questdb Pushes messages to a QuestDB table. Important: We recommend that the dedupe feature is enabled on the QuestDB server. For more information about deploying, configuring, and using QuestDB, see the [QuestDB documentation](https://questdb.com/docs/). ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" questdb: max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" address: "" # No default (required) username: "" # No default (optional) password: "" # No default (optional) token: "" # No default (optional) table: "" # No default (required) designated_timestamp_field: "" # No default (optional) designated_timestamp_unit: auto timestamp_string_fields: [] # No default (optional) timestamp_string_format: Jan _2 15:04:05.000000Z0700 symbols: [] # No default (optional) doubles: [] # No default (optional) error_on_empty_messages: false ``` ### Advanced ```yml output: label: "" questdb: max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] address: "" # No default (required) username: "" # No default (optional) password: "" # No default (optional) token: "" # No default (optional) retry_timeout: "" # No default (optional) request_timeout: "" # No default (optional) request_min_throughput: 0 # No default (optional) table: "" # No default (required) designated_timestamp_field: "" # No default (optional) designated_timestamp_unit: auto timestamp_string_fields: [] # No default (optional) timestamp_string_format: Jan _2 15:04:05.000000Z0700 symbols: [] # No default (optional) doubles: [] # No default (optional) error_on_empty_messages: false ``` ## Fields ### `address` The host and port of the QuestDB server’s HTTP endpoint, excluding the protocol. **Type**: `string` ```yaml # Examples: address: localhost:9000 ``` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `designated_timestamp_field` The name of the designated timestamp field in QuestDB. **Type**: `string` ### `designated_timestamp_unit` Units used for the designated timestamp field in QuestDB. **Type**: `string` **Default**: `auto` ### `doubles[]` Columns that must be the `double` type, with `int` as the default. **Type**: `array` ### `error_on_empty_messages` Mark a message as an error if it is empty after field validation. **Type**: `bool` **Default**: `false` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `password` The password to use for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `request_min_throughput` The minimum expected throughput in bytes per second for HTTP requests. If the throughput is lower than this value, the connection times out. This output uses this value to calculate an additional timeout on top of the `request_timeout`. This setting is useful for large requests. Set it to `0` to disable this logic. **Type**: `int` ### `request_timeout` The period of time to wait for a response from the QuestDB server, in addition to the timeout calculated from the `request_min_throughput` field. **Type**: `string` ### `retry_timeout` The period of time to continue retrying after a failed HTTP request. The interval between retries is an exponential backoff starting at 10 ms, and doubling after each failed attempt up to a maximum of 1 second. **Type**: `string` ### `symbols[]` Columns that must be the `symbol` type. String values default to `string` types. **Type**: `array` ### `table` The destination table in QuestDB. **Type**: `string` ```yaml # Examples: table: trades ``` ### `timestamp_string_fields[]` String fields with textual timestamps. **Type**: `array` ### `timestamp_string_format` The timestamp format used when parsing timestamp string fields, specified as a layout for Go’s `time.Parse` function. **Type**: `string` **Default**: `Jan _2 15:04:05.000000Z0700` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `token` The bearer token to use for authentication, which takes precedence over the basic authentication username and password. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `username` The username to use for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` --- # Page 146: redis_hash **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redis_hash.md --- # redis_hash Sets Redis hash objects using the HSET command. The field `key` supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries), allowing you to create a unique key for each message. The field `fields` allows you to specify an explicit map of field names to interpolated values, also evaluated per message of a batch: ```yaml output: redis_hash: url: tcp://localhost:6379 key: ${!json("id")} fields: topic: ${!meta("kafka_topic")} partition: ${!meta("kafka_partition")} content: ${!json("document.text")} ``` If the field `walk_metadata` is set to `true` then Redpanda Connect will walk all metadata fields of messages and add them to the list of hash fields to set. If the field `walk_json_object` is set to `true` then Redpanda Connect will walk each message as a JSON object, extracting keys and the string representation of their value and adds them to the list of hash fields to set. The order of hash field extraction is as follows: 1. Metadata (if enabled) 2. JSON object (if enabled) 3. Explicit fields Where latter stages will overwrite matching field names of a former stage. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. ### Common ```yml output: label: "" redis_hash: url: "" # No default (required) key: "" # No default (required) walk_metadata: false walk_json_object: false fields: {} max_in_flight: 64 ``` ### Advanced ```yml output: label: "" redis_hash: url: "" # No default (required) kind: simple master: "" client_name: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] key: "" # No default (required) walk_metadata: false walk_json_object: false fields: {} max_in_flight: 64 ``` ## Fields ### `client_name` Set the client name for the Redis connection. **Type**: `string` **Default**: `redpanda-connect` ### `fields` A map of key/value pairs to set as hash fields. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` **Default**: `{}` ### `key` The key of the hash to set fields on for each message. Use function interpolations to create a unique key per message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: key: ${! @.kafka_key } # --- key: ${! this.doc.id } # --- key: ${! counter() } ``` ### `kind` Specifies a simple, cluster-aware, or failover-aware redis client. **Type**: `string` **Default**: `simple` **Options**: `simple`, `cluster`, `failover` ### `master` Name of the redis master when `kind` is `failover` **Type**: `string` **Default**: `""` ```yaml # Examples: master: mymaster ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `tls` Custom TLS settings can be used to override system defaults. **Troubleshooting** Some cloud hosted instances of Redis (such as Azure Cache) might need some hand holding in order to establish stable connections. Unfortunately, it is often the case that TLS issues will manifest as generic error messages such as "i/o timeout". If you’re using TLS and are seeing connectivity problems consider setting `enable_renegotiation` to `true`, and ensuring that the server supports at least TLS version 1.2. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL of the target Redis server. Database is optional and is supplied as the URL path. **Type**: `string` ```yaml # Examples: url: redis://:6379 # --- url: redis://localhost:6379 # --- url: redis://foousername:foopassword@redisplace:6379 # --- url: redis://:foopassword@redisplace:6379 # --- url: redis://localhost:6379/1 # --- url: redis://localhost:6379/1,redis://localhost:6380/1 ``` ### `walk_json_object` Whether to walk each message as a JSON object and add each key/value pair to the list of hash fields to set. **Type**: `bool` **Default**: `false` ### `walk_metadata` Whether all metadata fields of messages should be walked and added to the list of hash fields to set. **Type**: `bool` **Default**: `false` --- # Page 147: redis_list **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redis_list.md --- # redis_list Pushes messages onto the end of a Redis list (which is created if it doesn’t already exist) using the RPUSH command. The field `key` supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries), allowing you to create a unique key for each message. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" redis_list: url: "" # No default (required) key: "" # No default (required) max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" redis_list: url: "" # No default (required) kind: simple master: "" client_name: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] key: "" # No default (required) max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) command: rpush ``` ## Fields ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `client_name` Set the client name for the Redis connection. **Type**: `string` **Default**: `redpanda-connect` ### `command` The command used to push elements to the Redis list **Type**: `string` **Default**: `rpush` **Options**: `rpush`, `lpush` ### `key` The key of the list to push each message to. Function interpolations can be used to create a different key per message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: key: some_list # --- key: ${! @.kafka_key } # --- key: ${! this.doc.id } # --- key: ${! counter() } ``` ### `kind` Specifies a simple, cluster-aware, or failover-aware redis client. **Type**: `string` **Default**: `simple` **Options**: `simple`, `cluster`, `failover` ### `master` Name of the redis master when `kind` is `failover` **Type**: `string` **Default**: `""` ```yaml # Examples: master: mymaster ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `tls` Custom TLS settings can be used to override system defaults. **Troubleshooting** Some cloud hosted instances of Redis (such as Azure Cache) might need some hand holding in order to establish stable connections. Unfortunately, it is often the case that TLS issues will manifest as generic error messages such as "i/o timeout". If you’re using TLS and are seeing connectivity problems consider setting `enable_renegotiation` to `true`, and ensuring that the server supports at least TLS version 1.2. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL of the target Redis server. Database is optional and is supplied as the URL path. **Type**: `string` ```yaml # Examples: url: redis://:6379 # --- url: redis://localhost:6379 # --- url: redis://foousername:foopassword@redisplace:6379 # --- url: redis://:foopassword@redisplace:6379 # --- url: redis://localhost:6379/1 # --- url: redis://localhost:6379/1,redis://localhost:6380/1 ``` --- # Page 148: redis_pubsub **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redis_pubsub.md --- # redis_pubsub Publishes messages through the Redis PubSub model. It is not possible to guarantee that messages have been received. This output will interpolate functions within the channel field, you can find a list of functions [here](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" redis_pubsub: url: "" # No default (required) channel: "" # No default (required) max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" redis_pubsub: url: "" # No default (required) kind: simple master: "" client_name: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] channel: "" # No default (required) max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `channel` The channel to publish messages to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `client_name` Set the client name for the Redis connection. **Type**: `string` **Default**: `redpanda-connect` ### `kind` Specifies a simple, cluster-aware, or failover-aware redis client. **Type**: `string` **Default**: `simple` **Options**: `simple`, `cluster`, `failover` ### `master` Name of the redis master when `kind` is `failover` **Type**: `string` **Default**: `""` ```yaml # Examples: master: mymaster ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `tls` Custom TLS settings can be used to override system defaults. **Troubleshooting** Some cloud hosted instances of Redis (such as Azure Cache) might need some hand holding in order to establish stable connections. Unfortunately, it is often the case that TLS issues will manifest as generic error messages such as "i/o timeout". If you’re using TLS and are seeing connectivity problems consider setting `enable_renegotiation` to `true`, and ensuring that the server supports at least TLS version 1.2. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL of the target Redis server. Database is optional and is supplied as the URL path. **Type**: `string` ```yaml # Examples: url: redis://:6379 # --- url: redis://localhost:6379 # --- url: redis://foousername:foopassword@redisplace:6379 # --- url: redis://:foopassword@redisplace:6379 # --- url: redis://localhost:6379/1 # --- url: redis://localhost:6379/1,redis://localhost:6380/1 ``` --- # Page 149: redis_streams **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redis_streams.md --- # redis_streams Pushes messages to a Redis (v5.0+) Stream (which is created if it doesn’t already exist) using the XADD command. It’s possible to specify a maximum length of the target stream by setting it to a value greater than 0, in which case this cap is applied only when Redis is able to remove a whole macro node, for efficiency. Redis stream entries are key/value pairs, as such it is necessary to specify the key to be set to the body of the message. All metadata fields of the message will also be set as key/value pairs, if there is a key collision between a metadata item and the body then the body takes precedence. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" redis_streams: url: "" # No default (required) stream: "" # No default (required) id: "*" body_key: body max_length: 0 max_in_flight: 64 metadata: exclude_prefixes: [] batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" redis_streams: url: "" # No default (required) kind: simple master: "" client_name: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] stream: "" # No default (required) id: "*" body_key: body max_length: 0 max_in_flight: 64 metadata: exclude_prefixes: [] batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `body_key` A key to set the raw body of the message to. **Type**: `string` **Default**: `body` ### `client_name` Set the client name for the Redis connection. **Type**: `string` **Default**: `redpanda-connect` ### `id` The entry ID for the stream message. Allows function interpolations. When set to `*` (the default), Redis auto-generates a unique ID based on the current time. Set a custom ID to control message ordering, for example to replay messages in upstream order. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `*` ```yaml # Examples: id: "*" # --- id: ${! @redis_stream } # --- id: ${! this.id } # --- id: ${! counter() }-0 ``` ### `kind` Specifies a simple, cluster-aware, or failover-aware redis client. **Type**: `string` **Default**: `simple` **Options**: `simple`, `cluster`, `failover` ### `master` Name of the redis master when `kind` is `failover` **Type**: `string` **Default**: `""` ```yaml # Examples: master: mymaster ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `max_length` When greater than zero enforces a rough cap on the length of the target stream. **Type**: `int` **Default**: `0` ### `metadata` Specify criteria for which metadata values are included in the message body. **Type**: `object` ### `metadata.exclude_prefixes[]` Provide a list of explicit metadata key prefixes to exclude when adding metadata to sent messages. **Type**: `array` **Default**: `[]` ### `stream` The stream to add messages to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `tls` Custom TLS settings can be used to override system defaults. **Troubleshooting** Some cloud hosted instances of Redis (such as Azure Cache) might need some hand holding in order to establish stable connections. Unfortunately, it is often the case that TLS issues will manifest as generic error messages such as "i/o timeout". If you’re using TLS and are seeing connectivity problems consider setting `enable_renegotiation` to `true`, and ensuring that the server supports at least TLS version 1.2. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL of the target Redis server. Database is optional and is supplied as the URL path. **Type**: `string` ```yaml # Examples: url: redis://:6379 # --- url: redis://localhost:6379 # --- url: redis://foousername:foopassword@redisplace:6379 # --- url: redis://:foopassword@redisplace:6379 # --- url: redis://localhost:6379/1 # --- url: redis://localhost:6379/1,redis://localhost:6380/1 ``` --- # Page 150: redpanda_common **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda_common.md --- # redpanda_common > ⚠️ **WARNING** > > This component is deprecated and will be removed in a future version. Sends data to a Redpanda (Kafka) broker, using credentials defined in a common top-level `redpanda` config block. This output is deprecated as of version 4.68.0. Use the [`redpanda` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda/) instead. When you omit its `seed_brokers` field, the `redpanda` output takes its connection configuration from the top-level `redpanda` block, as this output does. To avoid duplicating Redpanda cluster credentials in your `redpanda_common` input, output, or any other components in your data pipeline, you can use a single [`redpanda` configuration block](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/redpanda/about/). For more details, see the [Pipeline example](#pipeline-example). #### Common ```yml output: label: "" redpanda_common: topic: "" # No default (required) key: "" # No default (optional) partition: "" # No default (optional) metadata: include_prefixes: [] include_patterns: [] max_in_flight: 10 batching: count: 0 byte_size: 0 period: "" check: "" ``` #### Advanced ```yml output: label: "" redpanda_common: topic: "" # No default (required) key: "" # No default (optional) partition: "" # No default (optional) metadata: include_prefixes: [] include_patterns: [] timestamp_ms: "" # No default (optional) tombstone: "" # No default (optional) max_in_flight: 10 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Pipeline example This data pipeline reads data from `topic_A` and `topic_B` on a Redpanda cluster, and then writes the data to `topic_C` on the same cluster. The cluster details are configured within the `redpanda` configuration block, so you only need to configure them once. This is a useful feature when you have multiple inputs and outputs in the same data pipeline that need to connect to the same cluster. ```none input: redpanda_common: topics: [ topic_A, topic_B ] output: redpanda_common: topic: topic_C key: ${! @id } redpanda: seed_brokers: [ "127.0.0.1:9092" ] tls: enabled: true sasl: - mechanism: SCRAM-SHA-512 password: bar username: foo ``` ## Fields ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `key` An optional key to populate for each message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `10` ### `metadata` Determines which metadata values are added to messages as headers. **Type**: `object` ### `metadata.include_patterns[]` A list of explicit metadata key regular expression (re2) patterns to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_patterns: - .* # --- include_patterns: - _timestamp_unix$ ``` ### `metadata.include_prefixes[]` A list of explicit metadata key prefixes to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_prefixes: - foo_ - bar_ # --- include_prefixes: - kafka_ # --- include_prefixes: - content- ``` ### `partition` An optional explicit partition to set for each message. This field is only relevant when the `partitioner` is set to `manual`. The provided interpolation string must be a valid integer. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: partition: ${! meta("partition") } ``` ### `timestamp_ms` An optional timestamp to set for each message, in milliseconds since the Unix epoch. When left empty, the current timestamp is used. You cannot set both `timestamp` and `timestamp_ms`. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: timestamp_ms: ${! timestamp_unix_milli() } # --- timestamp_ms: ${! metadata("kafka_timestamp_ms") } ``` ### `tombstone` An optional boolean that, when it resolves to `true` for a message, writes that message as a tombstone: a record with a null value. The message payload is ignored for tombstones. Use this to delete keys on compacted topics, or to keep tombstones intact when mirroring a topic. An empty payload is not a tombstone. The interpolation must resolve to a value that can be parsed as a boolean, otherwise the write fails. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: tombstone: ${! @kafka_tombstone_message } # --- tombstone: ${! @operation == "delete" } ``` ### `topic` A topic to write messages to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` --- # Page 151: redpanda_migrator **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda_migrator.md --- # redpanda_migrator Migrates topics, schemas, and consumer groups between Kafka and Redpanda clusters. > ❗ **IMPORTANT** > > Pair this output with a [`redpanda_migrator` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda_migrator/) in the same pipeline. The following shows all available configuration fields and their defaults. #### Common ```yml output: label: "" redpanda_migrator: seed_brokers: [] # No default (required) schema_registry: url: "" # No default (required) timeout: 5s enabled: true interval: 5m include: [] # No default (optional) exclude: [] # No default (optional) subject: "" # No default (optional) versions: all include_deleted: false translate_ids: false normalize: false strict: false max_parallel_http_requests: 10 consumer_groups: enabled: true interval: 1m fetch_timeout: 10s include: [] # No default (optional) exclude: [] # No default (optional) only_empty: false topic: ${! @kafka_topic } topic_replication_factor: 0 # No default (optional) sync_topic_acls: false headers: {} # No default (optional) max_in_flight: 10 ``` #### Advanced ```yml output: label: "" redpanda_migrator: seed_brokers: [] # No default (required) client_id: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] sasl: [] # No default (optional) metadata_max_age: 1m request_timeout_overhead: 10s conn_idle_timeout: 20s tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s partitioner: "" # No default (optional) idempotent_write: true acks: all compression: snappy allow_auto_topic_creation: true timeout: 10s max_message_bytes: 1MiB broker_write_max_bytes: 100MiB max_buffered_records: 10000 max_buffered_bytes: "0" max_in_flight_requests: 1 record_retries: 0 record_delivery_timeout: 0s schema_registry: url: "" # No default (required) timeout: 5s tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] oauth: enabled: false consumer_key: "" consumer_secret: "" access_token: "" access_token_secret: "" basic_auth: enabled: false username: "" password: "" jwt: enabled: false private_key_file: "" signing_method: "" claims: {} headers: {} enabled: true interval: 5m include: [] # No default (optional) exclude: [] # No default (optional) subject: "" # No default (optional) versions: all include_deleted: false translate_ids: false normalize: false strict: false max_parallel_http_requests: 10 consumer_groups: enabled: true interval: 1m fetch_timeout: 10s include: [] # No default (optional) exclude: [] # No default (optional) only_empty: false topic: ${! @kafka_topic } topic_replication_factor: 0 # No default (optional) sync_topic_interval: 5m sync_topic_acls: false serverless: false headers: {} # No default (optional) provenance_header: redpanda-migrator-provenance offset_header: redpanda-migrator-offset max_in_flight: 10 ``` ## Requirements When the destination cluster enforces ACLs, the destination principal needs permission to create topics and add partitions, not only to produce records. Grant these ACLs at minimum: - Topic `CREATE`, `WRITE`, `ALTER`, and `DESCRIBE_CONFIGS`. Cluster `CREATE` also authorizes topic creation. - When consumer group migration is enabled, consumer group `READ`. - When `sync_topic_acls` is enabled, cluster `ALTER`. For the source-principal ACLs and full details, see [Required permissions](https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/redpanda_migrator/#required-permissions). ## Multiple migrator pairs Each migrator pair requires a unique `label`. Set the same label value on both the input and output within a pair. Labels must match exactly; mismatched labels prevent the input and output from coordinating. ## Performance tuning For high-throughput workloads, adjust the following settings: On this output: - `max_in_flight`: Set to the total number of partitions being migrated. Higher values provide no benefit beyond the partition count. On the paired [`redpanda_migrator` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda_migrator/#performance-tuning-for-high-throughput): - `partition_buffer_bytes`: Set to `2MB` to increase the per-partition buffer. - `max_yield_batch_bytes`: Set to `1MB` to yield larger batches. ## Synchronization details ### Topics - Topic names carry over from the source by default. Use the `topic` field with interpolation to rename topics at the destination. - The migrator creates each topic at the destination with the same partition count as the source. - Replication factor defaults to the source value. Set `topic_replication_factor` to override it. - The migrator copies a serverless-aware subset of topic configuration keys. - ACL replication is optional (`sync_topic_acls`): - The migrator does not copy `ALLOW WRITE` ACL entries. - The migrator downgrades `ALLOW ALL` ACL entries to `ALLOW READ`. - Resource pattern type and host filters carry over. ### Schema Registry - Syncs once at startup, then periodically based on `schema_registry.interval` (default: every 5 minutes). Set `schema_registry.interval: 0s` for a one-time sync only. - Use include and exclude regex patterns to filter which subjects are migrated. - Use the `subject` field with interpolation to rename subjects at the destination. - Schema versions: `latest` (most recent version only) or `all` (full history). Defaults to `all`. - Include soft-deleted subjects with `schema_registry.include_deleted`. - The migrator can translate schema IDs to new destination IDs or preserve them as-is. See `schema_registry.translate_ids`. - Schema normalization is optional (`schema_registry.normalize`). - Compatibility settings carry over per-subject. Schema metadata and rules do not carry over in Serverless mode. ### Consumer groups - Sync periodically based on `consumer_groups.interval` (default: every 1 minute). - Use include and exclude regex patterns to filter which groups are migrated. - By default, all groups except those in `Dead` state migrate. Set `consumer_groups.only_empty: true` to migrate only `Empty` state groups. - The migrator translates consumer offsets using timestamps. This is approximate and may be imprecise when multiple records share the same timestamp. - Offsets only move forward and never rewind at the destination. - Source and destination must have matching partition counts for each migrated group. ## How it works Each migration component synchronizes on a different schedule: - **Topics**: Sync from source on startup and every 5 minutes by default, including source topics that have no current data (for example, after retention cleanup). Configure the sync interval with [`sync_topic_interval`](#sync_topic_interval), or set it to `0s` to disable periodic sync. When periodic sync is disabled, topics are still created on demand when the first message arrives. - **Schema Registry**: Syncs at startup, then periodically as configured. - **Consumer groups**: Sync in the background, filtered to the topics being migrated. ## Guarantees The migrator upholds the following guarantees: - Creates each destination topic with the intended partition count and replication factor. - Never overwrites existing destination topics and logs any partition count mismatches. - Consumer group offsets never rewind. - ACL replication never grants write access at the destination. ## Limitations - The destination cluster’s Schema Registry must be in `READWRITE` or `IMPORT` mode. - Offset translation is best-effort. - Consumer group migration requires identical partition counts at source and destination. ## Metrics | Metric Name | Type | Labels | Description | | --- | --- | --- | --- | | **Topic migration** | | | | | `redpanda_migrator_topics_created_total` | counter | | Total topics created on destination | | `redpanda_migrator_topic_create_errors_total` | counter | | Topic creation errors | | `redpanda_migrator_topic_create_latency_ns` | timer | | Topic creation latency (ns) | | **Schema Registry migration** | | | | | `redpanda_migrator_sr_schemas_created_total` | counter | | Schemas created in destination registry | | `redpanda_migrator_sr_schema_create_errors_total` | counter | | Schema creation errors | | `redpanda_migrator_sr_schema_create_latency_ns` | timer | | Schema creation latency (ns) | | `redpanda_migrator_sr_compatibility_updates_total` | counter | | Compatibility level updates applied | | `redpanda_migrator_sr_compatibility_update_errors_total` | counter | | Compatibility update errors | | `redpanda_migrator_sr_compatibility_update_latency_ns` | timer | | Compatibility update latency (ns) | | **Consumer group migration** | | | | | `redpanda_migrator_cg_offsets_translated_total` | counter | group | Offsets translated per consumer group | | `redpanda_migrator_cg_offset_translation_errors_total` | counter | group | Offset translation errors per group | | `redpanda_migrator_cg_offset_translation_latency_ns` | timer | group | Offset translation latency per group (ns) | | `redpanda_migrator_cg_offsets_committed_total` | counter | group | Offsets committed per consumer group | | `redpanda_migrator_cg_offset_commit_errors_total` | counter | group | Offset commit errors per group | | `redpanda_migrator_cg_offset_commit_latency_ns` | timer | group | Offset commit latency per group (ns) | | **Consumer lag** | | | | | `redpanda_lag` | gauge | topic, partition | Current consumer lag in messages for each topic partition. Shows difference between high water mark and current consumer position. | ## Examples ### Basic migration Migrate topics, schemas and consumer groups from source to destination. ```yaml input: redpanda_migrator: seed_brokers: ["source:9092"] topics: ["orders", "payments"] consumer_group: "migration" output: redpanda_migrator: seed_brokers: ["destination:9092"] # Write to the same topic name topic: ${! metadata("kafka_topic") } schema_registry: url: "http://dest-registry:8081" translate_ids: true consumer_groups: interval: 1m ``` ### Migration to Redpanda Serverless Migrate from Confluent/Kafka to Redpanda Cloud serverless cluster with authentication. ```yaml input: redpanda_migrator: seed_brokers: ["source-kafka:9092"] regexp_topics_include: - '.' regexp_topics_exclude: - '^_' consumer_group: "migrator_cg" schema_registry: url: "http://source-registry:8081" output: redpanda_migrator: seed_brokers: ["serverless-cluster.redpanda.com:9092"] tls: enabled: true sasl: - mechanism: SCRAM-SHA-256 username: "migrator" password: "migrator" schema_registry: url: "https://serverless-cluster.redpanda.com:8081" basic_auth: enabled: true username: "migrator" password: "migrator" translate_ids: true consumer_groups: exclude: - "migrator_cg" # Exclude the migration consumer group itself serverless: true # Enable serverless mode for restricted configurations ``` ## Fields ### `acks` The number of acknowledgements the leader broker must receive from ISR brokers before responding to the produce request. When `idempotent_write` is enabled this must be set to `all`. **Type**: `string` **Default**: `all` | Option | Summary | | --- | --- | | `all` | Wait for all in-sync replicas to acknowledge (acks=-1). Required when idempotent_write is enabled. | | `leader` | Wait for the leader broker to acknowledge (acks=1). Messages are lost if the leader fails before replication. | | `none` | Do not wait for any acknowledgement (acks=0). Highest throughput but messages may be lost. | ### `allow_auto_topic_creation` Enables topics to be auto created if they do not exist when fetching their metadata. If set to `false`, the topic must already exist. **Type**: `bool` **Default**: `true` ### `broker_write_max_bytes` The maximum number of bytes this output can write to a broker connection in a single write. This field corresponds to Kafka’s `socket.request.max.bytes`. **Type**: `string` **Default**: `100MiB` ```yaml # Examples: broker_write_max_bytes: 128MB # --- broker_write_max_bytes: 50mib ``` ### `client_id` An identifier for the client connection. This identifier appears in broker logs and metrics, which helps you identify the Redpanda Connect instance that is connecting. **Type**: `string` **Default**: `redpanda-connect` ### `compression` The compression codec for produced record batches. A batch that compression does not make smaller is sent uncompressed, whichever codec you choose. **Type**: `string` **Default**: `snappy` **Options**: `lz4`, `snappy`, `gzip`, `none`, `zstd` ### `conn_idle_timeout` The approximate amount of time that connections can remain idle before they are closed. In the worst case, a connection can stay idle for up to twice this value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `20s` ### `consumer_groups` **Type**: `object` ### `consumer_groups.enabled` Whether consumer group offset migration is enabled. When disabled, no consumer group operations are performed. **Type**: `bool` **Default**: `true` ### `consumer_groups.exclude[]` Regular expressions for consumer groups to exclude from offset migration. Takes precedence over include patterns. Useful for excluding system or temporary groups. **Type**: `array` ```yaml # Examples: exclude: - .*-test - .*-temp - connect-.* # --- exclude: - dev-.* - local-.* ``` ### `consumer_groups.fetch_timeout` Maximum time to wait for data when fetching records for timestamp-based offset translation. Increase for clusters with low message throughput. **Type**: `string` **Default**: `10s` ```yaml # Examples: fetch_timeout: "1s # Fast clusters" # --- fetch_timeout: "10s # Slower clusters" ``` ### `consumer_groups.include[]` Regular expressions for consumer groups to include in offset migration. If empty, all groups are included (unless excluded). **Type**: `array` ```yaml # Examples: include: - prod-.* - staging-.* # --- include: - app-.* - service-.* ``` ### `consumer_groups.interval` How often to synchronise consumer group offsets. Regular syncing helps maintain offset accuracy during ongoing migration. **Type**: `string` **Default**: `1m` ```yaml # Examples: interval: "0s # Disabled" # --- interval: "30s # Sync every 30 seconds" # --- interval: "5m # Sync every 5 minutes" ``` ### `consumer_groups.only_empty` Whether to only migrate Empty consumer groups. When false (default), all statuses except Dead are included; when true, only Empty groups are migrated. **Type**: `bool` **Default**: `false` ### `headers` Custom headers to add to migrated records, keyed by header name with interpolated string values. Useful for injecting metadata such as processing timestamps or latency measurements that should surface as header values on the destination cluster. A custom header name that collides with `provenance_header` or `offset_header` is ignored, so those migration-critical headers are always protected. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` ```yaml # Examples: headers: x-migration-latency-ms: ${! timestamp_unix_milli() - meta("kafka_timestamp_ms") } x-migration-processed-at: ${! timestamp_unix_milli() } ``` ### `idempotent_write` Enable the idempotent write producer option. When enabled, the producer initializes a producer ID and uses it to guarantee exactly-once semantics per partition, so retries do not produce duplicates. This option requires the `IDEMPOTENT_WRITE` permission on the `CLUSTER` resource. Disable this option if the `IDEMPOTENT_WRITE` permission is unavailable, for example in some managed Kafka services or Redpanda clusters with strict ACLs. Disabling this option only affects retry behavior: duplicates may occur on producer retries, but the pipeline continues to function normally. **Type**: `bool` **Default**: `true` ### `max_buffered_bytes` The maximum number of bytes the client will buffer in memory before blocking. When this limit is reached, `Produce()` calls will block until buffered records are delivered. Set to `0` to disable the byte-level limit (only `max_buffered_records` applies). This limit is checked after `max_buffered_records`. **Type**: `string` **Default**: `0` ```yaml # Examples: max_buffered_bytes: 256MB # --- max_buffered_bytes: 50mib ``` ### `max_buffered_records` The maximum number of records the client will buffer in memory before blocking. When this limit is reached, `Produce()` calls will block until buffered records are delivered and space frees up. Increase this value for high-throughput pipelines to avoid back-pressure stalls. **Type**: `int` **Default**: `10000` ### `max_in_flight` The maximum number of batches to send in parallel at any given time. Increase this value to improve throughput during migration. For optimal performance, set this to the total number of partitions being migrated in parallel (up to all partitions in the cluster). Setting it higher than the number of consumed partitions provides no additional benefit. For example, if you are migrating 100 partitions, set `max_in_flight: 100` for maximum throughput. **Type**: `int` **Default**: `10` ```yaml # Examples: max_in_flight: "64 # For a cluster with 64 partitions" # --- max_in_flight: "128 # For multiple topics with combined 128 partitions" ``` ### `max_in_flight_requests` The maximum number of produce requests in flight per broker connection. While `idempotent_write` is enabled (the default) this must be `1`, as the client relies on a single in-flight request per broker to guarantee ordering. To use higher values you must set `idempotent_write` to `false`, which allows requests to be pipelined for throughput but may cause duplicate and out-of-order delivery on retries. Note that this is distinct from the output’s `max_in_flight` field, which counts message batches being written in parallel rather than produce requests on the wire. A value of `1` is not a throughput ceiling: records from concurrent writes are coalesced into fewer, larger produce requests. **Type**: `int` **Default**: `1` ### `max_message_bytes` The maximum size of a produced record batch in bytes. A `MESSAGE_TOO_LARGE` error is returned if a batch exceeds this limit. This field maps to the `max.message.bytes` Kafka property. Ensure the Redpanda broker’s [`kafka_batch_max_bytes`](https://docs.redpanda.com/streaming/current/reference/properties/cluster-properties/#kafka_batch_max_bytes) property is at least as large as this value. **Type**: `string` **Default**: `1MiB` ```yaml # Examples: max_message_bytes: 100MB # --- max_message_bytes: 50mib ``` ### `metadata_max_age` The maximum period of time after which metadata is refreshed. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Lower values provide more responsive topic and partition discovery but may increase broker load. Higher values reduce broker queries but can delay detection of topology changes. This interval also controls how frequently regex topic patterns are re-evaluated to discover new matching topics. **Type**: `string` **Default**: `1m` ### `offset_header` The name of a message header to add to migrated records. This header contains the source offset, enabling exact consumer group offset translation during migration. If this field is empty, no offset header is added and exact offset translation is disabled. Consumer groups are still migrated using timestamp-based positioning, which works well for most cases but may be imprecise for consumer groups in the `Empty` state when multiple records share the same timestamp (timestamps have millisecond resolution). Exact offset translation only applies to consumer groups in the `Empty` state, which have no active members. Other groups always use timestamp-based positioning. The default value enables exact offset translation. This header is only added when consumer group migration is enabled. **Type**: `string` **Default**: `redpanda-migrator-offset` ### `partitioner` Override the default murmur2 hashing partitioner. **Type**: `string` | Option | Summary | | --- | --- | | `least_backup` | Chooses the least backed up partition (the partition with the fewest amount of buffered records). Partitions are selected per batch. | | `manual` | Manually select a partition for each message, requires the field `partition` to be specified. | | `murmur2_hash` | Kafka’s default hash algorithm that uses a 32-bit murmur2 hash of the key to compute which partition the record will be on. | | `round_robin` | Round-robin’s messages through all available partitions. This algorithm has lower throughput and causes higher CPU load on brokers, but can be useful if you want to ensure an even distribution of records to partitions. | ### `provenance_header` Header name to add to migrated records indicating their source cluster. When set, each migrated record that does not already carry this header receives it, with the source cluster’s ID (from the cluster metadata) as the value. Downstream systems can use the header to track record origins. A record that already carries the header keeps its existing value. A record whose header value is the destination cluster’s ID is skipped, so it is not sent back to the cluster it came from. A record whose header value is empty or equal to the source cluster’s ID causes an error. If empty, no provenance header is added and no provenance checks run. **Type**: `string` **Default**: `redpanda-migrator-provenance` ### `record_delivery_timeout` The maximum time a record can sit in the producer buffer before it is failed, roughly equivalent to Kafka’s `delivery.timeout.ms`. This is evaluated before writing a request or after a produce response. When a record times out, all records in the same partition are also failed. Set to `0s` for no timeout (the default). With `idempotent_write` enabled, timeouts are only enforced when safe to do so without creating invalid sequence numbers. **Type**: `string` **Default**: `0s` ### `record_retries` The maximum number of times a record produce is retried on failure before the record is failed. When a record fails, all records buffered in the same partition are also failed to preserve gapless ordering. Set to `0` for unlimited retries (the default). With `idempotent_write` enabled, retries are only enforced when safe to do so without creating invalid sequence numbers. **Type**: `int` **Default**: `0` ### `request_timeout_overhead` Additional time to apply as overhead when calculating request deadlines. For most requests, the deadline is this overhead alone. For requests that define their own timeout field, the overhead is added on top of that timeout, which helps prevent premature timeouts. This field is roughly equivalent to Apache Kafka’s `request.timeout.ms` parameter, but grants extra time to requests that have timeout fields. **Type**: `string` **Default**: `10s` ### `sasl[]` Specify one or more methods or mechanisms of SASL authentication. They are tried in order. If the broker supports the first SASL mechanism, all connections use it. If the first mechanism fails, the client picks the first supported mechanism. If the broker does not support any client mechanisms, all connections fail. **Type**: `array` ```yaml # Examples: sasl: - mechanism: SCRAM-SHA-512 password: bar username: foo ``` ### `sasl[].aws` Contains AWS-specific fields for when `sasl.mechanism` is set to `AWS_MSK_IAM`. **Type**: `object` ### `sasl[].aws.credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `sasl[].aws.credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `sasl[].aws.credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `sasl[].aws.credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `sasl[].aws.credentials.role` The ARN of the role to assume. **Type**: `string` ### `sasl[].aws.credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `sasl[].aws.credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `sasl[].aws.credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `sasl[].aws.endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `sasl[].aws.region` The AWS region in which your resources are hosted. **Type**: `string` ### `sasl[].aws.tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `sasl[].aws.tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].aws.tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `sasl[].aws.tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `sasl[].aws.tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].extensions` Key/value pairs to add to OAUTHBEARER authentication requests. **Type**: `object` ### `sasl[].mechanism` The SASL mechanism to use for authentication. **Type**: `string` | Option | Summary | | --- | --- | | `AWS_MSK_IAM` | AWS IAM based authentication as specified by the 'aws-msk-iam-auth' java library. | | `OAUTHBEARER` | OAuth Bearer based authentication. | | `PLAIN` | Plain text authentication. | | `REDPANDA_CLOUD_SERVICE_ACCOUNT` | Redpanda Cloud Service Account authentication when running in Redpanda Cloud. | | `SCRAM-SHA-256` | SCRAM based authentication as specified in RFC5802. | | `SCRAM-SHA-512` | SCRAM based authentication as specified in RFC5802. | | `none` | Disable sasl authentication | ### `sasl[].password` The password to use for PLAIN or SCRAM-* authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `sasl[].token` The token to use for a single session’s OAUTHBEARER authentication. **Type**: `string` **Default**: `""` ### `sasl[].username` The username to use for PLAIN or SCRAM-* authentication. **Type**: `string` **Default**: `""` ### `schema_registry` Configuration for schema registry integration. Enables migration of schema subjects, versions, and compatibility settings between clusters. **Type**: `object` ### `schema_registry.basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `schema_registry.basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `schema_registry.enabled` Whether schema registry migration is enabled. When disabled, no schema operations are performed. **Type**: `bool` **Default**: `true` ### `schema_registry.exclude[]` Regular expressions for schema subjects to exclude from migration. Takes precedence over include patterns. Note: the migrator consumer group is always ignored. **Type**: `array` ```yaml # Examples: exclude: - .*-test - .*-temp # --- exclude: - dev-.* - local-.* ``` ### `schema_registry.include[]` Regular expressions for schema subjects to include in migration. If empty, all subjects are included (unless excluded). Note: the migrator consumer group is always ignored. **Type**: `array` ```yaml # Examples: include: - prod-.* - staging-.* # --- include: - user-.* - order-.* ``` ### `schema_registry.include_deleted` Whether to include soft-deleted schemas in migration. Useful for complete migration but may not be supported by all schema registries. **Type**: `bool` **Default**: `false` ### `schema_registry.interval` How often to synchronise schema registry subjects. Subjects that fail to sync are logged and retried on the next sync. Set to 0s for one-time sync at startup only, in which case only the subjects that failed are retried, with backoff, until they sync. With translate_ids enabled, a record encoded with a schema that failed to sync blocks the output until the schema is synced. **Type**: `string` **Default**: `5m` ```yaml # Examples: interval: "0s # One-time sync only" # --- interval: "5m # Sync every 5 minutes" # --- interval: "30m # Sync every 30 minutes" ``` ### `schema_registry.jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `schema_registry.jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `schema_registry.jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `schema_registry.jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `schema_registry.jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `schema_registry.max_parallel_http_requests` Maximum number of parallel HTTP requests to the schema registry. Controls concurrency when syncing multiple schemas. **Type**: `int` **Default**: `10` ### `schema_registry.normalize` Whether to normalize schemas when creating them in the destination registry. **Type**: `bool` **Default**: `false` ### `schema_registry.oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `schema_registry.oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `schema_registry.strict` Error on unknown schema IDs. Only relevant when translate_ids is true. When false (default), unknown schema IDs are passed through unchanged, allowing migration of topics with mixed message formats. IDs of schemas that failed to sync to the destination are always rejected, regardless of this setting, and the write is retried until a later sync registers the schema, or the source no longer has it. Since the output writes in order, this blocks the output until then. Note: messages with 0-byte prefixes (for example, protobuf) cannot be distinguished from schema registry headers and may fail when strict is enabled. **Type**: `bool` **Default**: `false` ### `schema_registry.subject` Template for transforming subject names during migration. Use interpolation to rename subjects systematically. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: subject: prod_${! metadata("schema_registry_subject") } # --- subject: ${! metadata("schema_registry_subject") | replace("dev_", "prod_") } ``` ### `schema_registry.timeout` HTTP client timeout for schema registry requests. **Type**: `string` **Default**: `5s` ### `schema_registry.tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `schema_registry.tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `schema_registry.tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `schema_registry.tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `schema_registry.tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `schema_registry.tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `schema_registry.tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `schema_registry.tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `schema_registry.translate_ids` Whether to translate schema IDs during migration. **Type**: `bool` **Default**: `false` ### `schema_registry.url` The base URL of the schema registry service. Required for schema migration functionality. **Type**: `string` ```yaml # Examples: url: http://localhost:8081 # --- url: https://schema-registry.example.com:8081 ``` ### `schema_registry.versions` Which schema versions to migrate. 'latest' migrates only the current version, 'all' migrates complete version history for better compatibility. **Type**: `string` **Default**: `all` **Options**: `latest`, `all` ### `seed_brokers[]` A list of broker addresses used to establish connections. If an item of the list contains commas, it is expanded into multiple addresses. **Type**: `array` ```yaml # Examples: seed_brokers: - "localhost:9092" # --- seed_brokers: - "foo:9092" - "bar:9092" # --- seed_brokers: - "foo:9092,bar:9092" ``` ### `serverless` Enable serverless mode for Redpanda Cloud serverless clusters. This restricts topic configurations and schema features to those supported by serverless environments. **Type**: `bool` **Default**: `false` ### `sync_topic_acls` Whether to synchronise topic ACLs from source to destination cluster. ACLs are transformed safely: ALLOW WRITE permissions are excluded, and ALLOW ALL is downgraded to ALLOW READ to prevent conflicts. **Type**: `bool` **Default**: `false` ### `sync_topic_interval` How often to synchronize topics from the source cluster to the destination. This creates destination topics for any new source topics, including empty topics with no message flow. Set to 0s to disable periodic sync (topics are still created on first message). **Type**: `string` **Default**: `5m` ```yaml # Examples: sync_topic_interval: "0s # Disable periodic sync" # --- sync_topic_interval: "1m # Sync every minute" # --- sync_topic_interval: "5m # Sync every 5 minutes" ``` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `timeout` The maximum period of time to wait for message sends before abandoning the request and retrying. **Type**: `string` **Default**: `10s` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `topic` The topic to write messages to. To derive destination topic names from source topics, use interpolation. The source topic name is available in the `kafka_topic` metadata field. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `${! @kafka_topic }` ```yaml # Examples: topic: prod_${! @kafka_topic } ``` ### `topic_replication_factor` The replication factor for created topics. If not specified, inherits the replication factor from source topics. Useful when migrating to clusters with different sizes. **Type**: `int` ```yaml # Examples: topic_replication_factor: "3" # --- topic_replication_factor: "1 # For single-node clusters" ``` --- # Page 152: redpanda **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda.md --- # redpanda A Kafka output using the [Franz Kafka client library](https://github.com/twmb/franz-go). Writes a batch of messages to Kafka brokers and waits for acknowledgement before propagating it back to the input. > ❗ **IMPORTANT** > > Always set `seed_brokers` to the `${REDPANDA_BROKERS}` [contextual variable](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/contextual-variables/), and configure the `tls` and `sasl` fields with credentials for a user that can write to the target topic: > > ```yaml > output: > redpanda: > seed_brokers: > - ${REDPANDA_BROKERS} > topic: > tls: > enabled: true > sasl: > - mechanism: SCRAM-SHA-256 > username: "" > password: "${secrets.PASSWORD}" > ``` > > If you leave `seed_brokers` empty, this output ignores the `tls` and `sasl` fields you configure and connects using the internal `redpanda` configuration block that Redpanda Cloud manages for pipeline logs and status reporting. That connection uses a Redpanda Cloud service principal that has no access to your topics, so the pipeline fails with authorization errors. #### Common ```yml output: label: "" redpanda: seed_brokers: [] # No default (optional) topic: "" # No default (required) key: "" # No default (optional) partition: "" # No default (optional) metadata: include_prefixes: [] include_patterns: [] max_in_flight: 256 batching: count: 0 byte_size: 0 period: "" check: "" ``` #### Advanced ```yml output: label: "" redpanda: seed_brokers: [] # No default (optional) client_id: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] sasl: [] # No default (optional) metadata_max_age: 1m request_timeout_overhead: 10s conn_idle_timeout: 20s tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s topic: "" # No default (required) key: "" # No default (optional) partition: "" # No default (optional) metadata: include_prefixes: [] include_patterns: [] timestamp_ms: "" # No default (optional) tombstone: "" # No default (optional) max_in_flight: 256 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) inject_tracing_map: "" # No default (optional) partitioner: "" # No default (optional) idempotent_write: true acks: all compression: snappy allow_auto_topic_creation: true timeout: 10s max_message_bytes: 1MiB broker_write_max_bytes: 100MiB max_buffered_records: 10000 max_buffered_bytes: "0" max_in_flight_requests: 1 record_retries: 0 record_delivery_timeout: 0s ``` ## Fields ### `acks` The number of acknowledgements the leader broker must receive from ISR brokers before responding to the produce request. When `idempotent_write` is enabled this must be set to `all`. **Type**: `string` **Default**: `all` | Option | Summary | | --- | --- | | `all` | Wait for all in-sync replicas to acknowledge (acks=-1). Required when idempotent_write is enabled. | | `leader` | Wait for the leader broker to acknowledge (acks=1). Messages are lost if the leader fails before replication. | | `none` | Do not wait for any acknowledgement (acks=0). Highest throughput but messages may be lost. | ### `allow_auto_topic_creation` Enables topics to be auto created if they do not exist when fetching their metadata. If set to `false`, the topic must already exist. **Type**: `bool` **Default**: `true` ### `batching` Optional explicit batching policy for the output. Note that when batches are formed at the input level they can be expanded by this policy, but not contracted. When consuming data from a Redpanda input it is recommended to tune batches from the input config via the `max_yield_batch_bytes` field, or the `unordered_processing.batching` field if appropriate. **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `broker_write_max_bytes` The maximum number of bytes this output can write to a broker connection in a single write. This field corresponds to Kafka’s `socket.request.max.bytes`. **Type**: `string` **Default**: `100MiB` ```yaml # Examples: broker_write_max_bytes: 128MB # --- broker_write_max_bytes: 50mib ``` ### `client_id` An identifier for the client connection. This identifier appears in broker logs and metrics, which helps you identify the Redpanda Connect instance that is connecting. **Type**: `string` **Default**: `redpanda-connect` ### `compression` The compression codec for produced record batches. A batch that compression does not make smaller is sent uncompressed, whichever codec you choose. **Type**: `string` **Default**: `snappy` **Options**: `lz4`, `snappy`, `gzip`, `none`, `zstd` ### `conn_idle_timeout` The approximate amount of time that connections can remain idle before they are closed. In the worst case, a connection can stay idle for up to twice this value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `20s` ### `idempotent_write` Enable the idempotent write producer option. When enabled, the producer initializes a producer ID and uses it to guarantee exactly-once semantics per partition, so retries do not produce duplicates. This option requires the `IDEMPOTENT_WRITE` permission on the `CLUSTER` resource. Disable this option if the `IDEMPOTENT_WRITE` permission is unavailable, for example in some managed Kafka services or Redpanda clusters with strict ACLs. Disabling this option only affects retry behavior: duplicates may occur on producer retries, but the pipeline continues to function normally. **Type**: `bool` **Default**: `true` ### `inject_tracing_map` EXPERIMENTAL: A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) used to inject an object containing tracing propagation information into outbound messages. The specification of the injected fields will match the format used by the service wide tracer. **Type**: `string` ```yaml # Examples: inject_tracing_map: meta = @.merge(this) # --- inject_tracing_map: root.meta.span = this ``` ### `key` An optional key to populate for each message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `max_buffered_bytes` The maximum number of bytes the client will buffer in memory before blocking. When this limit is reached, `Produce()` calls will block until buffered records are delivered. Set to `0` to disable the byte-level limit (only `max_buffered_records` applies). This limit is checked after `max_buffered_records`. **Type**: `string` **Default**: `0` ```yaml # Examples: max_buffered_bytes: 256MB # --- max_buffered_bytes: 50mib ``` ### `max_buffered_records` The maximum number of records the client will buffer in memory before blocking. When this limit is reached, `Produce()` calls will block until buffered records are delivered and space frees up. Increase this value for high-throughput pipelines to avoid back-pressure stalls. **Type**: `int` **Default**: `10000` ### `max_in_flight` The maximum number of message batches to send in parallel at any given time. Increase this number to improve throughput until performance plateaus. **Type**: `int` **Default**: `256` ### `max_in_flight_requests` The maximum number of produce requests in flight per broker connection. While `idempotent_write` is enabled (the default) this must be `1`, as the client relies on a single in-flight request per broker to guarantee ordering. To use higher values you must set `idempotent_write` to `false`, which allows requests to be pipelined for throughput but may cause duplicate and out-of-order delivery on retries. Note that this is distinct from the output’s `max_in_flight` field, which counts message batches being written in parallel rather than produce requests on the wire. A value of `1` is not a throughput ceiling: records from concurrent writes are coalesced into fewer, larger produce requests. **Type**: `int` **Default**: `1` ### `max_message_bytes` The maximum size of a produced record batch in bytes. A `MESSAGE_TOO_LARGE` error is returned if a batch exceeds this limit. This field maps to the `max.message.bytes` Kafka property. Ensure the Redpanda broker’s [`kafka_batch_max_bytes`](https://docs.redpanda.com/streaming/current/reference/properties/cluster-properties/#kafka_batch_max_bytes) property is at least as large as this value. **Type**: `string` **Default**: `1MiB` ```yaml # Examples: max_message_bytes: 100MB # --- max_message_bytes: 50mib ``` ### `metadata` Determines which metadata values are added to messages as headers. **Type**: `object` ### `metadata.include_patterns[]` A list of explicit metadata key regular expression (re2) patterns to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_patterns: - .* # --- include_patterns: - _timestamp_unix$ ``` ### `metadata.include_prefixes[]` A list of explicit metadata key prefixes to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_prefixes: - foo_ - bar_ # --- include_prefixes: - kafka_ # --- include_prefixes: - content- ``` ### `metadata_max_age` The maximum period of time after which metadata is refreshed. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Lower values provide more responsive topic and partition discovery but may increase broker load. Higher values reduce broker queries but can delay detection of topology changes. This interval also controls how frequently regex topic patterns are re-evaluated to discover new matching topics. **Type**: `string` **Default**: `1m` ### `partition` An optional explicit partition to set for each message. This field is only relevant when the `partitioner` is set to `manual`. The provided interpolation string must be a valid integer. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: partition: ${! meta("partition") } ``` ### `partitioner` Override the default murmur2 hashing partitioner. **Type**: `string` | Option | Summary | | --- | --- | | `least_backup` | Chooses the least backed up partition (the partition with the fewest amount of buffered records). Partitions are selected per batch. | | `manual` | Manually select a partition for each message, requires the field `partition` to be specified. | | `murmur2_hash` | Kafka’s default hash algorithm that uses a 32-bit murmur2 hash of the key to compute which partition the record will be on. | | `round_robin` | Round-robin’s messages through all available partitions. This algorithm has lower throughput and causes higher CPU load on brokers, but can be useful if you want to ensure an even distribution of records to partitions. | ### `record_delivery_timeout` The maximum time a record can sit in the producer buffer before it is failed, roughly equivalent to Kafka’s `delivery.timeout.ms`. This is evaluated before writing a request or after a produce response. When a record times out, all records in the same partition are also failed. Set to `0s` for no timeout (the default). With `idempotent_write` enabled, timeouts are only enforced when safe to do so without creating invalid sequence numbers. **Type**: `string` **Default**: `0s` ### `record_retries` The maximum number of times a record produce is retried on failure before the record is failed. When a record fails, all records buffered in the same partition are also failed to preserve gapless ordering. Set to `0` for unlimited retries (the default). With `idempotent_write` enabled, retries are only enforced when safe to do so without creating invalid sequence numbers. **Type**: `int` **Default**: `0` ### `request_timeout_overhead` Additional time to apply as overhead when calculating request deadlines. For most requests, the deadline is this overhead alone. For requests that define their own timeout field, the overhead is added on top of that timeout, which helps prevent premature timeouts. This field is roughly equivalent to Apache Kafka’s `request.timeout.ms` parameter, but grants extra time to requests that have timeout fields. **Type**: `string` **Default**: `10s` ### `sasl[]` Specify one or more methods or mechanisms of SASL authentication. They are tried in order. If the broker supports the first SASL mechanism, all connections use it. If the first mechanism fails, the client picks the first supported mechanism. If the broker does not support any client mechanisms, all connections fail. **Type**: `array` ```yaml # Examples: sasl: - mechanism: SCRAM-SHA-512 password: bar username: foo ``` ### `sasl[].aws` Contains AWS-specific fields for when `sasl.mechanism` is set to `AWS_MSK_IAM`. **Type**: `object` ### `sasl[].aws.credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `sasl[].aws.credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `sasl[].aws.credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `sasl[].aws.credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `sasl[].aws.credentials.role` The ARN of the role to assume. **Type**: `string` ### `sasl[].aws.credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `sasl[].aws.credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `sasl[].aws.credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `sasl[].aws.endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `sasl[].aws.region` The AWS region in which your resources are hosted. **Type**: `string` ### `sasl[].aws.tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `sasl[].aws.tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].aws.tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `sasl[].aws.tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `sasl[].aws.tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].extensions` Key/value pairs to add to OAUTHBEARER authentication requests. **Type**: `object` ### `sasl[].mechanism` The SASL mechanism to use for authentication. **Type**: `string` | Option | Summary | | --- | --- | | `AWS_MSK_IAM` | AWS IAM based authentication as specified by the 'aws-msk-iam-auth' java library. | | `OAUTHBEARER` | OAuth Bearer based authentication. | | `PLAIN` | Plain text authentication. | | `REDPANDA_CLOUD_SERVICE_ACCOUNT` | Redpanda Cloud Service Account authentication when running in Redpanda Cloud. | | `SCRAM-SHA-256` | SCRAM based authentication as specified in RFC5802. | | `SCRAM-SHA-512` | SCRAM based authentication as specified in RFC5802. | | `none` | Disable sasl authentication | ### `sasl[].password` The password to use for PLAIN or SCRAM-* authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `sasl[].token` The token to use for a single session’s OAUTHBEARER authentication. **Type**: `string` **Default**: `""` ### `sasl[].username` The username to use for PLAIN or SCRAM-* authentication. **Type**: `string` **Default**: `""` ### `seed_brokers[]` A list of broker addresses used to establish connections. If an item of the list contains commas, it is expanded into multiple addresses. If you omit this field, this component ignores the connection fields set on it, including `tls` and `sasl`, and takes its entire connection configuration from the top-level `redpanda` block. In Redpanda Cloud, the platform sets the top-level `redpanda` block for pipeline logs and status reporting, and its credentials can’t access your topics, so always set this field in Redpanda Cloud. **Type**: `array` ```yaml # Examples: seed_brokers: - "localhost:9092" # --- seed_brokers: - "foo:9092" - "bar:9092" # --- seed_brokers: - "foo:9092,bar:9092" ``` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `timeout` The maximum period of time to wait for message sends before abandoning the request and retrying. **Type**: `string` **Default**: `10s` ### `timestamp_ms` An optional timestamp to set for each message, in milliseconds since the Unix epoch. When left empty, the current timestamp is used. You cannot set both `timestamp` and `timestamp_ms`. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: timestamp_ms: ${! timestamp_unix_milli() } # --- timestamp_ms: ${! metadata("kafka_timestamp_ms") } ``` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `tombstone` An optional boolean that, when it resolves to `true` for a message, writes that message as a tombstone: a record with a null value. The message payload is ignored for tombstones. Use this to delete keys on compacted topics, or to keep tombstones intact when mirroring a topic. An empty payload is not a tombstone. The interpolation must resolve to a value that can be parsed as a boolean, otherwise the write fails. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: tombstone: ${! @kafka_tombstone_message } # --- tombstone: ${! @operation == "delete" } ``` ### `topic` A topic to write messages to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ## Examples ### Simple Common Output Data is generated and written to a topic `bar`, targeting the cluster configured within the `redpanda` block at the bottom. This lets you configure TLS and SASL once and share them across multiple inputs and outputs. ```yaml input: generate: interval: 1s mapping: 'root.name = fake("name")' pipeline: processors: - mutation: | root.id = uuid_v4() root.loud_name = this.name.uppercase() output: redpanda: topic: bar key: ${! @id } redpanda: seed_brokers: [ "127.0.0.1:9092" ] tls: enabled: true sasl: - mechanism: SCRAM-SHA-512 password: bar username: foo ``` ### Deletes From CDC Changes from a PostgreSQL table are written to a compacted topic keyed by the primary key. The `postgres_cdc` input sets the `operation` metadata field to `delete` for deleted rows, so `tombstone` writes those as records with a null value and compaction removes the key. Other operations are written with their row as the value. ```yaml input: postgres_cdc: dsn: postgres://user:pass@localhost:5432/db?sslmode=disable slot_name: users_slot schema: public tables: [ users ] stream_snapshot: true output: redpanda: seed_brokers: [ "127.0.0.1:9092" ] topic: users key: ${! this.id } tombstone: ${! @operation == "delete" } ``` ### Topic Mirror Records are copied from one topic to another. The `redpanda` input sets the `kafka_tombstone_message` metadata field to `true` for tombstones and `false` otherwise, so `tombstone` keeps tombstones as records with a null value instead of writing them as empty records. ```yaml input: redpanda: seed_brokers: [ "127.0.0.1:9092" ] topics: [ source ] consumer_group: mirror output: redpanda: seed_brokers: [ "127.0.0.1:9092" ] topic: destination key: ${! @kafka_key } tombstone: ${! @kafka_tombstone_message } ``` --- # Page 153: reject_errored **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/reject_errored.md --- # reject_errored Rejects messages that have failed their processing steps, resulting in nack behavior at the input level, otherwise sends them to a child output. The routing of messages rejected by this output depends on the type of input it came from. For inputs that support propagating nacks upstream such as AMQP or NATS the message will be nacked. However, for inputs that are sequential such as files or Kafka the messages will simply be reprocessed from scratch. #### Common ```yml output: label: "" reject_errored: {} ``` #### Advanced ```yml output: label: "" reject_errored: {} ``` ## Examples ### Rejecting Failed Messages The most straight forward use case for this output type is to nack messages that have failed their processing steps. In this example our mapping might fail, in which case the messages that failed are rejected and will be nacked by our input: ```yaml input: nats_jetstream: urls: [ nats://127.0.0.1:4222 ] subject: foos.pending pipeline: processors: - mutation: 'root.age = this.fuzzy.age.int64()' output: reject_errored: nats_jetstream: urls: [ nats://127.0.0.1:4222 ] subject: foos.processed ``` ### DLQing Failed Messages Another use case for this output is to send failed messages straight into a dead-letter queue. You use it within a [fallback output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/fallback/) that allows you to specify where these failed messages should go to next. ```yaml pipeline: processors: - mutation: 'root.age = this.fuzzy.age.int64()' output: fallback: - reject_errored: http_client: url: http://foo:4195/post/might/become/unreachable retries: 3 retry_period: 1s - http_client: url: http://bar:4196/somewhere/else retries: 3 retry_period: 1s ``` --- # Page 154: reject **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/reject.md --- # reject Rejects all messages, treating them as though the output destination failed to publish them. The routing of messages after this output depends on the type of input it came from. For inputs that support propagating nacks upstream such as AMQP or NATS the message will be nacked. However, for inputs that are sequential such as files or Kafka the messages will simply be reprocessed from scratch. To learn when this output could be useful, see \[the [Examples](#examples). #### Common ```yml output: label: "" reject: "" ``` #### Advanced ```yml output: label: "" reject: "" ``` ## Examples ### Rejecting Failed Messages This input is particularly useful for routing messages that have failed during processing, where instead of routing them to some sort of dead letter queue we wish to push the error upstream. We can do this with a switch broker: ```yaml output: switch: retry_until_success: false cases: - check: '!errored()' output: amqp_1: urls: [ amqps://guest:guest@localhost:5672/ ] target_address: queue:/the_foos - output: reject: "processing failed due to: ${! error() }" ``` --- # Page 155: resource **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/resource.md --- # resource Resource is an output type that channels messages to a resource output, identified by its name. Resources allow you to tidy up deeply nested configs. For example, the config: ```yaml output: broker: pattern: fan_out outputs: - kafka: addresses: [ TODO ] topic: foo - gcp_pubsub: project: bar topic: baz ``` Could also be expressed as: ```yaml output: broker: pattern: fan_out outputs: - resource: foo - resource: bar output_resources: - label: foo kafka: addresses: [ TODO ] topic: foo - label: bar gcp_pubsub: project: bar topic: baz ``` You can find out more about resources in [Resources](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/resources/) ## Common ```yml output: resource: "" ``` ## Advanced ```yml output: resource: "" ``` --- # Page 156: retry **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/retry.md --- # retry Attempts to write messages to a child output and if the write fails for any reason the message is retried either until success or, if the retries or max elapsed time fields are non-zero, either is reached. All messages in Redpanda Connect are always retried on an output error, but this would usually involve propagating the error back to the source of the message, whereby it would be reprocessed before reaching the output layer once again. This output type is useful whenever we wish to avoid reprocessing a message on the event of a failed send. We might, for example, have a deduplication processor that we want to avoid reapplying to the same message more than once in the pipeline. Rather than retrying the same output you may wish to retry the send using a different output target (a dead letter queue). In which case you should instead use the [`fallback`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/fallback/) output type. #### Common ```yml output: label: "" retry: output: {} # No default (required) ``` #### Advanced ```yml output: label: "" retry: max_retries: 0 backoff: initial_interval: 500ms max_interval: 3s max_elapsed_time: 0s output: {} # No default (required) ``` ## Fields ### `backoff` The exponential backoff between retry attempts. The wait starts at `initial_interval` and grows with each failed attempt, up to `max_interval`. **Type**: `object` ### `backoff.initial_interval` The initial period to wait between retry attempts. The retry interval increases for each failed attempt, up to the `backoff.max_interval` value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `500ms` ### `backoff.max_elapsed_time` The maximum period to wait before retry attempts are abandoned. If zero then no limit is used. **Type**: `string` **Default**: `0s` ### `backoff.max_interval` The maximum period to wait between retry attempts. **Type**: `string` **Default**: `3s` ### `max_retries` The maximum number of retries before giving up on the request. If set to zero there is no discrete limit. **Type**: `int` **Default**: `0` ### `output` A child output. **Type**: `output` --- # Page 157: salesforce_sink **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/salesforce_sink.md --- # salesforce_sink Writes messages to Salesforce, routing each Kafka topic to its own sObject configuration. Consumes batches of messages and writes them to Salesforce. Each message must have a `topic` field (set by the per-topic processor) and a `data` field containing the Salesforce record fields. The `topic` is used to look up the correct `topic_mappings` entry which defines the SObject, operation, and write mode. **Realtime mode** uses the sObject Collections REST API (synchronous, up to 200 records/call). **Bulk mode** uses the Bulk API 2.0 (asynchronous, polls until complete). ```yaml input: broker: inputs: - kafka_franz: seed_brokers: [localhost:9092] topics: [salesforce-account] consumer_group: sf-sink-account processors: - mapping: | root.topic = @kafka_topic root.data = this - kafka_franz: seed_brokers: [localhost:9092] topics: [salesforce-contact] consumer_group: sf-sink-contact processors: - mapping: | root.topic = @kafka_topic root.data = this output: salesforce_sink: org_url: "${SALESFORCE_ORG_URL}" client_id: "${SALESFORCE_CLIENT_ID}" client_secret: "${SALESFORCE_CLIENT_SECRET}" topic_mappings: - topic: salesforce-account sobject: Account operation: upsert external_id_field: External_Id__c mode: realtime - topic: salesforce-contact sobject: Contact operation: upsert external_id_field: External_Id__c mode: bulk ``` #### Common ```yml output: label: "" salesforce_sink: org_url: "" # No default (required) client_id: "" # No default (required) client_secret: "" # No default (required) api_version: v65.0 bulk_batch_size: 1000 max_concurrent_bulk_jobs: 10 bulk_poll_interval: 5s batch_period: 5s max_in_flight: 1 topic_mappings: [] # No default (required) ``` #### Advanced ```yml output: label: "" salesforce_sink: org_url: "" # No default (required) client_id: "" # No default (required) client_secret: "" # No default (required) api_version: v65.0 bulk_batch_size: 1000 max_concurrent_bulk_jobs: 10 bulk_poll_interval: 5s batch_period: 5s max_in_flight: 1 topic_mappings: [] # No default (required) http: timeout: 5s tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] proxy_url: "" disable_http2: false tps_limit: 0 tps_burst: 1 backoff: initial_interval: 1s max_interval: 30s max_retries: 3 tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s http: max_idle_conns: 100 max_idle_conns_per_host: 0 max_conns_per_host: 64 idle_conn_timeout: 1m30s tls_handshake_timeout: 10s expect_continue_timeout: 1s response_header_timeout: 0s disable_keep_alives: false disable_compression: false max_response_header_bytes: 1048576 max_response_body_bytes: 10485760 write_buffer_size: 4096 read_buffer_size: 4096 h2: strict_max_concurrent_requests: false max_decoder_header_table_size: 4096 max_encoder_header_table_size: 4096 max_read_frame_size: 16384 max_receive_buffer_per_connection: 1048576 max_receive_buffer_per_stream: 1048576 send_ping_timeout: 0s ping_timeout: 15s write_byte_timeout: 0s access_log_level: "" access_log_body_limit: 0 ``` ## Fields ### `api_version` Salesforce REST API version to target, prefixed with `v`. Affects endpoint paths (`/services/data/{api_version}/…​`) and available fields/objects. Must be supported by your org; check Setup → Company Information. Older versions may lack recent fields. **Type**: `string` **Default**: `v65.0` ```yaml # Examples: api_version: v65.0 # --- api_version: v62.0 ``` ### `batch_period` Maximum period to wait before flushing an incomplete batch. **Type**: `string` **Default**: `5s` ### `bulk_batch_size` Number of records per bulk job. Also controls the output batch size. **Type**: `int` **Default**: `1000` ### `bulk_poll_interval` How often to poll Salesforce for bulk job completion status. **Type**: `string` **Default**: `5s` ### `client_id` Consumer Key of the Salesforce Connected App authorized for the OAuth Client Credentials flow. Create the Connected App under Setup → App Manager → New Connected App, enable OAuth settings, enable the Client Credentials Flow under `Flow Enablement`, then copy the Consumer Key from `Manage Consumer Details`. **Type**: `string` ### `client_secret` Consumer Secret of the Salesforce Connected App, paired with `client_id`. Sensitive; prefer environment variable interpolation (`${SALESFORCE_CLIENT_SECRET}`) over inlining. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `http` HTTP client configuration for Salesforce REST calls (OAuth token endpoint and, where applicable, data queries). **Type**: `object` ### `http.access_log_body_limit` Maximum bytes of request/response body to include in logs. 0 to skip body logging. **Type**: `int` **Default**: `0` ### `http.access_log_level` Log level for HTTP request/response logging. Empty disables logging. **Type**: `string` **Default**: `""` **Options**: `""`, `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR` ### `http.backoff` Adaptive backoff configuration for 429 (Too Many Requests) responses. Always active. **Type**: `object` ### `http.backoff.initial_interval` Initial interval between retries on 429 responses. **Type**: `string` **Default**: `1s` ### `http.backoff.max_interval` Maximum interval between retries on 429 responses. **Type**: `string` **Default**: `30s` ### `http.backoff.max_retries` Maximum number of retries on 429 responses. **Type**: `int` **Default**: `3` ### `http.disable_http2` Disable HTTP/2 and force HTTP/1.1. **Type**: `bool` **Default**: `false` ### `http.http` HTTP transport settings controlling connection pooling, timeouts, and HTTP/2. **Type**: `object` ### `http.http.disable_compression` Disable automatic decompression of gzip responses. **Type**: `bool` **Default**: `false` ### `http.http.disable_keep_alives` Disable HTTP keep-alive connections; each request uses a new connection. **Type**: `bool` **Default**: `false` ### `http.http.expect_continue_timeout` Maximum time to wait for a server’s 100-continue response before sending the body. 0 means the body is sent immediately. **Type**: `string` **Default**: `1s` ### `http.http.h2` HTTP/2-specific transport settings. Only applied when HTTP/2 is enabled. **Type**: `object` ### `http.http.h2.max_decoder_header_table_size` Upper limit in bytes for the HPACK header table used to decode headers from the peer. Must be less than 4 MiB. **Type**: `int` **Default**: `4096` ### `http.http.h2.max_encoder_header_table_size` Upper limit in bytes for the HPACK header table used to encode headers sent to the peer. Must be less than 4 MiB. **Type**: `int` **Default**: `4096` ### `http.http.h2.max_read_frame_size` Largest HTTP/2 frame this endpoint will read. Valid range: 16 KiB to 16 MiB. **Type**: `int` **Default**: `16384` ### `http.http.h2.max_receive_buffer_per_connection` Maximum flow-control window size in bytes for data received on a connection. Must be at least 64 KiB and less than 4 MiB. **Type**: `int` **Default**: `1048576` ### `http.http.h2.max_receive_buffer_per_stream` Maximum flow-control window size in bytes for data received on a single stream. Must be less than 4 MiB. **Type**: `int` **Default**: `1048576` ### `http.http.h2.ping_timeout` Timeout waiting for a PING response before closing the connection. **Type**: `string` **Default**: `15s` ### `http.http.h2.send_ping_timeout` Idle timeout after which a PING frame is sent to verify connection health. 0 disables health checks. **Type**: `string` **Default**: `0s` ### `http.http.h2.strict_max_concurrent_requests` When true, new requests block when a connection’s concurrency limit is reached instead of opening a new connection. **Type**: `bool` **Default**: `false` ### `http.http.h2.write_byte_timeout` Timeout for writing data to a connection. The timer resets whenever bytes are written. 0 disables the timeout. **Type**: `string` **Default**: `0s` ### `http.http.idle_conn_timeout` How long an idle connection remains in the pool before being closed. 0 disables the timeout. **Type**: `string` **Default**: `1m30s` ### `http.http.max_conns_per_host` Maximum total connections (active + idle) per host. 0 means unlimited. **Type**: `int` **Default**: `64` ### `http.http.max_idle_conns` Maximum total number of idle (keep-alive) connections across all hosts. 0 means unlimited. **Type**: `int` **Default**: `100` ### `http.http.max_idle_conns_per_host` Maximum idle connections to keep per host. 0 (the default) uses GOMAXPROCS+1. **Type**: `int` **Default**: `0` ### `http.http.max_response_body_bytes` Maximum bytes of response body the client will read. The response body is wrapped with a limit reader; reads beyond this cap return EOF. 0 disables the limit. **Type**: `int` **Default**: `10485760` ### `http.http.max_response_header_bytes` Maximum bytes of response headers to allow. **Type**: `int` **Default**: `1048576` ### `http.http.read_buffer_size` Size in bytes of the per-connection read buffer. **Type**: `int` **Default**: `4096` ### `http.http.response_header_timeout` Maximum time to wait for response headers after writing the full request. 0 disables the timeout. **Type**: `string` **Default**: `0s` ### `http.http.tls_handshake_timeout` Maximum time to wait for a TLS handshake to complete. 0 disables the timeout. **Type**: `string` **Default**: `10s` ### `http.http.write_buffer_size` Size in bytes of the per-connection write buffer. **Type**: `int` **Default**: `4096` ### `http.proxy_url` HTTP proxy URL. Empty string disables proxying. **Type**: `string` **Default**: `""` ### `http.tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `http.tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `http.tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `http.tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `http.tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `http.tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `http.tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `http.timeout` HTTP request timeout. **Type**: `string` **Default**: `5s` ### `http.tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `http.tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `http.tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `http.tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `http.tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `http.tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `http.tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `http.tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `http.tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `http.tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `http.tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `http.tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `http.tps_burst` Maximum burst size for rate limiting. **Type**: `int` **Default**: `1` ### `http.tps_limit` Rate limit in requests per second. 0 disables rate limiting. **Type**: `float` **Default**: `0` ### `max_concurrent_bulk_jobs` Maximum number of bulk jobs polling concurrently in the background. Each in-flight job buffers its CSV payload in memory. Lower this value if memory usage is a concern. **Type**: `int` **Default**: `10` ### `max_in_flight` Maximum number of batches to send concurrently. Increasing this value improves real-time write throughput. **Type**: `int` **Default**: `1` ### `org_url` Salesforce instance base URL for your org, protocol included and no trailing slash. Used as the base for both the OAuth token endpoint and REST queries. Production orgs use `https://{my-domain}.my.salesforce.com`; sandboxes use `https://{my-domain}.sandbox.my.salesforce.com`. Legacy instance URLs (`https://na123.salesforce.com`) still work but My Domain URLs are strongly recommended by Salesforce. **Type**: `string` ```yaml # Examples: org_url: https://acme.my.salesforce.com # --- org_url: https://acme--staging.sandbox.my.salesforce.com ``` ### `topic_mappings[]` Per-topic Salesforce write configuration. Each entry maps a topic to an sObject and write settings. **Type**: `array` ### `topic_mappings[].all_or_none` Real-time only: rolls back every record in a request if any record in it fails. Real-time writes send at most 200 records per request, so a larger batch can be partly committed. **Type**: `bool` **Default**: `false` ### `topic_mappings[].external_id_field` External ID field name. Required for upsert operations. **Type**: `string` **Default**: `""` ### `topic_mappings[].mode` Write mode: `realtime` (sObject Collections API) or `bulk` (Bulk API 2.0). **Type**: `string` **Default**: `realtime` ### `topic_mappings[].operation` Write operation: insert, update, upsert, or delete. **Type**: `string` **Default**: `upsert` ### `topic_mappings[].sobject` Salesforce sObject API name (for example, Account, Contact, MyObject__c). **Type**: `string` ### `topic_mappings[].topic` The topic name to match against the message’s `topic` field. **Type**: `string` --- # Page 158: schema_registry **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/schema_registry.md --- # schema_registry Publishes schemas to a schema registry. This output uses the [Franz Kafka Schema Registry client](https://github.com/twmb/franz-go/tree/master/pkg/sr). ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. ### Common ```yml output: label: "" schema_registry: url: "" # No default (required) subject: "" # No default (required) max_in_flight: 64 ``` ### Advanced ```yml output: label: "" schema_registry: url: "" # No default (required) subject: "" # No default (required) subject_compatibility_level: "" # No default (optional) backfill_dependencies: true translate_ids: false normalize: true remove_metadata: true remove_rule_set: true input_resource: schema_registry_input tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] max_in_flight: 64 oauth: enabled: false consumer_key: "" consumer_secret: "" access_token: "" access_token_secret: "" basic_auth: enabled: false username: "" password: "" jwt: enabled: false private_key_file: "" signing_method: "" claims: {} headers: {} ``` ## Examples ### Write schemas Write schemas to a Schema Registry instance which is in IMPORT mode, preserving their IDs. Re-writing a schema which already exists is idempotent, so the only errors which need handling are genuine conflicts, where a different schema is already registered under the same ID. These are logged and dropped, while any other error is rejected. ```yaml output: fallback: - schema_registry: url: http://localhost:8082 subject: ${! @schema_registry_subject } subject_compatibility_level: ${! @schema_registry_subject_compatibility_level } - switch: cases: - check: '@fallback_error.contains("Overwrite new schema")' output: drop: {} processors: - log: level: ERROR message: | Subject '${! @schema_registry_subject }' version ${! @schema_registry_version } conflicts with a different schema already registered under ID ${! json("id") }: ${! content() } - output: reject: ${! @fallback_error } ``` ## Fields ### `backfill_dependencies` Backfill missing schema references and previous schema versions. If set to `true`, you must also configure a [`schema_registry`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/schema_registry/) input to read source schemas. **Type**: `bool` **Default**: `true` ### `basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `input_resource` The label of the [`schema_registry` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/schema_registry/) from which to read source schemas. **Type**: `string` **Default**: `schema_registry_input` ### `jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `normalize` Normalize schemas. **Type**: `bool` **Default**: `true` ### `oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `remove_metadata` Remove the `metadata` property from each schema before it is registered on the destination schema registry. **Type**: `bool` **Default**: `true` ### `remove_rule_set` Remove the `ruleSet` property from each schema before it is registered on the destination schema registry. **Type**: `bool` **Default**: `true` ### `subject` The subject name. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `subject_compatibility_level` The compatibility level for the subject. Can be one of `BACKWARD`, `BACKWARD_TRANSITIVE`, `FORWARD`, `FORWARD_TRANSITIVE`, `FULL`, `FULL_TRANSITIVE`, `NONE`. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `translate_ids` Translate schema IDs. When `false`, schemas are created on the destination with their original IDs and versions, which requires the destination schema registry to be in `IMPORT` mode (Redpanda v25.3 or later, or Confluent Schema Registry). When `true`, the destination assigns new IDs and must be in `READWRITE` mode, since schemas registered without an explicit ID are rejected in `IMPORT` mode. **Type**: `bool` **Default**: `false` ### `url` The base URL of the schema registry service. **Type**: `string` --- # Page 159: sftp **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/sftp.md --- # sftp Writes files to an SFTP server. In order to have a different path for each object you should use function interpolations described [here](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. ### Common ```yml output: label: "" sftp: address: "" # No default (required) credentials: username: "" password: "" host_public_key_file: "" # No default (optional) host_public_key: "" # No default (optional) private_key_file: "" # No default (optional) private_key: "" # No default (optional) private_key_pass: "" path: "" # No default (required) codec: all-bytes max_in_flight: 64 ``` ### Advanced ```yml output: label: "" sftp: address: "" # No default (required) connection_timeout: 30s credentials: username: "" password: "" host_public_key_file: "" # No default (optional) host_public_key: "" # No default (optional) private_key_file: "" # No default (optional) private_key: "" # No default (optional) private_key_pass: "" ssh_algorithms: additional_key_exchanges: [] # No default (optional) additional_ciphers: [] # No default (optional) additional_macs: [] # No default (optional) path: "" # No default (required) codec: all-bytes max_in_flight: 64 ``` ## Fields ### `address` The address (hostname or IP address) of the SFTP server to connect to. **Type**: `string` ### `codec` The way in which the bytes of messages are written to the file. With the `delim:x` codec, each message is followed by the custom delimiter `x`, which can be any character sequence. A delimiter is not added to a message that already ends with it. **Type**: `string` **Default**: `all-bytes` | Option | Summary | | --- | --- | | `all-bytes` | Only applicable to file based outputs. Writes each message to a file in full, if the file already exists the old content is deleted. | | `append` | Append each message to the output stream without any delimiter or special encoding. | | `delim:x` | Append each message to the output stream followed by a custom delimiter. | | `lines` | Append each message to the output stream followed by a line break. | ```yaml # Examples: codec: lines # --- codec: "delim:\t" # --- codec: delim:foobar ``` ### `connection_timeout` The connection timeout to use when connecting to the target server. **Type**: `string` **Default**: `30s` ### `credentials` The credentials required to log in to the SFTP server. This can include a username and password, or a private key for secure access. **Type**: `object` ### `credentials.host_public_key` The raw contents of the SFTP server’s public key, used for host key verification. **Type**: `string` ### `credentials.host_public_key_file` The path to the SFTP server’s public key file, used for host key verification. **Type**: `string` ### `credentials.password` The password to use for authentication. Used together with `username` for basic authentication or with encrypted private keys for secure access. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `credentials.private_key` The raw contents of the private key used to authenticate with the SFTP server. This field provides an alternative to `private_key_file`. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.private_key_file` The path to a private key file used to authenticate with the SFTP server. You can also provide a private key using the `private_key` field. **Type**: `string` ### `credentials.private_key_pass` An optional passphrase for decrypting the private key, if it is encrypted. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `credentials.ssh_algorithms` Additional SSH transport algorithms to permit for compatibility with legacy SFTP servers. Configured algorithms are appended to the default algorithms, which remain preferred, and when unset the defaults are used unchanged. Algorithms the underlying SSH library classifies as insecure weaken transport security and should only be enabled when required by a known server. These settings do not affect host key verification. **Type**: `object` ### `credentials.ssh_algorithms.additional_ciphers[]` Ciphers to permit in addition to the defaults, for example `aes128-cbc`. **Type**: `array` ### `credentials.ssh_algorithms.additional_key_exchanges[]` Key exchange algorithms to permit in addition to the defaults, for example `diffie-hellman-group1-sha1` or `diffie-hellman-group-exchange-sha1`. **Type**: `array` ### `credentials.ssh_algorithms.additional_macs[]` MAC algorithms to permit in addition to the defaults. **Type**: `array` ### `credentials.username` The username required to authenticate with the SFTP server. **Type**: `string` **Default**: `""` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `path` The file to save the messages to on the SFTP server. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` --- # Page 160: slack_post **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/slack_post.md --- # slack_post Posts a new message to a Slack channel using the Slack API method chat.postMessage. This output calls the [`chat.postMessage`](https://api.slack.com/methods/chat.postMessage) Slack API method once for each message. #### Common ```yml output: label: "" slack_post: bot_token: "" # No default (required) channel_id: "" # No default (required) thread_ts: "" text: "" blocks: "" # No default (optional) markdown: true unfurl_links: false unfurl_media: true link_names: false ``` #### Advanced ```yml output: label: "" slack_post: bot_token: "" # No default (required) channel_id: "" # No default (required) thread_ts: "" text: "" blocks: "" # No default (optional) markdown: true unfurl_links: false unfurl_media: true link_names: false ``` See also: [Examples](#examples) ## Fields ### `blocks` A Bloblang query that should return a JSON array of [Slack blocks](https://api.slack.com/reference/block-kit/blocks). You can either specify message content in the `text` or `blocks` fields, but not both. **Type**: `string` ### `bot_token` Your Slack bot user’s OAuth token, which must have the correct permissions to post messages to the target Slack channel. **Type**: `string` ### `channel_id` The encoded ID of the target Slack channel. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `link_names` When set to `true`, this output finds and links to [user groups](https://api.slack.com/reference/surfaces/formatting#mentioning-groups) mentioned in Slack messages. **Type**: `bool` **Default**: `false` ### `markdown` When set to `true`, this output accepts message content in Markdown format and applies Markdown formatting to the message. **Type**: `bool` **Default**: `true` ### `text` The text content of the message. You can either specify message content in the `text` or `blocks` fields, but not both. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `thread_ts` Specify the thread timestamp (`ts` value) of another message to post a reply within the same thread. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `unfurl_links` When set to `true`, this output provides previews of linked content in Slack messages. For more information about unfurling links, see the [Slack documentation](https://api.slack.com/reference/messaging/link-unfurling). **Type**: `bool` **Default**: `false` ### `unfurl_media` When set to `true`, this output enables media unfurling, which provides previews of rich content in Slack messages, such as videos or embedded tweets. **Type**: `bool` **Default**: `true` ## Examples ### Echo Slackbot A slackbot that echo messages from other users ```yaml input: slack: app_token: "${APP_TOKEN:xapp-demo}" bot_token: "${BOT_TOKEN:xoxb-demo}" pipeline: processors: - mutation: | # ignore hidden or non message events if this.event.type != "message" || (this.event.hidden | false) { root = deleted() } # Don't respond to our own messages if this.authorizations.any(auth -> auth.user_id == this.event.user) { root = deleted() } output: slack_post: bot_token: "${BOT_TOKEN:xoxb-demo}" channel_id: "${!this.event.channel}" thread_ts: "${!this.event.ts}" text: "ECHO: ${!this.event.text}" ``` --- # Page 161: slack_reaction **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/slack_reaction.md --- # slack_reaction Adds or removes an emoji reaction on a Slack message. This output uses the [`reactions.add`](https://api.slack.com/methods/reactions.add) and [`reactions.remove`](https://api.slack.com/methods/reactions.remove) API methods. Raising `max_in_flight` can improve throughput in high-volume pipelines, but it can also exceed Slack API rate limits. #### Common ```yml output: label: "" slack_reaction: bot_token: "" # No default (required) channel_id: "" # No default (required) timestamp: "" # No default (required) emoji: "" # No default (required) action: add max_in_flight: 64 ``` #### Advanced ```yml output: label: "" slack_reaction: bot_token: "" # No default (required) channel_id: "" # No default (required) timestamp: "" # No default (required) emoji: "" # No default (required) action: add max_in_flight: 64 ``` ## Fields ### `action` Whether to add or remove the reaction. When set to `add`, the specified emoji reaction is applied to the target message. When set to `remove`, the emoji reaction is removed from the target message. **Type**: `string` **Default**: `add` **Options**: `add`, `remove` ### `bot_token` Your Slack bot user’s OAuth token, which must have the [`reactions:write` scope](https://api.slack.com/scopes/reactions:write). The token starts with `xoxb-`. **Type**: `string` ### `channel_id` The encoded ID of the Slack channel that contains the target message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `emoji` The name of the emoji to be added or removed, without surrounding colons. Use the plain emoji name, such as `thumbsup` or `tada`. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `timestamp` The timestamp of the message to react to. This is a unique identifier for the message, usually obtained from a previous Slack API call (such as `chat.postMessage` or `conversations.history`). It typically looks like a Unix timestamp with a decimal. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` --- # Page 162: snowflake_put **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/snowflake_put.md --- # snowflake_put Sends messages to Snowflake stages and, optionally, calls Snowpipe to load this data into one or more tables. > 💡 **TIP** > > Use the [`snowflake_streaming` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/snowflake_streaming/) for better performance, lower cost, and simpler configuration. In order to use a different stage and / or Snowpipe for each message, you can use function interpolations as described in [Bloblang queries](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). When using batching, messages are grouped by the calculated stage and Snowpipe and are streamed to individual files in their corresponding stage and, optionally, a Snowpipe `insertFiles` REST API call will be made for each individual file. ## Credentials Two authentication mechanisms are supported: - User/password - Key Pair Authentication ### User/password This is a basic authentication mechanism which allows you to PUT data into a stage. However, it is not compatible with Snowpipe. ### Key pair authentication This authentication mechanism allows Snowpipe functionality, but it does require configuring an SSH Private Key beforehand. Please consult the [documentation](https://docs.snowflake.com/en/user-guide/key-pair-auth.html#configuring-key-pair-authentication) for details on how to set it up and assign the Public Key to your user. Note that the Snowflake documentation [used to suggest](https://twitter.com/felipehoffa/status/1560811785606684672) using this command: ```bash openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 ``` to generate an encrypted SSH private key. However, in this case, it uses an encryption algorithm called `pbeWithMD5AndDES-CBC`, which is part of the PKCS#5 v1.5 and is considered insecure. Due to this, Redpanda Connect does not support it and, if you wish to use password-protected keys directly, you must use PKCS#5 v2.0 to encrypt them by using the following command (as the current Snowflake docs suggest): ```bash openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 des3 -inform PEM -out rsa_key.p8 ``` If you have an existing key encrypted with PKCS#5 v1.5, you can re-encrypt it with PKCS#5 v2.0 using this command: ```bash openssl pkcs8 -in rsa_key_original.p8 -topk8 -v2 des3 -out rsa_key.p8 ``` Please consult the [pkcs8 command documentation](https://linux.die.net/man/1/pkcs8) for details on PKCS#5 algorithms. ## Batching It’s common to want to upload messages to Snowflake as batched archives. The easiest way to do this is to batch your messages at the output level and join the batch of messages with an [`archive`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/archive/) and/or [`compress`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/compress/) processor. For the optimal batch size, please consult the Snowflake [documentation](https://docs.snowflake.com/en/user-guide/data-load-considerations-prepare.html). ## Snowpipe Given a table called `BENTHOS_TBL` with one column of type `variant`: ```sql CREATE OR REPLACE TABLE BENTHOS_DB.PUBLIC.BENTHOS_TBL(RECORD variant) ``` and the following `BENTHOS_PIPE` Snowpipe: ```sql CREATE OR REPLACE PIPE BENTHOS_DB.PUBLIC.BENTHOS_PIPE AUTO_INGEST = FALSE AS COPY INTO BENTHOS_DB.PUBLIC.BENTHOS_TBL FROM (SELECT * FROM @%BENTHOS_TBL) FILE_FORMAT = (TYPE = JSON COMPRESSION = AUTO) ``` you can configure Redpanda Connect to use the implicit table stage `@%BENTHOS_TBL` as the `stage` and `BENTHOS_PIPE` as the `snowpipe`. In this case, you must set `compression` to `AUTO` and, if using message batching, you’ll need to configure an [`archive`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/archive/) processor with the `concatenate` format. Since the `compression` is set to `AUTO`, the [gosnowflake](https://github.com/snowflakedb/gosnowflake) client library will compress the messages automatically so you don’t need to add a [`compress`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/compress/) processor for message batches. If you add `STRIP_OUTER_ARRAY = TRUE` in your Snowpipe `FILE_FORMAT` definition, then you must use `json_array` instead of `concatenate` as the archive processor format. > 📝 **NOTE** > > Only Snowpipes with `FILE_FORMAT` `TYPE` `JSON` are currently supported. ## Snowpipe troubleshooting Snowpipe [provides](https://docs.snowflake.com/en/user-guide/data-load-snowpipe-rest-apis.html) the `insertReport` and `loadHistoryScan` REST API endpoints which can be used to get information about recent Snowpipe calls. In order to query them, you’ll first need to generate a valid JWT token for your Snowflake account. There are two methods for doing so: - Using the `snowsql` [utility](https://docs.snowflake.com/en/user-guide/snowsql.html): ```bash snowsql --private-key-path rsa_key.p8 --generate-jwt -a -u ``` - Using the Python `sql-api-generate-jwt` [utility](https://docs.snowflake.com/en/developer-guide/sql-api/authenticating.html#generating-a-jwt-in-python): ```bash python3 sql-api-generate-jwt.py --private_key_file_path=rsa_key.p8 --account= --user= ``` Once you successfully generate a JWT token and store it into the `JWT_TOKEN` environment variable, then you can, for example, query the `insertReport` endpoint using `curl`: ```bash curl -H "Authorization: Bearer ${JWT_TOKEN}" "https://.snowflakecomputing.com/v1/data/pipes/../insertReport" ``` If you need to pass in a valid `requestId` to any of these Snowpipe REST API endpoints, you can set a [uuid_v4()](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/#uuid_v4) string in a metadata field called `request_id`, log it via the [`log`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/log/) processor and then configure `request_id: ${ @request_id }` ). Alternatively, you can [enable debug logging](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/logger/about/) and Redpanda Connect will print the Request IDs that it sends to Snowpipe. ## General troubleshooting The underlying [`gosnowflake` driver](https://github.com/snowflakedb/gosnowflake) requires write access to the default directory to use for temporary files. Please consult the [`os.TempDir`](https://pkg.go.dev/os#TempDir) docs for details on how to change this directory via environment variables. A failed upload to the stage is returned as an error and the batch is not acknowledged. Older versions of the underlying [`gosnowflake` driver](https://github.com/snowflakedb/gosnowflake) could fail silently in some environments ([gosnowflake#701](https://github.com/snowflakedb/gosnowflake/issues/701)); this is no longer the case with the v2 driver, which always raises PUT errors. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). > 📝 **NOTE** > > If the service only accepts connections from allowlisted IP addresses, add your cluster’s egress addresses to its allowlist before you deploy the pipeline. On BYOC clusters, see [Allow Pipeline Traffic Through External Firewalls](https://docs.redpanda.com/cloud-data-platform/networking/connect-external-allowlist/) to find the addresses. For Dedicated or Serverless clusters, contact Redpanda support for the addresses. ### Common ```yml output: label: "" snowflake_put: account: "" # No default (required) region: "" # No default (optional) cloud: "" # No default (optional) user: "" # No default (required) password: "" # No default (optional) private_key: "" # No default (optional) private_key_file: "" # No default (optional) private_key_pass: "" # No default (optional) role: "" # No default (required) database: "" # No default (required) warehouse: "" # No default (required) schema: "" # No default (required) stage: "" # No default (required) path: "" file_name: "" file_extension: "" compression: AUTO request_id: "" snowpipe: "" # No default (optional) batching: count: 0 byte_size: 0 period: "" check: "" max_in_flight: 1 ``` ### Advanced ```yml output: label: "" snowflake_put: account: "" # No default (required) region: "" # No default (optional) cloud: "" # No default (optional) user: "" # No default (required) password: "" # No default (optional) private_key: "" # No default (optional) private_key_file: "" # No default (optional) private_key_pass: "" # No default (optional) role: "" # No default (required) database: "" # No default (required) warehouse: "" # No default (required) schema: "" # No default (required) stage: "" # No default (required) path: "" file_name: "" file_extension: "" upload_parallel_threads: 4 compression: AUTO request_id: "" snowpipe: "" # No default (optional) client_session_keep_alive: false batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) max_in_flight: 1 ``` ## Examples ### Kafka / realtime brokers Upload message batches from realtime brokers such as Kafka persisting the batch partition and offsets in the stage path and filename similarly to the [Kafka Connector scheme](https://docs.snowflake.com/en/user-guide/kafka-connector-ts.html#step-1-view-the-copy-history-for-the-table) and call Snowpipe to load them into a table. When batching is configured at the input level, it is done per-partition. ```yaml input: redpanda: seed_brokers: - localhost:9092 topics: - foo consumer_group: rpcn max_yield_batch_bytes: 8MB processors: - mapping: | meta kafka_start_offset = meta("kafka_offset").from(0) meta kafka_end_offset = meta("kafka_offset").from(-1) meta batch_timestamp = if batch_index() == 0 { now() } - mapping: | meta batch_timestamp = if batch_index() != 0 { meta("batch_timestamp").from(0) } output: snowflake_put: account: benthos user: test@benthos.dev private_key_file: path_to_ssh_key.pem role: ACCOUNTADMIN database: BENTHOS_DB warehouse: COMPUTE_WH schema: PUBLIC stage: "@%BENTHOS_TBL" path: benthos/BENTHOS_TBL/${! @kafka_partition } file_name: ${! @kafka_start_offset }_${! @kafka_end_offset }_${! meta("batch_timestamp") } upload_parallel_threads: 4 compression: NONE snowpipe: BENTHOS_PIPE ``` ### No compression Upload concatenated messages into a `.json` file to a table stage without calling Snowpipe. ```yaml output: snowflake_put: account: benthos user: test@benthos.dev private_key_file: path_to_ssh_key.pem role: ACCOUNTADMIN database: BENTHOS_DB warehouse: COMPUTE_WH schema: PUBLIC stage: "@%BENTHOS_TBL" path: benthos upload_parallel_threads: 4 compression: NONE batching: count: 10 period: 3s processors: - archive: format: concatenate ``` ### Parquet format with snappy compression Upload concatenated messages into a `.parquet` file to a table stage without calling Snowpipe. ```yaml output: snowflake_put: account: benthos user: test@benthos.dev private_key_file: path_to_ssh_key.pem role: ACCOUNTADMIN database: BENTHOS_DB warehouse: COMPUTE_WH schema: PUBLIC stage: "@%BENTHOS_TBL" path: benthos file_extension: parquet upload_parallel_threads: 4 compression: NONE batching: count: 10 period: 3s processors: - parquet_encode: schema: - name: ID type: INT64 - name: CONTENT type: BYTE_ARRAY default_compression: snappy ``` ### Automatic compression Upload concatenated messages compressed automatically into a `.gz` archive file to a table stage without calling Snowpipe. ```yaml output: snowflake_put: account: benthos user: test@benthos.dev private_key_file: path_to_ssh_key.pem role: ACCOUNTADMIN database: BENTHOS_DB warehouse: COMPUTE_WH schema: PUBLIC stage: "@%BENTHOS_TBL" path: benthos upload_parallel_threads: 4 compression: AUTO batching: count: 10 period: 3s processors: - archive: format: concatenate ``` ### DEFLATE compression Upload concatenated messages compressed into a `.deflate` archive file to a table stage and call Snowpipe to load them into a table. ```yaml output: snowflake_put: account: benthos user: test@benthos.dev private_key_file: path_to_ssh_key.pem role: ACCOUNTADMIN database: BENTHOS_DB warehouse: COMPUTE_WH schema: PUBLIC stage: "@%BENTHOS_TBL" path: benthos upload_parallel_threads: 4 compression: DEFLATE snowpipe: BENTHOS_PIPE batching: count: 10 period: 3s processors: - archive: format: concatenate - mapping: | root = content().compress("zlib") ``` ### RAW_DEFLATE compression Upload concatenated messages compressed into a `.raw_deflate` archive file to a table stage and call Snowpipe to load them into a table. ```yaml output: snowflake_put: account: benthos user: test@benthos.dev private_key_file: path_to_ssh_key.pem role: ACCOUNTADMIN database: BENTHOS_DB warehouse: COMPUTE_WH schema: PUBLIC stage: "@%BENTHOS_TBL" path: benthos upload_parallel_threads: 4 compression: RAW_DEFLATE snowpipe: BENTHOS_PIPE batching: count: 10 period: 3s processors: - archive: format: concatenate - mapping: | root = content().compress("flate") ``` ## Fields ### `account` Account name, which is the same as the [Account Identifier](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html#where-are-account-identifiers-used). However, when using an [Account Locator](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html#using-an-account-locator-as-an-identifier), the Account Identifier is formatted as `..` and this field needs to be populated using the `` part. **Type**: `string` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `client_session_keep_alive` Enable Snowflake keepalive mechanism to prevent the client session from expiring after 4 hours (error 390114). **Type**: `bool` **Default**: `false` ### `cloud` Optional cloud platform field which needs to be populated when using an [Account Locator](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html#using-an-account-locator-as-an-identifier) and it must be set to the `` part of the Account Identifier (`..`). **Type**: `string` ```yaml # Examples: cloud: aws # --- cloud: gcp # --- cloud: azure ``` ### `compression` Compression type. **Type**: `string` **Default**: `AUTO` | Option | Summary | | --- | --- | | `AUTO` | Compression (gzip) is applied automatically by the output and messages must contain plain-text JSON. Default `file_extension`: `gz`. | | `DEFLATE` | Messages must be pre-compressed using the zlib algorithm (with zlib header, RFC1950). Default `file_extension`: `deflate`. | | `GZIP` | Messages must be pre-compressed using the gzip algorithm. Default `file_extension`: `gz`. | | `NONE` | No compression is applied and messages must contain plain-text JSON. Default `file_extension`: `json`. | | `RAW_DEFLATE` | Messages must be pre-compressed using the flate algorithm (without header, RFC1951). Default `file_extension`: `raw_deflate`. | | `ZSTD` | Messages must be pre-compressed using the Zstandard algorithm. Default `file_extension`: `zst`. | ### `database` Database. **Type**: `string` ### `file_extension` Stage file extension. Will be derived from the configured `compression` if not set or empty. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ```yaml # Examples: file_extension: csv # --- file_extension: parquet ``` ### `file_name` Stage file name. Will be equal to the Request ID if not set or empty. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `max_in_flight` The maximum number of message batches to have in flight at any given time. Batches share one Snowflake connection and are uploaded one at a time, so a higher value lets batches queue but doesn’t upload them in parallel. To upload the files of a batch in parallel, use `upload_parallel_threads`. **Type**: `int` **Default**: `1` ### `password` An optional password. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `path` Stage path. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `private_key` Your private SSH key. When using encrypted keys, you must also set a value for `private_key_pass`. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `private_key_file` The path to a file containing your private SSH key. When using encrypted keys, you must also set a value for `private_key_pass`. **Type**: `string` ### `private_key_pass` The passphrase for your private SSH key. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `region` Optional region field which needs to be populated when using an [Account Locator](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html#using-an-account-locator-as-an-identifier) and it must be set to the `` part of the Account Identifier (`..`). **Type**: `string` ```yaml # Examples: region: us-west-2 ``` ### `request_id` Request ID. Will be assigned a random UUID (v4) string if not set or empty. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `role` Role. **Type**: `string` ### `schema` Schema. **Type**: `string` ### `snowpipe` An optional Snowpipe name. Use the `` part from `..`. `private_key` or `private_key_file` must be set when using this feature. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `stage` Stage name. Use either one of the [supported](https://docs.snowflake.com/en/user-guide/data-load-local-file-system-create-stage.html) stage types. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `upload_parallel_threads` Specifies the number of threads to use for uploading files. **Type**: `int` **Default**: `4` ### `user` Username. **Type**: `string` ### `warehouse` Warehouse. **Type**: `string` --- # Page 163: snowflake_streaming_pipe **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/snowflake_streaming_pipe.md --- # snowflake_streaming_pipe > 📝 **NOTE** > > If the service only accepts connections from allowlisted IP addresses, add your cluster’s egress addresses to its allowlist before you deploy the pipeline. On BYOC clusters, see [Allow Pipeline Traffic Through External Firewalls](https://docs.redpanda.com/cloud-data-platform/networking/connect-external-allowlist/) to find the addresses. For Dedicated or Serverless clusters, contact Redpanda support for the addresses. > ⚠️ **CAUTION** > > This component is in beta. Its behavior might change in a future release. Ingest data into Snowflake using Snowpipe Streaming, writing through a Snowflake pipe. Ingest data into Snowflake using Snowpipe Streaming, writing through a Snowflake pipe rather than directly into a table. Unlike `snowflake_streaming`, which opens channels on a table, this output opens them on a pipe, so any transformation defined in the pipe’s `COPY INTO` (stream-static join enrichment, `WHERE` filtering) runs before rows land. If you don’t need those, `snowflake_streaming` is the simpler choice: it creates its table for you and needs no pipe. The `pipe` (and its table) must already exist; this output never issues `CREATE PIPE` or `CREATE TABLE`. A missing pipe is reported when the output connects, before any message is written. Fields with no matching column are dropped by Snowflake unless the table has `ENABLE_SCHEMA_EVOLUTION = TRUE` and the pipe uses `MATCH_BY_COLUMN_NAME`, in which case new fields become columns. Moving an existing `snowflake_streaming` pipeline across is not a rename: several fields are removed and `commit_timeout` changes meaning. See the [migration guide](#guides:migrating-to-snowflake-streaming-pipe.adoc). ## Data types Each message is sent to Snowflake as one JSON row and Snowflake maps its fields to columns server-side; this output performs no type conversion of its own. What each column type accepts is therefore Snowflake’s rule, documented with the [high-performance architecture’s limitations](https://docs.snowflake.com/en/user-guide/snowpipe-streaming/snowpipe-streaming-high-performance-limitations). Verified against a live account: | Snowflake column type | JSON value | | --- | --- | | NUMBER, FLOAT | number, or a string holding one | | BOOLEAN | boolean | | CHAR, VARCHAR | string | | TIMESTAMP_NTZ(9), TIMESTAMP_LTZ, DATE, TIME | RFC 3339 string; nanosecond precision is kept | | VARIANT, OBJECT, ARRAY, MAP | any JSON value, including nested objects and arrays | A JSON `null` into a VARIANT column lands as a VARIANT null, not SQL NULL. GEOGRAPHY and GEOMETRY are not supported by Snowpipe Streaming. Authentication can be configured using a [RSA Key Pair](https://docs.snowflake.com/en/user-guide/key-pair-auth). ## Iceberg tables Snowflake-managed Iceberg tables are supported as a target: Snowflake writes the Iceberg files server-side, so nothing in this output is table-type-specific, and partitioned tables work through a pipe whose `COPY INTO` reads `FROM TABLE(DATA_SOURCE(TYPE ⇒ 'STREAMING'))`. Externally managed Iceberg catalogs are not supported by Snowpipe Streaming. Caveats seen on live tables: - `VARCHAR(n)` is not allowed on Iceberg tables; use `VARCHAR`. - VARIANT columns need an Iceberg v3 table (`ICEBERG_VERSION = 3`). - With server-side schema evolution, a new field holding a timestamp-like string can put the channel into `ERR_CHANNEL_SCHEMA_EVOLUTION_ICEBERG_TIME_TYPE_SCALE_NOT_SUPPORTED`. This output reports that as a permanent error naming the fix; pre-create timestamp columns with the type you want. - Each committed batch writes one file per table partition it touched, so a low-volume pipeline into a partitioned table produces many small files. Larger batches (see [Request size and throughput](#request-size-and-throughput)) and a `channel_name` per source partition help. Messages with an empty or whitespace-only body (Kafka/Redpanda tombstones, typically) are not sent: a Snowflake row has no representation for them. They are acknowledged upstream, counted in the `snowflake_empty_rows_skipped` metric and logged at debug level. If `offset_token` is set it is still evaluated for them, so use a metadata-based expression such as `${! @kafka_offset }`, not one derived from the body. To land tombstones as rows, map them with a processor first. ## Choosing a `channel_name` By default every message shares one constant channel, `..`, where `` and `` are the `database` and `schema` values in upper case and `` is the `pipe` value as written. Set `channel_name` to split that up, most commonly one channel per Kafka/Redpanda partition. **The requirement:** a channel must be written by one ordered source with at most one batch in flight. `offset_token` dedup compares each token against the channel’s single last-committed token and cannot tell "already committed by me" from "an unrelated writer got ahead of me", so two token sequences sharing a channel lose rows silently. **For a partitioned Kafka/Redpanda input**, scope the channel per partition: ```yaml channel_name: "-p${! @kafka_partition }" ``` Replace `` with the name of your Snowflake pipe, the `pipe` value. Each partition then writes through its own channel, such as `MY_PIPE-p0`. This is safe at any `max_in_flight` only if the input dispatches one batch per partition at a time. The `redpanda` input does (unless `unordered_processing.enabled` is set); `kafka_franz` and `kafka` do not by default (`checkpoint_limit` is 1024), so set `checkpoint_limit: 1` there or `max_in_flight: 1` here. If the input consumes several topics, include `${! @kafka_topic }` in the name too. Never derive the name from the host: after a rebalance the new owner would start a channel with no committed history and re-send everything. **For a single ordered stream** (Postgres logical replication, a single-partition topic): the default channel with `max_in_flight: 1` is the simple choice. It is **not** safe with `offset_token` for a partitioned source, even at `max_in_flight: 1`: each partition is its own token sequence, so whichever is numerically ahead makes the others' rows look like duplicates. The linter rejects the common form of this (`@kafka_offset` with no `@kafka_partition` in the channel name); for anything else, scope per partition or leave `offset_token` unset. **If the requirement is violated anyway**, a batch whose tokens start below the lowest token this process has already handled on the channel fails with an error naming the channel and tokens, and `snowflake_out_of_order_submissions` is incremented; the error recurs on every retry until `channel_name` or `max_in_flight` is fixed. A redelivery from a source that keeps one batch in flight per channel never trips it: such a source never goes back below where it started, however its batches are cut. The detection is one-sided and process-local: it catches a second source whose tokens lie below this process’s, but not one whose tokens lie above or between them, nor other replicas, nor anything after a restart; in those cases the rows would be dropped as duplicates with no error. Recover them from your dead-letter queue or the source; redelivery alone cannot re-insert them. > 📝 **NOTE** > > There is a limit of 10,000 streams per table — if using more than 10k streams please reach out to Snowflake support. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ## Request size and throughput Each batch is one request per channel. Request bodies are zstd-compressed by default (`compression`), and Snowflake’s 4 MB per-request limit applies to the body as sent, after compression. A batch whose body is still over the limit is sent as several requests, split by message, each with its own offset-token range, so a large batch never fails for size; only a single message over the limit on its own cannot be sent (see `tolerate_row_errors`). Typical JSON compresses 5–8×, so 16–20 MB of messages usually fits in one request, and anything under about 3.5 MB always does. Memory per in-flight batch is roughly twice the uncompressed messages (the batch and the encoded body) plus the compressed body. Watch `snowflake_compressed_output_size_bytes` against the message bytes to see your ratio. Without `offset_token`, a batch sent as several requests can be duplicated if a later request fails after an earlier one committed: the whole batch is redelivered and the committed requests are sent again, so for large at-least-once batches prefer sizes that fit one request. **With the `redpanda` input, size batches at the input**, through `max_yield_batch_bytes` (default `32KB`, far below what one request carries), rather than with an output `batching` policy: an output policy pools every partition’s messages into one request, which serialises the partitions. **A channel carries one batch at a time.** The next batch for a channel waits until the previous one has committed, so per-channel throughput is bounded by request size over commit latency (typically a few seconds in-region). Spread load across channels with a per-partition `channel_name`. Pipelining appends within a channel is planned. ### Common ```yml output: label: "" snowflake_streaming_pipe: account: "" # No default (required) user: "" # No default (required) role: "" # No default (required) database: "" # No default (required) schema: "" # No default (required) pipe: "" # No default (required) private_key: "" # No default (optional) private_key_file: "" # No default (optional) private_key_pass: "" # No default (optional) batching: count: 0 byte_size: 0 period: "" check: "" max_in_flight: 4 ``` ### Advanced ```yml output: label: "" snowflake_streaming_pipe: account: "" # No default (required) url: "" # No default (optional) account_host: "" # No default (optional) user: "" # No default (required) role: "" # No default (required) database: "" # No default (required) schema: "" # No default (required) pipe: "" # No default (required) private_key: "" # No default (optional) private_key_file: "" # No default (optional) private_key_pass: "" # No default (optional) batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) compression: zstd max_in_flight: 4 channel_name: "" # No default (optional) offset_token: "" # No default (optional) commit_timeout: 60s commit_poll_interval: 250ms request_timeout: 1m0s channel_open_retry: max_attempts: 5 initial_interval: 2s max_interval: 8s tolerate_row_errors: false ``` ## Fields ### `account` The Snowflake [Account name](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html#using-an-account-locator-as-an-identifier). Which should be formatted as `-` where `` is the name of your Snowflake organization and `` is the unique name of your account within your organization. **Type**: `string` ```yaml # Examples: account: ORG-ACCOUNT ``` ### `account_host` Override the control-plane host (default `.snowflakecomputing.com`) while keeping ingest-hostname discovery. Use this for [PrivateLink](https://docs.snowflake.com/en/user-guide/admin-security-privatelink) accounts. Ignored when `url` is set. **Type**: `string` ```yaml # Examples: account_host: my-account.privatelink.snowflakecomputing.com ``` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `channel_name` The channel to write through. Resolved per message: a batch is grouped by channel name (preserving order within each group) and each group is appended, deduplicated when `offset_token` is set, and committed separately, so batch at the input so that a batch spans as few channels as possible. Two instances writing the same channel name conflict. Defaults to a single constant channel, `..`: the `database` and `schema` values in upper case and the `pipe` value as written. See [Choosing a `channel_name`](#choosing-a-channel-name) for when that is safe and the per-partition pattern for Kafka/Redpanda inputs. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: channel_name: MYDB.PUBLIC.BETS_PIPE-p${!@kafka_partition} ``` ### `channel_open_retry` Retry schedule for opening a channel and for the pipe pre-flight at connect time. The defaults allow about 22s of backoff. A channel open blocks this output’s other channels, so keep the budget modest. **Type**: `object` ### `channel_open_retry.initial_interval` Wait before the first retry; each further retry doubles it. **Type**: `string` **Default**: `2s` ### `channel_open_retry.max_attempts` Total attempts (including the first) before failing the batch. Only HTTP 429 and the 409 open-in-progress collision are retried. **Type**: `int` **Default**: `5` ### `channel_open_retry.max_interval` Cap on the wait between retries. **Type**: `string` **Default**: `8s` ### `commit_poll_interval` How often to poll channel status while waiting for a commit (see `commit_timeout`). Under backpressure from the status endpoint the interval doubles from this value up to 4s. **Type**: `string` **Default**: `250ms` ### `commit_timeout` The maximum total time to wait for data to be committed to Snowflake before returning an error. If zero then no limit is used. **Type**: `string` **Default**: `60s` ### `compression` How to compress each request body. Snowflake’s 4 MB per-request limit applies to the payload as sent, after compression, so `zstd` (Snowflake’s recommendation) lets a request carry several times more rows than `none`. A batch whose body is still over the limit is sent as several requests, split by message; a single message whose body is over the limit on its own is treated like a row Snowflake rejected (see `tolerate_row_errors`). The bytes sent are counted in `snowflake_compressed_output_size_bytes`. **Type**: `string` **Default**: `zstd` **Options**: `zstd`, `none` ### `database` The Snowflake database to ingest data into. **Type**: `string` ```yaml # Examples: database: MY_DATABASE ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `4` ### `offset_token` The offset token used for exactly-once delivery. Each message’s token is compared to the channel’s last committed token (numerically when both are integers, otherwise byte-wise as strings); a message whose token is not newer is dropped as a duplicate. Delivery to the output must therefore be ordered, and messages within a batch must be in increasing token order; a retried batch may be dropped as duplicate if later batches succeeded meanwhile, so use a dead-letter queue for failures. Non-integer tokens **must be fixed-width** for string order to be meaningful (`0/F` sorts after `0/10`). The `@lsn` metadata from `postgres_cdc` already is; zero-pad anything you assemble yourself. If unset, nothing is deduplicated and delivery is at-least-once; a retried batch spanning several channels re-appends on every channel that already landed. **Don’t add, remove, or change this expression on a pipeline that has already written to its channels.** A channel’s tokens must stay one comparable sequence. A channel written without this field carries synthetic tokens (`~rpcn-at-least-once-`, visible as `last_committed_offset_token`) that compare newer than any real token, and a changed expression leaves new tokens judged against the old shape; this output refuses such batches where it can detect the mismatch (synthetic vs real, integer vs non-integer) and keeps refusing until you give the pipeline a fresh `channel_name`. Two different non-integer shapes cannot be told apart. A duplicate (never a loss) is possible if an append is accepted but its commit is not confirmed within `commit_timeout` and the redelivered copy is appended before the original commits; raise `commit_timeout` (0 = no limit) to close that window. For more information about offset tokens, see [^Snowflake Documentation](https://docs.snowflake.com/en/user-guide/data-load-snowpipe-streaming-overview#offset-tokens) This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: offset_token: ${! @kafka_offset } # --- offset_token: postgres-${!@lsn} ``` ### `pipe` The Snowflake pipe to ingest data into. It must already exist; a missing pipe is reported when the output connects. Unlike `database` and `schema` this value is not upper-cased, so match the stored identifier exactly (`MY_PIPE` for a pipe created as `CREATE PIPE my_pipe`). Snowflake’s managed default pipes (`
-STREAMING`) only exist once a channel has been opened on the table through the table endpoint, which this output does not use, so a default pipe fails the connect-time check with `ERR_PIPE_DOES_NOT_EXIST_OR_NOT_AUTHORIZED` until something else has created it; create a named pipe instead. **Type**: `string` ```yaml # Examples: pipe: MY_PIPE ``` ### `private_key` The PEM encoded private RSA key to use for authenticating with Snowflake. Either this or `private_key_file` must be specified. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `private_key_file` The file to load the private RSA key from. This should be a `.p8` PEM encoded file. Either this or `private_key` must be specified. **Type**: `string` ### `private_key_pass` The RSA key passphrase if the RSA key is encrypted. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `request_timeout` The timeout for a single HTTP request to Snowflake. A batch’s total wait is governed by `commit_timeout`. **Type**: `string` **Default**: `1m0s` ### `role` The role to ingest as. Every streaming call is authorized against a session token scoped to this role (not the user’s default role), so it needs the [required privileges](https://docs.snowflake.com/en/user-guide/data-load-snowpipe-streaming-overview#required-access-privileges) on the pipe and table. **Type**: `string` ```yaml # Examples: role: SNOWPIPE_STREAMING_ROLE ``` ### `schema` The Snowflake schema to ingest data into. **Type**: `string` ```yaml # Examples: schema: PUBLIC ``` ### `tolerate_row_errors` Whether to tolerate rows Snowflake rejects after a batch is appended (malformed or uncastable values, reported asynchronously in the channel status). `false` (the default, matching the Kafka Connector’s `errors.tolerance=none`) fails the batch with an error naming the channel and Snowflake’s last error; `true` only logs a warning. Either way `snowflake_rows_error_count` is incremented and this output does not retry the rejected rows: Snowflake has already refused them and the redelivery dedupes to nothing, so failing the batch exists to alert an operator. To keep the rejected rows themselves, turn on error logging on the target table and Snowflake captures them in its error table; `SNOWPIPE_STREAMING_CHANNEL_HISTORY` has the error history with offsets (see [error handling](https://docs.snowflake.com/en/user-guide/snowpipe-streaming/snowpipe-streaming-high-performance-error-handling)). When `offset_token` is unset such a rejection never fails the batch even with `false`, since without dedup a retry would only re-insert the good rows as duplicates. The same policy applies to a message this output cannot send at all: one that spans several lines but is not valid JSON (multi-line bodies are compacted to one NDJSON row each, so they must parse; a body holding several newline-separated documents becomes that many rows), or one whose body alone is over the 4 MB request limit after compression. Such a message is dropped rather than sent, and treated like a row Snowflake rejected: the batch’s good rows land, `snowflake_rows_error_count` is incremented, and with `offset_token` set and `false` the batch fails once with the message number and parse error, after which its redelivery dedupes to nothing. **Type**: `bool` **Default**: `false` ### `url` Override the URL for both the control-plane and ingest-plane connections (default `https://ORG-ACCOUNT.snowflakecomputing.com`). This skips ingest-hostname discovery, so it is for local and test deployments only. For PrivateLink or other non-standard hostnames use `account_host` instead. If both are set, this field wins. **Type**: `string` ```yaml # Examples: url: http://localhost:8080 ``` ### `user` The user to run the Snowpipe Stream as. See [Snowflake Documentation](https://docs.snowflake.com/en/user-guide/admin-user-management) on how to create a user. **Type**: `string` ## Examples ### Simple at-least-once ingestion The minimal config: no `offset_token` or `channel_name`, so rows land at-least-once through a single channel named after the pipe, whatever the input. To move to exactly-once later, add `offset_token` together with a **new** `channel_name` (see the `offset_token` field), scoped per partition if the input is partitioned. ```yaml input: generate: mapping: 'root = { "id": uuid_v4(), "amount": random_int(min: 1, max: 1000) }' interval: 1s output: snowflake_streaming_pipe: account: "MYSNOW-ACCOUNT" user: MYUSER role: SNOWPIPE_STREAMING_ROLE database: "MYDATABASE" schema: "PUBLIC" pipe: "MY_PIPE" private_key_file: "my/private/key.p8" ``` ### Exactly once CDC into Snowflake How to send data from a PostgreSQL table into Snowflake exactly once using Postgres Logical Replication. > 📝 **NOTE** > > A single ordered stream feeding the default channel, so `max_in_flight: 1` is required (see the `channel_name` field). To run at-least-once instead, remove `offset_token` (on a fresh `channel_name` if the pipeline has already run). ```yaml input: postgres_cdc: dsn: postgres://foouser:foopass@localhost:5432/foodb schema: "public" slot_name: "my_repl_slot" tables: ["my_pg_table"] # Large batches perform best. A batch over the 4 MB compressed request # limit is sent as several requests, so count only needs to fit memory. batching: count: 50000 period: 45s # One batch in flight at a time, so a retried batch never trails a newer # one into the channel. checkpoint_limit: 1 output: snowflake_streaming_pipe: # Postgres LSNs are fixed-width, so they order correctly as tokens. # Snapshot rows (stream_snapshot: true) carry no LSN; snapshot through a # separate at-least-once pipeline first. offset_token: "${!@lsn}" # Required with the default single channel; see channel_name's docs. max_in_flight: 1 account: "MYSNOW-ACCOUNT" user: MYUSER role: SNOWPIPE_STREAMING_ROLE database: "MYDATABASE" schema: "PUBLIC" pipe: "MY_PG_PIPE" private_key_file: "my/private/key.p8" ``` ### Ingesting data exactly once from Redpanda How to ingest data from Redpanda with consumer groups, decode the schema using the schema registry, then write the corresponding data into Snowflake exactly once through a pipe. > 📝 **NOTE** > > This is the pattern for any partitioned Kafka/Redpanda input: `channel_name` is scoped per partition, which is what makes exactly-once hold (see that field’s docs). To run at-least-once instead, remove `offset_token` (on a fresh `channel_name` if the pipeline has already run). ```yaml input: redpanda: topics: ["my_topic_going_to_snow"] consumer_group: "redpanda_connect_to_snowflake" # We want very large batches - each batch will be sent to Snowflake individually # so to optimize query performance we want as big of files as we have memory for fetch_max_bytes: 100MiB fetch_min_bytes: 50MiB partition_buffer_bytes: 100MiB pipeline: processors: - schema_registry_decode: url: "redpanda.example.com:8081" basic_auth: enabled: true username: MY_USER_NAME password: "${REDPANDA_SCHEMA_REGISTRY_PASSWORD}" output: fallback: - snowflake_streaming_pipe: # One channel per partition, so partitions never share a channel; # the redpanda input keeps one batch per partition in flight, which # makes this safe at any max_in_flight. channel_name: "MYDB.PUBLIC.BETS_PIPE-p${!@kafka_partition}" # No batching policy here: batch size is governed by the input's # max_yield_batch_bytes. An output policy would pool partitions into # one request and serialise them. offset_token: ${! @kafka_offset } account: "MYSNOW-ACCOUNT" user: MYUSER role: SNOWPIPE_STREAMING_ROLE database: "MYDATABASE" schema: "PUBLIC" pipe: "MYPIPE" private_key_file: "my/private/key.p8" # In order to prevent delivery orders from messing with the order of delivered records # it's important that failures are immediately sent to a dead letter queue and not retried # to Snowflake. See the ordering documentation for the "redpanda" input for more details. - retry: output: redpanda: topic: "dead_letter_queue" ``` ### HTTP Server to push data to Snowflake This example demonstrates how to create an HTTP server input that can receive HTTP PUT requests with JSON payloads, that are buffered locally then written to Snowflake in batches. > 📝 **NOTE** > > This example uses a buffer to respond to the HTTP request immediately, so it’s possible that failures to deliver data could result in data loss. See the documentation about [buffers](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/buffers/memory/) for more information, or remove the buffer entirely to respond to the HTTP request only once the data is written to Snowflake. ```yaml input: http_server: path: /snowflake buffer: memory: # Max inflight data before applying backpressure limit: 524288000 # 50MiB # Each flush is one batch. A batch over the 4 MB compressed request # limit is split into several requests, so this is a latency and # memory choice, not a hard cap. batch_policy: enabled: true byte_size: 2097152 # 2MiB period: "10s" output: snowflake_streaming_pipe: account: "MYSNOW-ACCOUNT" user: MYUSER role: SNOWPIPE_STREAMING_ROLE database: "MYDATABASE" schema: "PUBLIC" pipe: "MYPIPE" private_key_file: "my/private/key.p8" # By default there is only a single channel per output pipe allowed # if we want to have multiple Redpanda Connect streams writing data # then we need a unique channel name per stream. We'll use the host # name to get a unique name in this example. channel_name: "snowflake-channel-for-${HOST}" ``` --- # Page 164: snowflake_streaming **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/snowflake_streaming.md --- # snowflake_streaming Ingests data into Snowflake using the Snowpipe Streaming classic architecture. For more information, see the [Snowpipe Streaming classic architecture](https://docs.snowflake.com/en/user-guide/snowpipe-streaming/snowpipe-streaming-classic-overview) documentation. This output doesn’t work with the Snowpipe Streaming high-performance architecture. There is also a `snowflake_streaming_pipe` output, which writes through a Snowflake pipe rather than directly into a table — use that one if you need Snowflake’s Streaming Transformations (stream-static join enrichment, server-side `WHERE`-clause filtering), since those only exist on a pipe’s `COPY INTO` and this output has no such thing. This output remains the simpler choice if you don’t need them: it creates your destination table for you and needs no pipe set up first, neither of which `snowflake_streaming_pipe` does. See [its own docs](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/snowflake_streaming_pipe/) for the full comparison. The following table shows the [column data types supported by Snowflake](https://docs.snowflake.com/en/sql-reference/intro-summary-data-types) and the [Bloblang data types](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#type) that this output accepts for each. | Snowflake column type | Allowed format in Redpanda Connect | | --- | --- | | CHAR, VARCHAR | string | | BINARY | \[\]byte, string | | NUMBER | any numeric type, string | | FLOAT | any numeric type, including the special values `NaN`, `inf`, and `-inf`, or a string parsable as a number | | BOOLEAN | bool,any numeric type (non-zero is `true`),string parsable according to `strconv.ParseBool` | | TIME,DATE,TIMESTAMP | unix or RFC 3339 with nanoseconds timestamps | | VARIANT,ARRAY,OBJECT | any data type is converted into JSON | | GEOGRAPHY,GEOMETRY | Not supported | For TIMESTAMP, TIME and DATE columns, you can parse different string formats using a bloblang `mapping`. Authentication can be configured using a [RSA Key Pair](https://docs.snowflake.com/en/user-guide/key-pair-auth). Provide either a PEM-encoded private key in the [`private_key`](#private_key) field, or the path to a file that contains the private key in the [`private_key_file`](#private_key_file) field. There are [limitations](https://docs.snowflake.com/en/user-guide/data-load-snowpipe-streaming-overview#limitations) of what data types can be loaded into Snowflake using this method. ## Schema handling Each message becomes one row in the target table. The keys of a message object are matched to the table’s column names, and each value must match its column’s data type, otherwise the write fails with an error. When `schema_evolution.enabled` is `false`, keys that don’t match a column are ignored, and columns that a message doesn’t set are written as `null`. A message that doesn’t set a `NOT NULL` column fails. When `schema_evolution.enabled` is `true`, a key that doesn’t match a column adds a column with a data type derived from the value, unless the value is `null` and `schema_evolution.ignore_nulls` is `true` (the default). A missing value for a `NOT NULL` column drops that constraint. ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). It is recommended that each batches results in at least 16MiB of compressed output being written to Snowflake. To see how much compressed data each batch uploads, watch the rate of the `snowflake_compressed_output_size_bytes` counter. ## Metrics This output emits the following metrics: - `snowflake_compressed_output_size_bytes` (counter): The number of bytes of compressed output uploaded to Snowflake. - `snowflake_convert_latency_ns` (timer): The time taken to convert messages into Snowflake column data types. - `snowflake_serialize_latency_ns` (timer): The time taken to serialize the converted columnar data into a file for upload. - `snowflake_build_output_latency_ns` (timer): The time taken to build the file that is uploaded to Snowflake, which includes the convert and serialize time. - `snowflake_upload_latency_ns` (timer): The time taken to upload the file to Snowflake. - `snowflake_register_latency_ns` (timer): The time taken to register the uploaded file with Snowflake. - `snowflake_commit_latency_ns` (timer): The time taken to commit the uploaded data to the target table. To help you configure your own `snowflake_streaming` output, this page includes [example data pipelines](#examples). > 📝 **NOTE** > > If the service only accepts connections from allowlisted IP addresses, add your cluster’s egress addresses to its allowlist before you deploy the pipeline. On BYOC clusters, see [Allow Pipeline Traffic Through External Firewalls](https://docs.redpanda.com/cloud-data-platform/networking/connect-external-allowlist/) to find the addresses. For Dedicated or Serverless clusters, contact Redpanda support for the addresses. ### Common ```yml output: label: "" snowflake_streaming: account: "" # No default (required) user: "" # No default (required) role: "" # No default (required) database: "" # No default (required) schema: "" # No default (required) table: "" # No default (required) private_key: "" # No default (optional) private_key_file: "" # No default (optional) private_key_pass: "" # No default (optional) mapping: "" # No default (optional) init_statement: "" # No default (optional) schema_evolution: enabled: false # No default (required) batching: count: 0 byte_size: 0 period: "" check: "" max_in_flight: 4 ``` ### Advanced ```yml output: label: "" snowflake_streaming: account: "" # No default (required) url: "" # No default (optional) user: "" # No default (required) role: "" # No default (required) database: "" # No default (required) schema: "" # No default (required) table: "" # No default (required) private_key: "" # No default (optional) private_key_file: "" # No default (optional) private_key_pass: "" # No default (optional) mapping: "" # No default (optional) init_statement: "" # No default (optional) schema_evolution: enabled: false # No default (required) ignore_nulls: true processors: [] # No default (optional) build_options: parallelism: 1 chunk_size: 50000 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) max_in_flight: 4 channel_prefix: "" # No default (optional) channel_name: "" # No default (optional) offset_token: "" # No default (optional) commit_backoff: initial_interval: 32ms max_interval: 512ms max_elapsed_time: 60s multiplier: 2 message_format: object timestamp_format: 2006-01-02T15:04:05.999999999Z07:00 ``` ## Conversion of message data into Snowflake table rows Message data conversion to Snowflake table rows is determined by the: - Output message contents. - [Schema evolution settings](#schema_evolution). - Schema of the [target Snowflake table](#table). The following scenarios highlight how these three factors affect data written to the target table. > 📝 **NOTE** > > For reduced complexity, consider [turning on schema evolution](#schema_evolution), which automatically creates and updates the Snowflake table schema based on message contents. ### Scenario: Data and table schema match (schema evolution turned on or off) An output message matches the existing table schema, and the `schema_evolution.enabled` field is set to `true` or `false`. The target Snowflake table has two columns: - `product_id` (NUMBER) - `product_code` (STRING) A pipeline generates the following message: ```json {"product_id": 521, "product_code": “EST-PR”} ``` In this scenario: - The JSON keys in the message (`"product_id"` and `"product_code"`) match column names in the target Snowflake table. - The message values match the column data types. (If there was a data mismatch, the message would be rejected.) - Redpanda Connect inserts the message values into a new row in the target Snowflake table. | product_id | product_code | | --- | --- | | 521 | EST-PR | ### Scenario: Data and table schema mismatch (schema evolution turned on) An output message includes schema updates, and the `schema_evolution.enabled` field is set to `true`. The target Snowflake table has the same two columns as the [previous scenario](#scenario-data-and-table-schema-match-schema-evolution-turned-on-or-off): - `product_id` (NUMBER) - `product_code` (STRING) This time, the pipeline generates the following message: ```json {"product_batch": 11111, "product_color": “yellow”} ``` In this scenario: - The JSON keys (`"product_batch"` and `"product_color"`) do not match column names in the target Snowflake table. - As schema evolution is enabled, Redpanda Connect adds two new columns to the target table with data types derived from the output message values. For more information about the mapping of data types, see [Supported data formats for Snowflake columns](#supported-data-formats-for-snowflake-columns). - Redpanda Connect inserts the message values into a new table row. | product_id | product_code | product_batch | product_color | | --- | --- | --- | --- | | (null) | (null) | 11111 | yellow | > 📝 **NOTE** > > You can [configure processors](#schema_evolution-processors) to override the schema updates derived from the message values. ### Scenario: Data and table schema mismatch (schema evolution turned off) An output message includes schema updates, and the `schema_evolution.enabled` field is set to `false`. The target Snowflake table has the same two columns: - `product_id` (NUMBER) - `product_code` (STRING) The pipeline generates the same message as the [previous scenario](#scenario-data-and-table-schema-mismatch-schema-evolution-turned-on): ```json {"product_batch": 11111, "product_color": “yellow”} ``` In this scenario: - The JSON keys (`"product_batch"` and `"product_color"`) do not match any existing column names. - Because schema evolution is turned off, Redpanda Connect ignores the extra column names and values and inserts a row of null values. | product_id | product_code | | --- | --- | | (null) | (null) | ## Fields ### `account` The [Snowflake account name to use](https://docs.snowflake.com/en/user-guide/admin-account-identifier#account-name). Use the format `-` where: - The `` is the name of your Snowflake organization. - The `` is the unique name of your account within your Snowflake organization. To find the correct value for this field, run the following query in Snowflake: ```sql WITH HOSTLIST AS (SELECT * FROM TABLE(FLATTEN(INPUT => PARSE_JSON(SYSTEM$allowlist())))) SELECT REPLACE(VALUE:host,'.snowflakecomputing.com','') AS ACCOUNT_IDENTIFIER FROM HOSTLIST WHERE VALUE:type = 'SNOWFLAKE_DEPLOYMENT_REGIONLESS'; ``` **Type**: `string` ```yaml # Examples: account: ORG-ACCOUNT ``` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `build_options` Options for optimizing the build of the output data that is sent to Snowflake. Monitor the `snowflake_build_output_latency_ns` metric to assess whether you need to update these options. **Type**: `object` ### `build_options.chunk_size` The number of table rows to submit in each chunk for processing. **Type**: `int` **Default**: `50000` ### `build_options.parallelism` The maximum amount of parallel processing to use when building the output for Snowflake. **Type**: `int` **Default**: `1` ### `channel_name` The channel name to use when connecting to a Snowflake table. Duplicate channel names cause errors and prevent multiple instances of Redpanda Connect from writing at the same time. Redpanda Connect assumes that a message batch contains messages for a single channel, which means that interpolation is only executed on the first message in each batch. If your pipeline uses an input that is partitioned, such as an Apache Kafka topic, batch messages at the input level to make sure all messages in a batch are written to the same channel. You can specify either the `channel_name` or `channel_prefix`, but not both. If neither field is populated, this output creates a channel name based on a table’s fully-qualified name, which results in a single stream per table. > 📝 **NOTE** > > Snowflake limits the number of streams per table to 10,000. If you need to use more than 10,000 streams, contact [Snowflake support](https://www.snowflake.com/en/support/). This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: channel_name: partition-${!@kafka_partition} ``` ### `channel_prefix` The prefix to use when creating a channel name for connecting to a Snowflake table. Adding a `channel_prefix` avoids the creation of duplicate channel names, which result in errors and prevent multiple instances of Redpanda Connect from writing at the same time. You can specify either the `channel_prefix` or `channel_name`, but not both. If neither field is populated, this output creates a channel name based on a table’s fully-qualified name, which results in a single stream per table. The maximum number of channels open at any time is determined by the value in the `max_in_flight` field. > 📝 **NOTE** > > Snowflake limits the number of streams per table to 10,000. If you need to use more than 10,000 streams, contact [Snowflake support](https://www.snowflake.com/en/support/). **Type**: `string` ```yaml # Examples: channel_prefix: channel-${HOST} ``` ### `commit_backoff` Control how frequently Snowflake is polled to check if data has been committed. **Type**: `object` ### `commit_backoff.initial_interval` The initial period to wait between status polls. **Type**: `string` **Default**: `32ms` ### `commit_backoff.max_elapsed_time` The maximum total time to wait for data to be committed. If zero then no limit is used. **Type**: `string` **Default**: `60s` ### `commit_backoff.max_interval` The maximum period to wait between status polls. **Type**: `string` **Default**: `512ms` ### `commit_backoff.multiplier` The factor by which the poll interval grows on each attempt. **Type**: `float` **Default**: `2` ### `database` The Snowflake database you want to write data to. **Type**: `string` ```yaml # Examples: database: MY_DATABASE ``` ### `init_statement` Optional SQL statements to execute immediately after this output connects to Snowflake for the first time. This is a useful way to initialize tables before processing data. > 📝 **NOTE** > > Make sure your SQL statements are idempotent, so they do not cause issues when run multiple times after service restarts. **Type**: `string` ```yaml # Examples: init_statement: | CREATE TABLE IF NOT EXISTS mytable (amount NUMBER); # --- init_statement: | ALTER TABLE t1 ALTER COLUMN c1 DROP NOT NULL; ALTER TABLE t1 ADD COLUMN a2 NUMBER; ``` ### `mapping` The [Bloblang `mapping`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) to execute on each message. **Type**: `string` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `4` ### `message_format` The format to expect incoming messages from the rest of the pipeline. **Type**: `string` **Default**: `object` | Option | Summary | | --- | --- | | `array` | Messages are an array of values where the position in the array matches up the with ordinal of the column in snowflake | | `object` | Messages are an object in JSON or bloblang where the key of the object is the column name in snowflake and the value is the value for the column | ```yaml # Examples: message_format: array ``` ### `offset_token` The offset token to use for exactly-once delivery of data to a Snowflake table. This output assumes that messages within a batch are in increasing order by offset token. When data is sent on a channel, the offset token of each message in the batch is compared to the latest token processed by the channel. If the offset token is less than the latest token, it’s assumed the message is a duplicate and is dropped. Messages must be delivered to the output in order, otherwise they are processed as duplicates and dropped. Retried messages can also be seen as duplicates if later messages have succeeded in the meantime, so in most cases use a dead-letter queue to process failed messages. See the `Ingesting data exactly once from Redpanda` example. If both offset tokens parse as base-10 integers (up to 64 bits), they are compared numerically, so a bare numeric token such as `${!@kafka_offset}` does not need padding. Any other token, including numbers outside of the 64-bit integer range or a numeric value combined with a prefix or separator, falls back to a lexicographic comparison of its string representation. If you use one of these tokens, pad it so that it’s lexicographically ordered in its string representation. For more information about offset tokens, see the [Snowflake documentation](https://docs.snowflake.com/en/user-guide/data-load-snowpipe-streaming-overview#offset-tokens). This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: offset_token: offset-${!"%016X".format(@kafka_offset)} # --- offset_token: postgres-${!@lsn} ``` ### `private_key` The PEM-encoded private RSA key to use for authentication with Snowflake. You must specify a value for this field or the `private_key_file` field. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `private_key_file` A `.p8`, PEM-encoded file to load the private RSA key from. You must specify a value for this field or the `private_key` field. **Type**: `string` ### `private_key_pass` If the RSA key is encrypted, specify the RSA key passphrase. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `role` The role of the user specified in the `user` field. The user’s role must have the [required privileges](https://docs.snowflake.com/en/user-guide/snowpipe-streaming/snowpipe-streaming-classic-configuration#authentication-and-authorization) to call the Snowpipe Streaming APIs. For more information about user roles, see the [Snowflake documentation](https://docs.snowflake.com/en/user-guide/admin-user-management#user-roles). **Type**: `string` ```yaml # Examples: role: ACCOUNTADMIN ``` ### `schema` The schema of the Snowflake database you want to write data to. **Type**: `string` ```yaml # Examples: schema: PUBLIC ``` ### `schema_evolution` Options to control schema updates when messages are written to the Snowflake table, such as adding columns as new fields appear in messages. **Type**: `object` ### `schema_evolution.enabled` Whether schema evolution is enabled. When set to `true`, the Snowflake table is automatically created based on the schema of the first message written to it, if the table does not already exist. As new fields are added to subsequent messages in the pipeline, new columns are created in the Snowflake table. Any required columns are marked as `nullable` if new messages do not include data for them. **Type**: `bool` ### `schema_evolution.ignore_nulls` When set to `true` and schema evolution is enabled, new columns that have `null` values _are not_ added to the Snowflake table and do not trigger schema evolution. When set to `false`, `null` columns trigger schema migrations in Snowflake. Ignoring `null` values: - Prevents unnecessary schema changes caused by placeholder or incomplete data. - Avoids creating table columns with incorrect data types. > 📝 **NOTE** > > Redpanda does not recommend changing the default setting (`true`) unless you know the data type of `null` columns in advance. **Type**: `bool` **Default**: `true` ### `schema_evolution.processors[]` A series of processors to execute when new columns are added to the Snowflake table. You can use these processors to: - Run side effects when the schema evolves. - Enrich the message with additional information to guide the schema changes. For example, a processor could read the schema from the schema registry that a message was produced with. It could then use that schema to determine the data type of the new column in Snowflake. The input to these processors is an object with the value and name of the new column, the original message, and details of the Snowflake table the output writes to. The metadata remains the same as in the original message that triggered the schema update. For example: `{"value": 42.3, "name":"new_data_field", "message": {"existing_data_field": 42, "new_data_field": "foo"}, "db": "MY_DATABASE", "schema": "MY_SCHEMA", "table": "MY_TABLE"}` The output from the processors must be a single message that contains a string specifying the column data type to use, such as `FLOAT`, `VARIANT`, or `NUMBER(38, 0)`. The output then runs an `ALTER TABLE` statement on the Snowflake table to add the column with the corresponding data type. **Type**: `array` ```yaml # Examples: processors: - mapping: |- root = match this.value.type() { this == "string" => "STRING" this == "bytes" => "BINARY" this == "number" => "DOUBLE" this == "bool" => "BOOLEAN" this == "timestamp" => "TIMESTAMP" _ => "VARIANT" } ``` ### `table` The Snowflake table you want to write data to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: table: MY_TABLE ``` ### `timestamp_format` The format to parse string values for `TIMESTAMP`, `TIMESTAMP_LTZ` and `TIMESTAMP_NTZ` columns. Should be a layout for [time.Parse](https://pkg.go.dev/time#Parse) in Go. **Type**: `string` **Default**: `2006-01-02T15:04:05.999999999Z07:00` ### `url` Specify a custom URL to connect to Snowflake. This parameter overrides the default URL, which is generated from the value of the `account` field: `https://.snowflakecomputing.com`. **Type**: `string` ```yaml # Examples: url: https://org-account.privatelink.snowflakecomputing.com ``` ### `user` Specify a user to run the Snowpipe Stream. To learn how to create a user, see the [Snowflake documentation](https://docs.snowflake.com/en/user-guide/admin-user-management). **Type**: `string` ## Examples ### Exactly once CDC into Snowflake How to send data from a PostgreSQL table into Snowflake exactly once using Postgres Logical Replication. > 📝 **NOTE** > > If attempting to do exactly-once it’s important that rows are delivered in order to the output. Be sure to read the documentation for offset_token first. Removing the offset_token is a safer option that will instruct Redpanda Connect to use its default at-least-once delivery model instead. ```yaml input: postgres_cdc: dsn: postgres://foouser:foopass@localhost:5432/foodb schema: "public" slot_name: "my_repl_slot" tables: ["my_pg_table"] # We want very large batches - each batch will be sent to Snowflake individually # so to optimize query performance we want as big of files as we have memory for batching: count: 50000 period: 45s # Prevent multiple batches from being in flight at once, so that we never send # a batch while another batch is being retried, this is important to ensure that # the Snowflake Snowpipe Streaming channel does not see older data - as it will # assume that the older data is already committed. checkpoint_limit: 1 output: snowflake_streaming: # We use the log sequence number in the WAL from Postgres to ensure we # only upload data exactly once, these are already lexicographically # ordered. offset_token: "${!@lsn}" # Since we're sending a single ordered log, we can only send one thing # at a time to ensure that we're properly incrementing our offset_token # and only using a single channel at a time. max_in_flight: 1 account: "MYSNOW-ACCOUNT" user: MYUSER role: ACCOUNTADMIN database: "MYDATABASE" schema: "PUBLIC" table: "MY_PG_TABLE" private_key_file: "my/private/key.p8" ``` ### Ingesting data exactly once from Redpanda How to ingest data from Redpanda with consumer groups, decode the schema using the schema registry, then write the corresponding data into Snowflake exactly once. > 📝 **NOTE** > > If attempting to do exactly-once it’s important that records are delivered in order to the output and correctly partitioned. Be sure to read the documentation for `channel_name` and `offset_token` first. Removing the `offset_token` is a safer option that will instruct Redpanda Connect to use its default at-least-once delivery model instead. ```yaml input: redpanda: topics: ["my_topic_going_to_snow"] consumer_group: "redpanda_connect_to_snowflake" # We want very large batches - each batch will be sent to Snowflake individually # so to optimize query performance we want as big of files as we have memory for fetch_max_bytes: 100MiB fetch_min_bytes: 50MiB partition_buffer_bytes: 100MiB pipeline: processors: - schema_registry_decode: url: "redpanda.example.com:8081" basic_auth: enabled: true username: MY_USER_NAME password: "${TODO}" output: fallback: - snowflake_streaming: # To ensure that we write an ordered stream each partition in kafka gets its own # channel. channel_name: "partition-${!@kafka_partition}" # Ensure that our offsets are lexicographically sorted in string form by padding with # leading zeros offset_token: offset-${!"%016X".format(@kafka_offset)} account: "MYSNOW-ACCOUNT" user: MYUSER role: ACCOUNTADMIN database: "MYDATABASE" schema: "PUBLIC" table: "MYTABLE" private_key_file: "my/private/key.p8" schema_evolution: enabled: true # In order to prevent delivery orders from messing with the order of delivered records # it's important that failures are immediately sent to a dead letter queue and not retried # to Snowflake. See the ordering documentation for the "redpanda" input for more details. - retry: output: redpanda: topic: "dead_letter_queue" ``` ### HTTP Server to push data to Snowflake This example demonstrates how to create an HTTP server input that can receive HTTP PUT requests with JSON payloads, that are buffered locally then written to Snowflake in batches. > 📝 **NOTE** > > This example uses a buffer to respond to the HTTP request immediately, so it’s possible that failures to deliver data could result in data loss. See the documentation about [buffers](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/buffers/memory/) for more information, or remove the buffer entirely to respond to the HTTP request only once the data is written to Snowflake. ```yaml input: http_server: path: /snowflake buffer: memory: # Max inflight data before applying backpressure limit: 524288000 # 50MiB # Batching policy, influences how large the generated files sent to Snowflake are batch_policy: enabled: true byte_size: 33554432 # 32MiB period: "10s" output: snowflake_streaming: account: "MYSNOW-ACCOUNT" user: MYUSER role: ACCOUNTADMIN database: "MYDATABASE" schema: "PUBLIC" table: "MYTABLE" private_key_file: "my/private/key.p8" # By default there is only a single channel per output table allowed # if we want to have multiple Redpanda Connect streams writing data # then we need a unique channel prefix per stream. We'll use the host # name to get unique prefixes in this example. channel_prefix: "snowflake-channel-for-${HOST}" schema_evolution: enabled: true ``` See also: [Ingest data into Snowflake cookbook](https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/snowflake_ingestion/) --- # Page 165: splunk_hec **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/splunk_hec.md --- # splunk_hec Publishes messages to a Splunk HTTP Endpoint Collector (HEC). ## Performance This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`. This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). ### Common ```yml output: label: "" splunk_hec: url: "" # No default (required) token: "" # No default (required) gzip: false event_host: "" # No default (optional) event_source: "" # No default (optional) event_sourcetype: "" # No default (optional) event_index: "" # No default (optional) max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` ### Advanced ```yml output: label: "" splunk_hec: url: "" # No default (required) token: "" # No default (required) gzip: false event_host: "" # No default (optional) event_source: "" # No default (optional) event_sourcetype: "" # No default (optional) event_index: "" # No default (optional) tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Fields ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `event_host` Set the host value to assign to the event data. Overrides existing host field if present. **Type**: `string` ### `event_index` Set the index value to assign to the event data. Overrides existing index field if present. **Type**: `string` ### `event_source` Set the source value to assign to the event data. Overrides existing source field if present. **Type**: `string` ### `event_sourcetype` Set the sourcetype value to assign to the event data. Overrides existing sourcetype field if present. **Type**: `string` ### `gzip` Enable gzip compression **Type**: `bool` **Default**: `false` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `token` A bot token used for authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `url` Full HTTP Endpoint Collector (HEC) URL. **Type**: `string` ```yaml # Examples: url: https://foobar.splunkcloud.com/services/collector/event ``` --- # Page 166: sql_insert **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/sql_insert.md --- # sql_insert Inserts a row into an SQL database for each message. #### Common ```yml output: label: "" sql_insert: driver: mysql # No default (required) dsn: "" # No default (required) table: "" # No default (required) columns: [] # No default (required) args_mapping: "" # No default (required) max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` #### Advanced ```yml output: label: "" sql_insert: driver: mysql # No default (required) dsn: "" # No default (required) table: "" # No default (required) columns: [] # No default (required) args_mapping: "" # No default (required) prefix: "" # No default (optional) suffix: "" # No default (optional) options: [] # No default (optional) max_in_flight: 64 init_files: [] # No default (optional) init_statement: "" # No default (optional) conn_max_idle_time: "" # No default (optional) conn_max_life_time: "" # No default (optional) conn_max_idle: 2 conn_max_open: 0 # No default (optional) batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Examples ### Table Insert (MySQL) Here we insert rows into a database by populating the columns id, name and topic with values extracted from messages and metadata: ```yaml output: sql_insert: driver: mysql dsn: foouser:foopassword@tcp(localhost:3306)/foodb table: footable columns: [ id, name, topic ] args_mapping: | root = [ this.user.id, this.user.name, meta("kafka_topic"), ] ``` ## Dynamic SQL operations The `table` and `columns` fields are static strings that do not support Bloblang interpolation. For dynamic table names, dynamic column lists, DELETE operations, or any other SQL that `sql_insert` cannot express, use the [`sql_raw` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/sql_raw/) instead. There is no dedicated `sql_delete` output. To delete rows, use `sql_raw` with a DELETE statement: ```yaml output: sql_raw: driver: postgres dsn: postgres://user:pass@localhost:5432/mydb?sslmode=disable query: "DELETE FROM my_table WHERE id = $1" args_mapping: root = [ this.id ] ``` To insert into a table determined at runtime, use `sql_raw` with `unsafe_dynamic_query: true`, which enables Bloblang interpolation in the `query` field. > ⚠️ **CAUTION** > > Interpolating user-supplied values into a query can introduce SQL injection risks. Always validate or sanitize the interpolated value beforehand. ```yaml output: sql_raw: driver: postgres dsn: postgres://user:pass@localhost:5432/mydb?sslmode=disable unsafe_dynamic_query: true query: 'INSERT INTO ${! this.table_name } (id, value) VALUES ($1, $2)' args_mapping: root = [ this.id, this.value ] ``` ## Fields ### `args_mapping` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) which should evaluate to an array of values matching in size to the number of columns specified. **Type**: `string` ```yaml # Examples: args_mapping: root = [ this.cat.meow, this.doc.woofs[0] ] # --- args_mapping: root = [ meta("user.id") ] ``` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `columns[]` A list of columns to insert. **Type**: `array` ```yaml # Examples: columns: - foo - bar - baz ``` ### `conn_max_idle` An optional maximum number of connections in the idle connection pool. If conn_max_open is greater than 0 but less than the new conn_max_idle, then the new conn_max_idle will be reduced to match the conn_max_open limit. If `value ⇐ 0`, no idle connections are retained. The default max idle connections is currently 2. This may change in a future release. **Type**: `int` **Default**: `2` ### `conn_max_idle_time` An optional maximum amount of time a connection may be idle. Expired connections may be closed lazily before reuse. If `value ⇐ 0`, connections are not closed due to a connections idle time. **Type**: `string` ### `conn_max_life_time` An optional maximum amount of time a connection may be reused. Expired connections may be closed lazily before reuse. If `value ⇐ 0`, connections are not closed due to a connections age. **Type**: `string` ### `conn_max_open` An optional maximum number of open connections to the database. If conn_max_idle is greater than 0 and the new conn_max_open is less than conn_max_idle, then conn_max_idle will be reduced to match the new conn_max_open limit. If `value ⇐ 0`, then there is no limit on the number of open connections. The default is 0 (unlimited). **Type**: `int` ### `driver` The database driver to use. **Type**: `string` **Options**: `mysql`, `postgres`, `pgx`, `clickhouse`, `mssql`, `sqlite`, `oracle`, `snowflake`, `trino`, `gocosmos`, `spanner`, `databricks`, `hana` ### `dsn` A Data Source Name to identify the target database. #### Drivers The following table lists the supported drivers and their DSN formats: | Driver | Data Source Name Format | | --- | --- | | `clickhouse` | [`clickhouse://[username[:password]@][netloc][:port]/dbname[?param1=value1&…​¶mN=valueN]`](https://github.com/ClickHouse/clickhouse-go#dsn) | | `mysql` | `[username[:password]@][protocol[(address)]]/dbname[?param1=value1&…​¶mN=valueN]` | | `postgres` and `pgx` | `postgres://[user[:password]@][netloc][:port][/dbname][?param1=value1&…​]` | | `mssql` | `sqlserver://[user[:password]@][netloc][:port][?database=dbname¶m1=value1&…​]` | | `sqlite` | `file:/path/to/filename.db[?param&=value1&…​]` | | `oracle` | `oracle://[username[:password]@][netloc][:port]/service_name?server=server2&server=server3` | | `snowflake` | `username[:password]@account_identifier/dbname/schemaname[?param1=value&…​¶mN=valueN]` | | `trino` | [`http[s]://user[:pass]@host[:port][?parameters]`](https://github.com/trinodb/trino-go-client#dsn-data-source-name) | | `gocosmos` | [`AccountEndpoint=;AccountKey=[;TimeoutMs=][;Version=][;DefaultDb/Db=][;AutoId=][;InsecureSkipVerify=]`](https://pkg.go.dev/github.com/microsoft/gocosmos#readme-example-usage) | | `spanner` | projects/\[PROJECT\]/instances/\[INSTANCE\]/databases/\[DATABASE\] | | `databricks` | `token:@:/` | | `hana` | `hdb://[user[:password]@]host[:port][?param1=value1&…​]` | Please note that the `postgres` and `pgx` drivers enforce SSL by default, you can override this with the parameter `sslmode=disable` if required. The `pgx` driver is an alternative to the standard `postgres` (pq) driver and comes with extra functionality such as support for array insertion. The `snowflake` driver supports multiple DSN formats. Please consult [the docs](https://pkg.go.dev/github.com/snowflakedb/gosnowflake/v2#hdr-Connection_String) for more details. For [key pair authentication](https://docs.snowflake.com/en/user-guide/key-pair-auth.html#configuring-key-pair-authentication), the DSN has the following format: `@//?warehouse=&role=&authenticator=snowflake_jwt&privateKey=`, where the value for the `privateKey` parameter can be constructed from an unencrypted RSA private key file `rsa_key.p8` using `openssl enc -d -base64 -in rsa_key.p8 | basenc --base64url -w0` (you can use `gbasenc` instead of `basenc` on OSX if you install `coreutils` via Homebrew). If you have a password-encrypted private key, you can decrypt it using `openssl pkcs8 -in rsa_key_encrypted.p8 -out rsa_key.p8`. Also, make sure fields such as the username are URL-encoded. The [`gocosmos`](https://pkg.go.dev/github.com/microsoft/gocosmos) driver is still experimental, but it has support for [hierarchical partition keys](https://learn.microsoft.com/en-us/azure/cosmos-db/hierarchical-partition-keys) as well as [cross-partition queries](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-query-container#cross-partition-query). Please refer to the [SQL notes](https://github.com/microsoft/gocosmos/blob/main/SQL.md) for details. **Type**: `string` ```yaml # Examples: dsn: clickhouse://username:password@host1:9000,host2:9000/database?dial_timeout=200ms&max_execution_time=60 # --- dsn: foouser:foopassword@tcp(localhost:3306)/foodb # --- dsn: postgres://foouser:foopass@localhost:5432/foodb?sslmode=disable # --- dsn: oracle://foouser:foopass@localhost:1521/service_name # --- dsn: token:dapi1234567890ab@dbc-a1b2345c-d6e7.cloud.databricks.com:443/sql/1.0/warehouses/abc123def456 ``` ### `init_files[]` An optional list of file paths containing SQL statements to execute immediately upon the first connection to the target database. This is a useful way to initialise tables before processing data. Glob patterns are supported, including super globs (double star). Care should be taken to ensure that the statements are idempotent, and therefore would not cause issues when run multiple times after service restarts. If both `init_statement` and `init_files` are specified the `init_statement` is executed _after_ the `init_files`. If a statement fails for any reason a warning log will be emitted but the operation of this component will not be stopped. **Type**: `array` ```yaml # Examples: init_files: - ./init/*.sql # --- init_files: - ./foo.sql - ./bar.sql ``` ### `init_statement` An optional SQL statement to execute immediately upon the first connection to the target database. This is a useful way to initialise tables before processing data. Care should be taken to ensure that the statement is idempotent, and therefore would not cause issues when run multiple times after service restarts. If both `init_statement` and `init_files` are specified the `init_statement` is executed _after_ the `init_files`. If the statement fails for any reason a warning log will be emitted but the operation of this component will not be stopped. **Type**: `string` ```yaml # Examples: init_statement: | CREATE TABLE IF NOT EXISTS some_table ( foo varchar(50) not null, bar integer, baz varchar(50), primary key (foo) ) WITHOUT ROWID; ``` ### `max_in_flight` The maximum number of message batches to write in parallel. **Type**: `int` **Default**: `64` ### `options[]` A list of keyword options to add before the INTO clause of the query. **Type**: `array` ```yaml # Examples: options: - DELAYED - IGNORE ``` ### `prefix` An optional prefix to prepend to the insert query (before INSERT). **Type**: `string` ### `suffix` An optional suffix to append to the insert query. **Type**: `string` ```yaml # Examples: suffix: ON CONFLICT (name) DO NOTHING ``` ### `table` The table to insert to. **Type**: `string` ```yaml # Examples: table: foo ``` --- # Page 167: sql_raw **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/sql_raw.md --- # sql_raw Executes an arbitrary SQL query for each message. When multiple queries are configured, all messages within a batch are executed in a single database transaction. Single-query configurations execute each message individually without a transaction, preserving per-message error granularity. When consuming from Kafka, messages are automatically ordered by partition within the transaction, allowing `max_in_flight` > 1 to parallelize across partitions while preserving consume order within each partition. Messages without `kafka_partition` metadata default to partition 0. #### Common ```yml output: label: "" sql_raw: driver: mysql # No default (required) dsn: "" # No default (required) query: "" # No default (optional) args_mapping: "" # No default (optional) queries: [] # No default (optional) max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` #### Advanced ```yml output: label: "" sql_raw: driver: mysql # No default (required) dsn: "" # No default (required) query: "" # No default (optional) unsafe_dynamic_query: false args_mapping: "" # No default (optional) queries: [] # No default (optional) max_in_flight: 64 init_files: [] # No default (optional) init_statement: "" # No default (optional) conn_max_idle_time: "" # No default (optional) conn_max_life_time: "" # No default (optional) conn_max_idle: 2 conn_max_open: 0 # No default (optional) batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` For some scenarios where you might use this output, see [Examples](#examples). ## Batch execution and ordered writes Configure a `batching` policy to accumulate messages and write them together. When you set more than one query (see [Conditional queries](#conditional-queries)), all messages in a batch run in a single database transaction, which reduces round-trips to the database. A single-query configuration runs each message individually without a transaction, preserving per-message error granularity. When consuming from Redpanda or Kafka, this output orders messages by partition within the transaction. This lets you raise `max_in_flight` above `1` to parallelize writes across partitions while preserving consume order within each partition, so you can scale throughput without breaking change-data-capture ordering. Messages without a `kafka_partition` metadata field are treated as partition `0`. This makes `sql_raw` suitable for high-throughput sink pipelines, including CDC, that previously required `max_in_flight: 1` to stay ordered. ## Conditional queries Use the `queries` field to route each message to a different SQL statement based on its content or metadata, without a preprocessing `mapping` step or `unsafe_dynamic_query`. Set a `when` condition (a Bloblang expression) on each entry: the first query whose `when` evaluates to `true`, or the first query with no `when`, runs for that message. If none of your queries have a `when` condition, every query runs for each message within the same transaction. Because an unconditioned query always matches, Redpanda Connect lints against configuring one before later queries in the list. For example, route change-data-capture tombstones to a `DELETE` and everything else to an upsert: ```yaml output: sql_raw: driver: postgres dsn: "${DSN}" max_in_flight: 8 batching: count: 100 period: 100ms queries: - when: 'root = meta("kafka_tombstone_message") == "true"' query: 'DELETE FROM orders WHERE id = $1' args_mapping: 'root = [ meta("kafka_key").parse_json().id ]' - query: | INSERT INTO orders (id, name, updated_at) VALUES ($1, $2, $3) ON CONFLICT (id) DO UPDATE SET name = EXCLUDED.name, updated_at = EXCLUDED.updated_at args_mapping: 'root = [ this.id, this.name, this.updated_at ]' ``` ## Fields ### `args_mapping` An optional [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that includes the same number of values in an array as the placeholder arguments in the `query` field. **Type**: `string` ```yaml # Examples: args_mapping: root = [ this.cat.meow, this.doc.woofs[0] ] # --- args_mapping: root = [ meta("user.id") ] ``` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `conn_max_idle` An optional maximum number of connections in the idle connection pool. If conn_max_open is greater than 0 but less than the new conn_max_idle, then the new conn_max_idle will be reduced to match the conn_max_open limit. If `value ⇐ 0`, no idle connections are retained. The default max idle connections is currently 2. This may change in a future release. **Type**: `int` **Default**: `2` ### `conn_max_idle_time` An optional maximum amount of time a connection may be idle. Expired connections may be closed lazily before reuse. If `value ⇐ 0`, connections are not closed due to a connections idle time. **Type**: `string` ### `conn_max_life_time` An optional maximum amount of time a connection may be reused. Expired connections may be closed lazily before reuse. If `value ⇐ 0`, connections are not closed due to a connections age. **Type**: `string` ### `conn_max_open` An optional maximum number of open connections to the database. If conn_max_idle is greater than 0 and the new conn_max_open is less than conn_max_idle, then conn_max_idle will be reduced to match the new conn_max_open limit. If `value ⇐ 0`, then there is no limit on the number of open connections. The default is 0 (unlimited). **Type**: `int` ### `driver` The database driver to use. **Type**: `string` **Options**: `mysql`, `postgres`, `pgx`, `clickhouse`, `mssql`, `sqlite`, `oracle`, `snowflake`, `trino`, `gocosmos`, `spanner`, `databricks`, `hana` ### `dsn` A Data Source Name to identify the target database. #### Drivers The following table lists the supported drivers and their DSN formats: | Driver | Data Source Name Format | | --- | --- | | `clickhouse` | [`clickhouse://[username[:password]@][netloc][:port]/dbname[?param1=value1&…​¶mN=valueN]`](https://github.com/ClickHouse/clickhouse-go#dsn) | | `mysql` | `[username[:password]@][protocol[(address)]]/dbname[?param1=value1&…​¶mN=valueN]` | | `postgres` and `pgx` | `postgres://[user[:password]@][netloc][:port][/dbname][?param1=value1&…​]` | | `mssql` | `sqlserver://[user[:password]@][netloc][:port][?database=dbname¶m1=value1&…​]` | | `sqlite` | `file:/path/to/filename.db[?param&=value1&…​]` | | `oracle` | `oracle://[username[:password]@][netloc][:port]/service_name?server=server2&server=server3` | | `snowflake` | `username[:password]@account_identifier/dbname/schemaname[?param1=value&…​¶mN=valueN]` | | `trino` | [`http[s]://user[:pass]@host[:port][?parameters]`](https://github.com/trinodb/trino-go-client#dsn-data-source-name) | | `gocosmos` | [`AccountEndpoint=;AccountKey=[;TimeoutMs=][;Version=][;DefaultDb/Db=][;AutoId=][;InsecureSkipVerify=]`](https://pkg.go.dev/github.com/microsoft/gocosmos#readme-example-usage) | | `spanner` | projects/\[PROJECT\]/instances/\[INSTANCE\]/databases/\[DATABASE\] | | `databricks` | `token:@:/` | | `hana` | `hdb://[user[:password]@]host[:port][?param1=value1&…​]` | Please note that the `postgres` and `pgx` drivers enforce SSL by default, you can override this with the parameter `sslmode=disable` if required. The `pgx` driver is an alternative to the standard `postgres` (pq) driver and comes with extra functionality such as support for array insertion. The `snowflake` driver supports multiple DSN formats. Please consult [the docs](https://pkg.go.dev/github.com/snowflakedb/gosnowflake/v2#hdr-Connection_String) for more details. For [key pair authentication](https://docs.snowflake.com/en/user-guide/key-pair-auth.html#configuring-key-pair-authentication), the DSN has the following format: `@//?warehouse=&role=&authenticator=snowflake_jwt&privateKey=`, where the value for the `privateKey` parameter can be constructed from an unencrypted RSA private key file `rsa_key.p8` using `openssl enc -d -base64 -in rsa_key.p8 | basenc --base64url -w0` (you can use `gbasenc` instead of `basenc` on OSX if you install `coreutils` via Homebrew). If you have a password-encrypted private key, you can decrypt it using `openssl pkcs8 -in rsa_key_encrypted.p8 -out rsa_key.p8`. Also, make sure fields such as the username are URL-encoded. The [`gocosmos`](https://pkg.go.dev/github.com/microsoft/gocosmos) driver is still experimental, but it has support for [hierarchical partition keys](https://learn.microsoft.com/en-us/azure/cosmos-db/hierarchical-partition-keys) as well as [cross-partition queries](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-query-container#cross-partition-query). Please refer to the [SQL notes](https://github.com/microsoft/gocosmos/blob/main/SQL.md) for details. **Type**: `string` ```yaml # Examples: dsn: clickhouse://username:password@host1:9000,host2:9000/database?dial_timeout=200ms&max_execution_time=60 # --- dsn: foouser:foopassword@tcp(localhost:3306)/foodb # --- dsn: postgres://foouser:foopass@localhost:5432/foodb?sslmode=disable # --- dsn: oracle://foouser:foopass@localhost:1521/service_name # --- dsn: token:dapi1234567890ab@dbc-a1b2345c-d6e7.cloud.databricks.com:443/sql/1.0/warehouses/abc123def456 ``` ### `init_files[]` An optional list of file paths containing SQL statements to execute immediately upon the first connection to the target database. This is a useful way to initialise tables before processing data. Glob patterns are supported, including super globs (double star). Care should be taken to ensure that the statements are idempotent, and therefore would not cause issues when run multiple times after service restarts. If both `init_statement` and `init_files` are specified the `init_statement` is executed _after_ the `init_files`. If a statement fails for any reason a warning log will be emitted but the operation of this component will not be stopped. **Type**: `array` ```yaml # Examples: init_files: - ./init/*.sql # --- init_files: - ./foo.sql - ./bar.sql ``` ### `init_statement` An optional SQL statement to execute immediately upon the first connection to the target database. This is a useful way to initialise tables before processing data. Care should be taken to ensure that the statement is idempotent, and therefore would not cause issues when run multiple times after service restarts. If both `init_statement` and `init_files` are specified the `init_statement` is executed _after_ the `init_files`. If the statement fails for any reason a warning log will be emitted but the operation of this component will not be stopped. **Type**: `string` ```yaml # Examples: init_statement: | CREATE TABLE IF NOT EXISTS some_table ( foo varchar(50) not null, bar integer, baz varchar(50), primary key (foo) ) WITHOUT ROWID; ``` ### `max_in_flight` The maximum number of batches to send in parallel at any given time. When multiple queries are configured and you consume from Redpanda or Kafka, messages are ordered by partition within each transaction, so you can keep this above `1` to parallelize writes across partitions while preserving consume order within each partition. Messages without a `kafka_partition` metadata field are treated as partition `0`. **Type**: `int` **Default**: `64` ### `queries[]` A list of database statements to run in addition to the main `query`. When a `when` condition is specified on entries, the first query whose condition evaluates to `true` (or that has no condition) is executed for each message. When no `when` conditions are present, all queries are executed for each message within a single transaction. **Type**: `array` ### `queries[].args_mapping` An optional [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that includes the same number of values in an array as the placeholder arguments in the `query` field. **Type**: `string` ```yaml # Examples: args_mapping: root = [ this.cat.meow, this.doc.woofs[0] ] # --- args_mapping: root = [ meta("user.id") ] ``` ### `queries[].query` The query to execute. You must include the correct placeholders for the specified database driver. Some drivers use question marks (`?`), whereas others expect incrementing dollar signs (`$1`, `$2`, and so on) or colons (`:1`, `:2`, and so on). The following table shows the placeholder style for each driver: | Driver | Placeholder style | | --- | --- | | `clickhouse` | Dollar sign (`$`) | | `gocosmos` | Colon (`:`) | | `hana` | Question mark (`?`) | | `mssql` | Question mark (`?`) | | `mysql` | Question mark (`?`) | | `oracle` | Colon (`:`) | | `pgx` | Dollar sign (`$`) | | `postgres` | Dollar sign (`$`) | | `snowflake` | Question mark (`?`) | | `spanner` | Question mark (`?`) | | `sqlite` | Question mark (`?`) | | `trino` | Question mark (`?`) | **Type**: `string` ### `queries[].when` An optional [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that, when set, is evaluated for each message to determine whether to execute this query. The mapping should return a boolean value. The first query in the list whose `when` condition evaluates to `true` (or that has no `when` condition) is executed. This enables conditional query routing based on message content or metadata without requiring `unsafe_dynamic_query`. **Type**: `string` ```yaml # Examples: when: root = meta("kafka_tombstone_message") == "true" # --- when: root = this.operation == "delete" ``` ### `query` The query to execute. You must include the correct placeholders for the specified database driver. Some drivers use question marks (`?`), whereas others expect incrementing dollar signs (`$1`, `$2`, and so on) or colons (`:1`, `:2`, and so on). The following table shows the placeholder style for each driver: | Driver | Placeholder style | | --- | --- | | `clickhouse` | Dollar sign (`$`) | | `gocosmos` | Colon (`:`) | | `hana` | Question mark (`?`) | | `mssql` | Question mark (`?`) | | `mysql` | Question mark (`?`) | | `oracle` | Colon (`:`) | | `pgx` | Dollar sign (`$`) | | `postgres` | Dollar sign (`$`) | | `snowflake` | Question mark (`?`) | | `spanner` | Question mark (`?`) | | `sqlite` | Question mark (`?`) | | `trino` | Question mark (`?`) | **Type**: `string` ```yaml # Examples: query: INSERT INTO footable (foo, bar, baz) VALUES (?, ?, ?); ``` ### `unsafe_dynamic_query` Whether to enable [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries) in the query. Make sure your queries are defended against injection attacks. **Type**: `bool` **Default**: `false` ## Examples ### Table Insert (MySQL) Here we insert rows into a database by populating the columns id, name and topic with values extracted from messages and metadata: ```yaml output: sql_raw: driver: mysql dsn: foouser:foopassword@tcp(localhost:3306)/foodb query: "INSERT INTO footable (id, name, topic) VALUES (?, ?, ?);" args_mapping: | root = [ this.user.id, this.user.name, meta("kafka_topic"), ] ``` ### Dynamically Creating Tables (PostgreSQL) Here we dynamically create output tables transactionally with inserting a record into the newly created table. ```yaml output: processors: - mapping: | root = this # Prevent SQL injection when using unsafe_dynamic_query meta table_name = "\"" + metadata("table_name").replace_all("\"", "\"\"") + "\"" sql_raw: driver: postgres dsn: postgres://localhost/postgres unsafe_dynamic_query: true queries: - query: | CREATE TABLE IF NOT EXISTS ${!metadata("table_name")} (id varchar primary key, document jsonb); - query: | INSERT INTO ${!metadata("table_name")} (id, document) VALUES ($1, $2) ON CONFLICT (id) DO UPDATE SET document = EXCLUDED.document; args_mapping: | root = [ this.id, this.document.string() ] ``` ### Conditional CDC Queries (PostgreSQL) Route messages to different SQL operations based on message metadata. Tombstone messages trigger a DELETE, while all other messages perform an upsert. All operations within a batch execute in a single transaction, ordered by Kafka partition. ```yaml output: sql_raw: driver: postgres dsn: postgres://localhost/postgres max_in_flight: 8 batching: count: 100 period: 100ms queries: - when: 'root = meta("kafka_tombstone_message") == "true"' query: 'DELETE FROM users WHERE id = $1' args_mapping: 'root = [this.id]' - query: | INSERT INTO users (id, name, updated_at) VALUES ($1, $2, $3) ON CONFLICT (id) DO UPDATE SET name = EXCLUDED.name, updated_at = EXCLUDED.updated_at args_mapping: 'root = [this.id, this.name, this.updated_at]' ``` ### Upsert into SAP HANA SAP HANA uses `UPSERT …​ WITH PRIMARY KEY` for insert-or-update semantics instead of the `ON CONFLICT` clause used by PostgreSQL. To read from SAP HANA, use the [`sap_hana` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sap_hana/). ```yaml output: sql_raw: driver: hana dsn: hdb://user:password@hana-host:39017 query: | UPSERT ORDERS (ORDER_ID, CUSTOMER_ID, STATUS, UPDATED_AT) VALUES (?, ?, ?, ?) WITH PRIMARY KEY args_mapping: 'root = [this.order_id, this.customer_id, this.status, this.updated_at]' ``` --- # Page 168: switch **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/switch.md --- # switch The switch output type allows you to route messages to different outputs based on their contents. Messages that do not pass the check of a single output case are effectively dropped. In order to prevent this outcome set the field [`strict_mode`](#strict_mode) to `true`, in which case messages that do not pass at least one case are considered failed and will be nacked and/or reprocessed depending on your input. #### Common ```yml output: label: "" switch: retry_until_success: false cases: [] # No default (required) ``` #### Advanced ```yml output: label: "" switch: retry_until_success: false strict_mode: false cases: [] # No default (required) ``` ## Examples ### Basic Multiplexing The most common use for a switch output is to multiplex messages across a range of output destinations. The following config checks the contents of the field `type` of messages and sends `foo` type messages to an `amqp_1` output, `bar` type messages to a `gcp_pubsub` output, and everything else to a `redis_streams` output. Outputs can have their own processors associated with them, and in this example the `redis_streams` output has a processor that enforces the presence of a type field before sending it. ```yaml output: switch: cases: - check: this.type == "foo" output: amqp_1: urls: [ amqps://guest:guest@localhost:5672/ ] target_address: queue:/the_foos - check: this.type == "bar" output: gcp_pubsub: project: dealing_with_mike topic: mikes_bars - output: redis_streams: url: tcp://localhost:6379 stream: everything_else processors: - mapping: | root = this root.type = this.type | "unknown" ``` ### Control Flow The `continue` field allows messages that have passed a case to be tested against the next one also. This can be useful when combining non-mutually-exclusive case checks. In the following example a message that passes both the check of the first case as well as the second will be routed to both. ```yaml output: switch: cases: - check: 'this.user.interests.contains("walks").catch(false)' output: amqp_1: urls: [ amqps://guest:guest@localhost:5672/ ] target_address: queue:/people_what_think_good continue: true - check: 'this.user.dislikes.contains("videogames").catch(false)' output: gcp_pubsub: project: people topic: that_i_dont_want_to_hang_with ``` ## Fields ### `cases[]` A list of switch cases, outlining outputs that can be routed to. **Type**: `array` ```yaml # Examples: cases: - check: this.urls.contains("http://benthos.dev") continue: true output: cache: key: ${!json("id")} target: foo - output: s3: bucket: bar path: ${!json("id")} ``` ### `cases[].check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that should return a boolean value indicating whether a message should be routed to the case output. If left empty the case always passes. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "foo" # --- check: this.contents.urls.contains("https://benthos.dev/") ``` ### `cases[].continue` Indicates whether, if this case passes for a message, the next case should also be tested. **Type**: `bool` **Default**: `false` ### `cases[].output` An [output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/about/) for messages that pass the check to be routed to. **Type**: `output` ### `retry_until_success` If a selected output fails to send a message this field determines whether it is reattempted indefinitely. If set to false the error is instead propagated back to the input level. If a message can be routed to >1 outputs it is usually best to set this to true in order to avoid duplicate messages being routed to an output. **Type**: `bool` **Default**: `false` ### `strict_mode` This field determines whether an error should be reported if no condition is met. If set to true, an error is propagated back to the input level. The default behavior is false, which will drop the message. **Type**: `bool` **Default**: `false` --- # Page 169: sync_response **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/sync_response.md --- # sync_response Returns the final message payload back to the input origin of the message, where it is dealt with according to that specific input type. For most inputs this mechanism is ignored entirely, in which case the sync response is dropped without penalty. It is therefore safe to use this output even when combining input types that might not have support for sync responses. An example of an input able to utilize this is the `http_server`. It is safe to combine this output with others using broker types. For example, with the `http_server` input we could send the payload to a Kafka topic and also send a modified payload back with: ```yaml input: http_server: path: /post output: broker: pattern: fan_out outputs: - kafka: addresses: [ TODO:9092 ] topic: foo_topic - sync_response: {} processors: - mapping: 'root = content().uppercase()' ``` Using the above example and posting the message 'hello world' to the endpoint `/post` Redpanda Connect would send it unchanged to the topic `foo_topic` and also respond with 'HELLO WORLD'. For more information please read [synchronous responses](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/sync_responses/). ## Common ```yml output: label: "" sync_response: {} ``` ## Advanced ```yml output: label: "" sync_response: {} ``` --- # Page 170: timeplus **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/timeplus.md --- # timeplus Sends message to a Timeplus Enterprise stream via ingest endpoint This output can send message to Timeplus Enterprise Cloud, Timeplus Enterprise (self-hosted) or directly to timeplusd. This output accepts structured message only. It also expects all message contains the same keys and matches the schema of the destination stream. If the upstream source or pipeline returns unstructured message such as string, please refer to the "Unstructured message" example. #### Common ```yml output: label: "" timeplus: target: timeplus url: https://us-west-2.timeplus.cloud workspace: "" # No default (optional) stream: "" # No default (required) apikey: "" # No default (optional) username: "" # No default (optional) password: "" # No default (optional) max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" ``` #### Advanced ```yml output: label: "" timeplus: target: timeplus url: https://us-west-2.timeplus.cloud workspace: "" # No default (optional) stream: "" # No default (required) apikey: "" # No default (optional) username: "" # No default (optional) password: "" # No default (optional) max_in_flight: 64 batching: count: 0 byte_size: 0 period: "" check: "" processors: [] # No default (optional) ``` ## Examples ### To Timeplus Enterprise Cloud You will need to create API Key on Timeplus Enterprise Cloud Web console first and then set the `apikey` field. ```yaml output: timeplus: workspace: my_workspace_id stream: mystream apikey: ``` ### To Timeplus Enterprise (self-hosted) For self-hosted Timeplus Enterprise, you will need to specify the username and password as well as the URL of the App server ```yaml output: timeplus: url: http://localhost:8000 workspace: my_workspace_id stream: mystream username: username password: pw ``` ### To Timeplusd This output writes to Timeplusd via HTTP so make sure you specify the HTTP port of the Timeplusd. ```yaml output: timeplus: url: http://localhost:3218 stream: mystream username: username password: pw ``` ### Unstructured message If the upstream source or pipeline returns unstructured message such as string, you can leverage the output processors to wrap it into a structured message and then pass it to the output. This example create a structured message with `raw` field and store the original string content into this field. You can modify the name of this `raw` field to whatever you want. Please make sure the destination stream contains such field ```yaml output: timeplus: workspace: my_workspace_id stream: mystream apikey: processors: - mapping: | root = {} root.raw = content().string() ``` ## Fields ### `apikey` The API key. Required if you are sending message to Timeplus Enterprise Cloud > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `batching` Configure a [batching policy](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). **Type**: `object` ```yaml # Examples: batching: byte_size: 5000 count: 0 period: 1s # --- batching: count: 10 period: 1s # --- batching: check: this.contains("END BATCH") count: 0 period: 1m ``` ### `batching.byte_size` The maximum total size (in bytes) that a batch can reach before it is flushed. When the combined size of all messages in the batch reaches or exceeds this limit, the batch is immediately sent to the next stage (such as a processor or output). Set to `0` to disable size-based batching. When disabled, messages are flushed based on other conditions (such as `count` or `period`). **Type**: `int` **Default**: `0` ### `batching.check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "end_of_transaction" ``` ### `batching.count` The number of messages at which the batch is flushed. Set to `0` to disable count-based batching. **Type**: `int` **Default**: `0` ### `batching.period` The length of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Supported time units are `ns`, `us`, `ms`, `s`, `m`, and `h`. **Type**: `string` **Default**: `""` ```yaml # Examples: period: 1s # --- period: 1m # --- period: 500ms ``` ### `batching.processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, so splitting the batch into smaller batches with these processors has no effect. **Type**: `array` ```yaml # Examples: processors: - archive: format: concatenate # --- processors: - archive: format: lines # --- processors: - archive: format: json_array ``` ### `max_in_flight` The maximum number of messages to have in flight at a given time. For outputs that send messages in batches, this limit applies to message batches. Increase this value to improve throughput. **Type**: `int` **Default**: `64` ### `password` The password. Required if you are sending message to Timeplus Enterprise (self-hosted) or timeplusd > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `stream` The name of the stream. Make sure the schema of the stream matches the input **Type**: `string` ### `target` The destination type, either Timeplus Enterprise or timeplusd **Type**: `string` **Default**: `timeplus` **Options**: `timeplus`, `timeplusd` ### `url` The url should always include schema and host. **Type**: `string` **Default**: `https://us-west-2.timeplus.cloud` ```yaml # Examples: url: http://localhost:8000 # --- url: http://127.0.0.1:3218 ``` ### `username` The username. Required if you are sending message to Timeplus Enterprise (self-hosted) or timeplusd **Type**: `string` ### `workspace` ID of the workspace. Required if target is `timeplus`. **Type**: `string` --- # Page 171: websocket **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/websocket.md --- # websocket Sends messages to an HTTP server via a websocket connection. #### Common ```yml output: label: "" websocket: url: "" # No default (required) ``` #### Advanced ```yml output: label: "" websocket: url: "" # No default (required) proxy_url: "" # No default (optional) tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] oauth: enabled: false consumer_key: "" consumer_secret: "" access_token: "" access_token_secret: "" basic_auth: enabled: false username: "" password: "" jwt: enabled: false private_key_file: "" signing_method: "" claims: {} headers: {} ``` ## Fields ### `basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `proxy_url` An optional HTTP proxy URL. **Type**: `string` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL to connect to. **Type**: `string` --- # Page 172: a2a_message **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/a2a_message.md --- # a2a_message Sends messages to an A2A (Agent-to-Agent) protocol agent and returns the response. This processor enables Redpanda Connect pipelines to communicate with A2A protocol agents. Currently only JSON-RPC transport is supported. The processor sends a message to the agent and polls for task completion. The agent’s response is returned as the processor output. For more information about the A2A protocol, see [https://a2a-protocol.org/latest/specification](https://a2a-protocol.org/latest/specification) #### Common ```yml processor: label: "" a2a_message: agent_card_url: "" # No default (required) prompt: "" # No default (optional) ``` #### Advanced ```yml processor: label: "" a2a_message: agent_card_url: "" # No default (required) prompt: "" # No default (optional) final_message_only: true ``` ## Fields ### `agent_card_url` URL for the A2A agent card. Can be either a base URL (for example, `https://example.com`) or a full path to the agent card (for example, `https://example.com/.well-known/agent.json`). If no path is provided, defaults to `/.well-known/agent.json`. Authentication uses OAuth2 from environment variables. **Type**: `string` ### `final_message_only` If true, returns only the text from the final agent message (concatenated from all text parts). If false, returns the complete Message or Task object as structured data with full history, artifacts, and metadata. Example with final_message_only: true (default): ```none Here is the answer to your question... ``` Example with final_message_only: false: ```json { "id": "task-123", "contextId": "ctx-456", "status": { "state": "completed" }, "history": [ {"role": "user", "parts": [{"text": "Your question"}]}, {"role": "agent", "parts": [{"text": "Here is the answer to your question..."}]} ], "artifacts": [] } ``` **Type**: `bool` **Default**: `true` ### `prompt` The user prompt to send to the agent. By default, the processor submits the entire payload as a string. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` --- # Page 173: Processors **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about.md --- # Processors Redpanda Connect processors are functions applied to messages passing through a pipeline. The function signature allows a processor to mutate or drop messages depending on the content of the message. There are many types on offer but the most powerful are the [`mapping`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mapping/) and [`mutation`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mutation/) processors. Processors are set via config, and depending on where in the config they are placed they will be run either immediately after a specific input (set in the input section), on all messages (set in the pipeline section) or before a specific output (set in the output section). Most processors apply to all messages and can be placed in the pipeline section: ```yaml pipeline: threads: 1 processors: - label: my_cool_mapping mapping: | root.message = this root.meta.link_count = this.links.length() ``` The `threads` field in the pipeline section determines how many parallel processing threads are created. You can read more about parallel processing in the [pipeline guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/processing_pipelines/). ## Labels Processors have an optional field `label` that can uniquely identify them in observability data such as metrics and logs. This can be useful when running configs with multiple nested processors, otherwise their metrics labels will be generated based on their composition. For more information check out the [metrics documentation](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/about/). ## Error handling Some processors have conditions whereby they might fail. Rather than throw these messages into the abyss Redpanda Connect still attempts to send these messages onwards, and has mechanisms for filtering, recovering or dead-letter queuing messages that have failed which can be read about [here](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). ### Error logs Errors that occur during processing can be roughly separated into two groups; those that are unexpected intermittent errors such as connectivity problems, and those that are logical errors such as bad input data or unmatched schemas. All processing errors result in the messages being flagged as failed, [error metrics](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/about/) increasing for the given errored processor, and debug level logs being emitted that describe the error. Only errors that are known to be intermittent are also logged at the error level. The reason for this behavior is to prevent noisy logging in cases where logical errors are expected and will likely be [handled in config](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). However, this can also sometimes make it easy to miss logical errors in your configs when they lack error handling. If you suspect you are experiencing processing errors and do not wish to add error handling yet then a quick and easy way to expose those errors is to enable debug level logs with the cli flag `--log.level=debug` or by setting the level in config: ```yaml logger: level: DEBUG ``` ## Using processors as outputs It might be the case that a processor that results in a side effect, such as the [`sql_insert`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/sql_insert/) or [`redis`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/redis/) processors, is the only side effect of a pipeline, and therefore could be considered the output. In such cases it’s possible to place these processors within a [`reject` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/reject/) so that they behave the same as regular outputs, where success results in dropping the message with an acknowledgement and failure results in a nack (or retry): ```yaml output: reject: 'failed to send data: ${! error() }' processors: - try: - redis: url: tcp://localhost:6379 command: sadd args_mapping: 'root = [ this.key, this.value ]' - mapping: root = deleted() ``` The way this works is that if your processor with the side effect (`redis` in this case) succeeds then the final `mapping` processor deletes the message which results in an acknowledgement. If the processor fails then the `try` block exits early without executing the `mapping` processor and instead the message is routed to the `reject` output, which nacks the message with an error message containing the error obtained from the `redis` processor. ## Batching and multiple-part messages All Redpanda Connect processors support multiple-part messages, which are synonymous with batches. This enables [windowed processing](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/windowed_processing/) capabilities. Many processors are able to perform their behaviors on specific parts of a message batch, or on all parts, and have a field `parts` for specifying an array of part indexes they should apply to. If the list of target parts is empty these processors will be applied to all message parts. Part indexes can be negative, and if so the part will be selected from the end counting backwards starting from -1. E.g. if part = -1 then the selected part will be the last part of the message, if part = -2 then the part before the last element will be selected, and so on. Some processors such as [`dedupe`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/dedupe/) act across an entire batch, when instead we might like to perform them on individual messages of a batch. In this case the [`for_each`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/for_each/) processor can be used. You can read more about batching [in this document](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). --- # Page 174: archive **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/archive.md --- # archive Archives all the messages of a batch into a single message according to the selected archive format. Some archive formats (such as tar, zip) treat each archive item (message part) as a file with a path. Since message parts only contain raw data a unique path must be generated for each part. This can be done by using function interpolations on the 'path' field as described in [Bloblang queries](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). For types that aren’t file based (such as binary) the file field is ignored. The resulting archived message adopts the metadata of the _first_ message part of the batch. The functionality of this processor depends on being applied across messages that are batched. You can find out more about batching [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). To reverse this process use the [`unarchive` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/unarchive/) followed by a [`split` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/split/) to process each message individually. #### Common ```yml processor: label: "" archive: format: binary # No default (required) path: "" ``` #### Advanced ```yml processor: label: "" archive: format: binary # No default (required) path: "" ``` ## Fields ### `format` The archiving format to apply. **Type**: `string` | Option | Summary | | --- | --- | | `binary` | Archive messages to a [binary blob format](https://github.com/redpanda-data/benthos/blob/main/internal/message/message.go#L96). | | `concatenate` | Join the raw contents of each message into a single binary message. | | `json_array` | Attempt to parse each message as a JSON document and append the result to an array, which becomes the contents of the resulting message. | | `lines` | Join the raw contents of each message and insert a line break between each one. | | `tar` | Archive messages to a unix standard tape archive. | | `zip` | Archive messages to a zip file. | ### `path` The path to set for each message in the archive (when applicable). This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ```yaml # Examples: path: ${!counter()}-${!timestamp_unix_nano()}.txt # --- path: ${!meta("kafka_key")}-${!json("id")}.json ``` ## Examples ### Tar Archive If we had JSON messages in a batch each of the form: ```json {"doc":{"id":"foo","body":"hello world 1"}} ``` And we wished to tar archive them, setting their filenames to their respective unique IDs (with the extension `.json`), our config might look like this: ```yaml pipeline: processors: - archive: format: tar path: ${!json("doc.id")}.json ``` --- # Page 175: avro **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/avro.md --- # avro Performs Avro based operations on messages based on a schema. > ⚠️ **WARNING** > > If you are consuming or generating messages using a schema registry service then it is likely this processor will fail as those services require messages to be prefixed with the identifier of the schema version being used. Instead, try the [`schema_registry_encode`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/schema_registry_encode/) and [`schema_registry_decode`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/schema_registry_decode/) processors. ## Operators ### `to_json` Converts Avro documents into a JSON structure. This makes it easier to manipulate the contents of the document within Benthos. The encoding field specifies how the source documents are encoded. ### `from_json` Attempts to convert JSON documents into Avro documents according to the specified encoding. #### Common ```yml processor: label: "" avro: operator: to_json # No default (required) encoding: textual schema: "" schema_path: "" ``` #### Advanced ```yml processor: label: "" avro: operator: to_json # No default (required) encoding: textual schema: "" schema_path: "" ``` ## Fields ### `encoding` An Avro encoding format to use for conversions to and from a schema. **Type**: `string` **Default**: `textual` **Options**: `textual`, `binary`, `single` ### `operator` The [operator](#operators) to execute **Type**: `string` **Options**: `to_json`, `from_json` ### `schema` A full Avro schema to use. **Type**: `string` **Default**: `""` ### `schema_path` The path of a schema document to apply. Use either this or the `schema` field. URLs must begin with `file://` or `http://`. Note that `file://` URLs must use absolute paths (for example, `file:///absolute/path/to/spec.avsc`); relative paths are not supported. **Type**: `string` **Default**: `""` ```yaml # Examples: schema_path: file:///path/to/spec.avsc # --- schema_path: http://localhost:8081/path/to/spec/versions/1 ``` --- # Page 176: aws_bedrock_chat **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/aws_bedrock_chat.md --- # aws_bedrock_chat Generates responses to messages in a chat conversation, using the AWS Bedrock API. This processor sends prompts to your chosen large language model (LLM) and generates text from the responses, using the AWS Bedrock API. For more information, see the [AWS Bedrock documentation](https://docs.aws.amazon.com/bedrock/latest/userguide). #### Common ```yml processor: label: "" aws_bedrock_chat: model: "" # No default (required) prompt: "" # No default (optional) system_prompt: "" # No default (optional) max_tokens: 0 # No default (optional) temperature: 0 # No default (optional) ``` #### Advanced ```yml processor: label: "" aws_bedrock_chat: region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) model: "" # No default (required) prompt: "" # No default (optional) system_prompt: "" # No default (optional) max_tokens: 0 # No default (optional) temperature: 0 # No default (optional) stop: [] # No default (optional) top_p: 0 # No default (optional) ``` ## Fields ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `max_tokens` The maximum number of tokens to allow in the generated response. **Type**: `int` ### `model` The model ID to use. For a full list, see the [AWS Bedrock documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html). **Type**: `string` ```yaml # Examples: model: amazon.titan-text-express-v1 # --- model: anthropic.claude-3-5-sonnet-20240620-v1:0 # --- model: cohere.command-text-v14 # --- model: meta.llama3-1-70b-instruct-v1:0 # --- model: mistral.mistral-large-2402-v1:0 ``` ### `prompt` The user prompt you want to generate a response for. By default, the processor submits the entire payload of each message as a string. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `stop[]` A list of stop sequences. A stop sequence is a sequence of characters that causes the model to stop generating the response. **Type**: `array` ### `system_prompt` The system prompt to submit along with the user prompt. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `temperature` The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options. A higher value makes the model more likely to choose lower-probability options. **Type**: `float` ### `top_p` The percentage of most-likely candidates that the model considers for the next token. For example, if you choose a value of `0.8`, the model selects from the top 80% of the probability distribution of tokens that could be next in the sequence. **Type**: `float` --- # Page 177: aws_bedrock_embeddings **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/aws_bedrock_embeddings.md --- # aws_bedrock_embeddings Computes vector embeddings on text, using the AWS Bedrock API. This processor sends text to your chosen large language model (LLM) and computes vector embeddings, using the [AWS Bedrock API](https://aws.amazon.com/bedrock/). For more information, see the [AWS Bedrock documentation](https://docs.aws.amazon.com/bedrock/latest/userguide). #### Common ```yml processor: label: "" aws_bedrock_embeddings: model: "" # No default (required) text: "" # No default (optional) input_type: "" # No default (optional) ``` #### Advanced ```yml processor: label: "" aws_bedrock_embeddings: region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) model: "" # No default (required) text: "" # No default (optional) input_type: "" # No default (optional) ``` ## Fields ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `input_type` Specifies the type of input passed to the model. Required by Cohere embedding models; ignored by Amazon Titan models. **Type**: `string` | Option | Summary | | --- | --- | | `classification` | Used for embeddings passed through a text classifier. | | `clustering` | Used for the embeddings run through a clustering algorithm. | | `search_document` | Used for embeddings stored in a vector database for search use-cases. | | `search_query` | Used for embeddings of search queries run against a vector DB to find relevant documents. | ### `model` The ID of the model that you want to use to generate vector embeddings. For a full list, see the [AWS Bedrock documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html). **Type**: `string` ```yaml # Examples: model: amazon.titan-embed-text-v1 # --- model: amazon.titan-embed-text-v2:0 # --- model: cohere.embed-english-v3 # --- model: cohere.embed-multilingual-v3 # --- model: cohere.embed-v4:0 ``` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `text` The prompt you want to generate a vector embedding for. By default, the processor submits the entire payload as a string. **Type**: `string` ## Examples ### Store embedding vectors in Clickhouse Compute embeddings for some generated data and store it within [Clickhouse](https://clickhouse.com/) ```yaml input: generate: interval: 1s mapping: | root = {"text": fake("paragraph")} pipeline: processors: - branch: request_map: | root = this.text processors: - aws_bedrock_embeddings: model: amazon.titan-embed-text-v1 result_map: | root.embeddings = this output: sql_insert: driver: clickhouse dsn: "clickhouse://localhost:9000" table: searchable_text columns: ["id", "text", "vector"] args_mapping: "root = [uuid_v4(), this.text, this.embeddings]" ``` --- # Page 178: aws_dynamodb_partiql **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/aws_dynamodb_partiql.md --- # aws_dynamodb_partiql Executes a PartiQL expression against a DynamoDB table for each message. Both writes or reads are supported, when the query is a read the contents of the message will be replaced with the result. This processor is more efficient when messages are pre-batched as the whole batch will be executed in a single call. #### Common ```yml processor: label: "" aws_dynamodb_partiql: query: "" # No default (required) args_mapping: "" ``` #### Advanced ```yml processor: label: "" aws_dynamodb_partiql: query: "" # No default (required) unsafe_dynamic_query: false use_batch: true args_mapping: "" region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) ``` ## Examples ### Insert The following example inserts rows into the table footable with the columns foo, bar and baz populated with values extracted from messages: ```yaml pipeline: processors: - aws_dynamodb_partiql: query: "INSERT INTO footable VALUE {'foo':'?','bar':'?','baz':'?'}" args_mapping: | root = [ { "S": this.foo }, { "S": meta("kafka_topic") }, { "S": this.document.content }, ] ``` ### Query a GSI for a single record The following example looks up a single record from the table footable using the global secondary index index_name, matching on the field bar. BatchExecuteStatement can’t query a GSI, so use_batch is disabled: ```yaml pipeline: processors: - aws_dynamodb_partiql: query: "SELECT * FROM \"footable\".\"index_name\" WHERE bar = ?" use_batch: false args_mapping: | root = [ { "S": this.bar }, ] ``` ## Fields ### `args_mapping` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that, for each message, creates a list of arguments to use with the query. **Type**: `string` **Default**: `""` ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `query` A PartiQL query to execute for each message. **Type**: `string` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `unsafe_dynamic_query` Whether to enable dynamic queries that support interpolation functions. **Type**: `bool` **Default**: `false` ### `use_batch` Whether to execute all messages in a batch as a single `BatchExecuteStatement` call. Set this to `false` to execute one `ExecuteStatement` call per message instead, which is required for PartiQL `SELECT` queries against a global secondary index (GSI), because `BatchExecuteStatement` does not support querying a GSI. Only the first result row is used when a query returns multiple items. **Type**: `bool` **Default**: `true` --- # Page 179: aws_lambda **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/aws_lambda.md --- # aws_lambda Invokes an AWS lambda for each message. The contents of the message is the payload of the request, and the result of the invocation will become the new contents of the message. The `rate_limit` field can be used to specify a rate limit [resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/about/) to cap the rate of requests across parallel components service wide. In order to map or encode the payload to a specific request body, and map the response back into the original payload instead of replacing it entirely, you can use the [`branch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/). ## Error handling When Redpanda Connect is unable to connect to the AWS endpoint or is otherwise unable to invoke the target lambda function it will retry the request according to the configured number of retries. Once these attempts have been exhausted the failed message will continue through the pipeline with it’s contents unchanged, but flagged as having failed, allowing you to use [standard processor error handling patterns](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). However, if the invocation of the function is successful but the function itself throws an error, then the message will have it’s contents updated with a JSON payload describing the reason for the failure, and a metadata field `lambda_function_error` will be added to the message allowing you to detect and handle function errors with a [`branch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/): ```yaml pipeline: processors: - branch: processors: - aws_lambda: function: foo result_map: | root = if meta().exists("lambda_function_error") { throw("Invocation failed due to %v: %v".format(this.errorType, this.errorMessage)) } else { this } output: switch: retry_until_success: false cases: - check: errored() output: reject: ${! error() } - output: resource: somewhere_else ``` ## Credentials By default Redpanda Connect will use a shared credentials file when connecting to AWS services. It’s also possible to set them explicitly at the component level, allowing you to transfer data across accounts. You can find out more in [AWS credentials](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). ### Common ```yml processor: label: "" aws_lambda: parallel: false function: "" # No default (required) ``` ### Advanced ```yml processor: label: "" aws_lambda: parallel: false function: "" # No default (required) rate_limit: "" region: "" # No default (optional) endpoint: "" # No default (optional) tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s credentials: profile: "" # No default (optional) id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) from_ec2_role: false # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) timeout: 5s retries: 3 ``` ## Examples ### Branched Invoke This example uses a [`branch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/) to map a new payload for triggering a lambda function with an ID and username from the original message, and the result of the lambda is discarded, meaning the original message is unchanged. ```yaml pipeline: processors: - branch: request_map: '{"id":this.doc.id,"username":this.user.name}' processors: - aws_lambda: function: trigger_user_update ``` ## Fields ### `credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `credentials.role` The ARN of the role to assume. **Type**: `string` ### `credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `function` The function to invoke. **Type**: `string` ### `parallel` Whether messages of a batch should be dispatched in parallel. **Type**: `bool` **Default**: `false` ### `rate_limit` An optional [`rate_limit`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/about/) to throttle invocations by. **Type**: `string` **Default**: `""` ### `region` The AWS region in which your resources are hosted. **Type**: `string` ### `retries` The maximum number of retry attempts for each message. **Type**: `int` **Default**: `3` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `timeout` The maximum period of time to wait before abandoning an invocation. **Type**: `string` **Default**: `5s` --- # Page 180: azure_cosmosdb **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/azure_cosmosdb.md --- # azure_cosmosdb Creates or updates messages as JSON documents in [Azure CosmosDB](https://learn.microsoft.com/en-us/azure/cosmos-db/introduction). When creating documents, each message must have the `id` property (case-sensitive) set (or use `auto_id: true`). It is the unique name that identifies the document, that is, no two documents share the same `id` within a logical partition. The `id` field must not exceed 255 characters. [See details](https://learn.microsoft.com/en-us/rest/api/cosmos-db/documents). The `partition_keys` field must resolve to the same value(s) across the entire message batch. ## Credentials You can use one of the following authentication mechanisms: - Set the `endpoint` field and the `account_key` field - Set only the `endpoint` field to use [DefaultAzureCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DefaultAzureCredential) - Set the `connection_string` field ## Metadata This component adds the following metadata fields to each message: - `activity_id` - `request_charge` You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ## Batching CosmosDB limits the maximum batch size to 100 messages and the payload must not exceed 2MB ([details here](https://learn.microsoft.com/en-us/azure/cosmos-db/concepts-limits#per-request-limits)). ### Common ```yml processor: label: "" azure_cosmosdb: endpoint: "" # No default (optional) account_key: "" # No default (optional) connection_string: "" # No default (optional) database: "" # No default (required) container: "" # No default (required) partition_keys_map: "" # No default (required) operation: Create item_id: "" # No default (optional) ``` ### Advanced ```yml processor: label: "" azure_cosmosdb: endpoint: "" # No default (optional) account_key: "" # No default (optional) connection_string: "" # No default (optional) database: "" # No default (required) container: "" # No default (required) partition_keys_map: "" # No default (required) operation: Create patch_operations: [] # No default (optional) patch_condition: "" # No default (optional) auto_id: true item_id: "" # No default (optional) enable_content_response_on_write: true ``` ## Examples ### Patch documents Query documents from a container and patch them. ```yaml input: azure_cosmosdb: endpoint: http://localhost:8080 account_key: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw== database: blobbase container: blobfish partition_keys_map: root = "AbyssalPlain" query: SELECT * FROM blobfish processors: - mapping: | root = "" meta habitat = json("habitat") meta id = this.id - azure_cosmosdb: endpoint: http://localhost:8080 account_key: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw== database: testdb container: blobfish partition_keys_map: root = json("habitat") item_id: ${! meta("id") } operation: Patch patch_operations: # Add a new /diet field - operation: Add path: /diet value_map: root = json("diet") # Remove the first location from the /locations array field - operation: Remove path: /locations/0 # Add new location at the end of the /locations array field - operation: Add path: /locations/- value_map: root = "Challenger Deep" # Return the updated document enable_content_response_on_write: true ``` ## Fields ### `account_key` Account key. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: account_key: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw== ``` ### `auto_id` Automatically set the item `id` field to a random UUID v4. If the `id` field is already set, then it will not be overwritten. Setting this to `false` can improve performance, since the messages will not have to be parsed. **Type**: `bool` **Default**: `true` ### `connection_string` Connection string. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: connection_string: AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==; ``` ### `container` Container. **Type**: `string` ```yaml # Examples: container: testcontainer ``` ### `database` Database. **Type**: `string` ```yaml # Examples: database: testdb ``` ### `enable_content_response_on_write` Enable content response on write operations. To save some bandwidth, set this to false if you don’t need to receive the updated message(s) from the server, in which case the processor will not modify the content of the messages which are fed into it. Applies to every operation except Read. **Type**: `bool` **Default**: `true` ### `endpoint` CosmosDB endpoint. **Type**: `string` ```yaml # Examples: endpoint: https://localhost:8081 ``` ### `item_id` ID of item to replace or delete. Only used by the Replace and Delete operations This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: item_id: ${! json("id") } ``` ### `operation` Operation. **Type**: `string` **Default**: `Create` | Option | Summary | | --- | --- | | `Create` | Create operation. | | `Delete` | Delete operation. | | `Patch` | Patch operation. | | `Read` | Read operation. | | `Replace` | Replace operation. | | `Upsert` | Upsert operation. | ### `partition_keys_map` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) which should evaluate to a single partition key value or an array of partition key values of type string, integer or boolean. Currently, hierarchical partition keys are not supported so only one value may be provided. **Type**: `string` ```yaml # Examples: partition_keys_map: root = "blobfish" # --- partition_keys_map: root = 41 # --- partition_keys_map: root = true # --- partition_keys_map: root = null # --- partition_keys_map: root = json("blobfish").depth ``` ### `patch_condition` Patch operation condition. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: patch_condition: from c where not is_defined(c.blobfish) ``` ### `patch_operations[]` Patch operations to be performed when `operation: Patch` . **Type**: `array` ### `patch_operations[].operation` Operation. **Type**: `string` **Default**: `Add` | Option | Summary | | --- | --- | | `Add` | Add patch operation. | | `Increment` | Increment patch operation. | | `Remove` | Remove patch operation. | | `Replace` | Replace patch operation. | | `Set` | Set patch operation. | ### `patch_operations[].path` Path. **Type**: `string` ```yaml # Examples: path: /foo/bar/baz ``` ### `patch_operations[].value_map` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) which should evaluate to a value of any type that is supported by CosmosDB. **Type**: `string` ```yaml # Examples: value_map: root = "blobfish" # --- value_map: root = 41 # --- value_map: root = true # --- value_map: root = json("blobfish").depth # --- value_map: root = [1, 2, 3] ``` ## CosmosDB emulator If you wish to run the CosmosDB emulator that is referenced in the documentation [here](https://learn.microsoft.com/en-us/azure/cosmos-db/linux-emulator), the following Docker command should do the trick: ```bash > docker run --rm -it -p 8081:8081 --name=cosmosdb -e AZURE_COSMOS_EMULATOR_PARTITION_COUNT=10 -e AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE=false mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator ``` Note: `AZURE_COSMOS_EMULATOR_PARTITION_COUNT` controls the number of partitions that will be supported by the emulator. The bigger the value, the longer it takes for the container to start up. Additionally, instead of installing the container self-signed certificate which is exposed via `https://localhost:8081/_explorer/emulator.pem`, you can run [mitmproxy](https://mitmproxy.org/) like so: ```bash > mitmproxy -k --mode "reverse:https://localhost:8081" ``` Then you can access the CosmosDB UI via `http://localhost:8080/_explorer/index.html` and use `http://localhost:8080` as the CosmosDB endpoint. --- # Page 181: benchmark **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/benchmark.md --- # benchmark Logs basic throughput statistics of messages that pass through this processor. Logs messages per second and bytes per second of messages that are processed at a regular interval. A summary of the amount of messages processed over the entire lifetime of the processor will also be printed when the processor shuts down. Each rolling log line has the form `rolling stats: msg/sec, /sec`, for example `rolling stats: 1 msg/sec, 407 B/sec`. The shutdown summary uses the same form with `total stats`. When `count_bytes` is `false`, the lines omit the bytes figure. This processor exposes the following metrics: - `benchmark_messages_per_second` (gauge): The current throughput in messages per second. - `benchmark_messages_total` (counter): The total number of messages processed. - `benchmark_bytes_per_second` (gauge): The current throughput in bytes per second. - `benchmark_bytes_total` (counter): The total number of bytes processed. #### Common ```yml processor: label: "" benchmark: interval: 5s count_bytes: true ``` #### Advanced ```yml processor: label: "" benchmark: interval: 5s count_bytes: true ``` ## Fields ### `count_bytes` Whether to measure the number of bytes per second of throughput. If set to `true`, structured data must be serialized to count the number of bytes processed, which can unnecessarily degrade performance if serialization is not required elsewhere in your pipeline. **Type**: `bool` **Default**: `true` ### `interval` How often to emit rolling statistics. Set to `0` to log only summary statistics when the processor shuts down. **Type**: `string` **Default**: `5s` --- # Page 182: bloblang **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/bloblang.md --- # bloblang Executes a [Bloblang](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) mapping on messages. Bloblang is a powerful language that enables a wide range of mapping, transformation and filtering tasks. For more information see [About Bloblang](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/). If your mapping is large and you’d prefer for it to live in a separate file then you can execute a mapping directly from a file with the expression `from ""`, where the path must be absolute, or relative from the location that Redpanda Connect is executed from. ## Component rename This processor was recently renamed to the [`mapping` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mapping/) in order to make the purpose of the processor more prominent. It is still valid to use the existing `bloblang` name but eventually it will be deprecated and replaced by the new name in example configs. ### Common ```yml processor: label: "" bloblang: "" ``` ### Advanced ```yml processor: label: "" bloblang: "" ``` ## Examples ### Mapping Given JSON documents containing an array of fans: ```json { "id":"foo", "description":"a show about foo", "fans":[ {"name":"bev","obsession":0.57}, {"name":"grace","obsession":0.21}, {"name":"ali","obsession":0.89}, {"name":"vic","obsession":0.43} ] } ``` We can reduce the fans to only those with an obsession score above 0.5, giving us: ```json { "id":"foo", "description":"a show about foo", "fans":[ {"name":"bev","obsession":0.57}, {"name":"ali","obsession":0.89} ] } ``` With the following config: ```yaml pipeline: processors: - bloblang: | root = this root.fans = this.fans.filter(fan -> fan.obsession > 0.5) ``` ### More Mapping When receiving JSON documents of the form: ```json { "locations": [ {"name": "Seattle", "state": "WA"}, {"name": "New York", "state": "NY"}, {"name": "Bellevue", "state": "WA"}, {"name": "Olympia", "state": "WA"} ] } ``` We could collapse the location names from the state of Washington into a field `Cities`: ```json {"Cities": "Bellevue, Olympia, Seattle"} ``` With the following config: ```yaml pipeline: processors: - bloblang: | root.Cities = this.locations. filter(loc -> loc.state == "WA"). map_each(loc -> loc.name). sort().join(", ") ``` ## Error handling Bloblang mappings can fail, in which case the message remains unchanged, errors are logged, and the message is flagged as having failed, allowing you to use [standard processor error handling patterns](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). However, Bloblang itself also provides powerful ways of ensuring your mappings do not fail by specifying desired fallback behavior, which you can read about in [Error handling](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/#error-handling). --- # Page 183: bounds_check **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/bounds_check.md --- # bounds_check Removes messages (and batches) that do not fit within certain size boundaries. #### Common ```yml processor: label: "" bounds_check: max_part_size: 1073741824 min_part_size: 1 ``` #### Advanced ```yml processor: label: "" bounds_check: max_part_size: 1073741824 min_part_size: 1 max_parts: 100 min_parts: 1 ``` ## Fields ### `max_part_size` The maximum size of a message to allow (in bytes) **Type**: `int` **Default**: `1073741824` ### `max_parts` The maximum size of message batches to allow (in message count) **Type**: `int` **Default**: `100` ### `min_part_size` The minimum size of a message to allow (in bytes) **Type**: `int` **Default**: `1` ### `min_parts` The minimum size of message batches to allow (in message count) **Type**: `int` **Default**: `1` --- # Page 184: branch **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch.md --- # branch The `branch` processor allows you to create a new request message via a [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/), execute a list of processors on the request messages, and, finally, map the result back into the source message using another mapping. This is useful for preserving the original message contents when using processors that would otherwise replace the entire contents. ## Metadata Metadata fields that are added to messages during branch processing will not be automatically copied into the resulting message. In order to do this you should explicitly declare in your `result_map` either a wholesale copy with `meta = metadata()`, or selective copies with `meta foo = metadata("bar")` and so on. It is also possible to reference the metadata of the origin message in the `result_map` using the [`@` operator](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/#metadata). ## Error handling If the `request_map` fails the child processors will not be executed. If the child processors themselves result in an (uncaught) error then the `result_map` will not be executed. If the `result_map` fails the message will remain unchanged. Under any of these conditions standard [error handling methods](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/) can be used in order to filter, DLQ or recover the failed messages. ## Conditional branching If the root of your request map is set to `deleted()` then the branch processors are skipped for the given message, this allows you to conditionally branch messages. ### Common ```yml processor: label: "" branch: request_map: "" processors: [] # No default (required) result_map: "" ``` ### Advanced ```yml processor: label: "" branch: request_map: "" processors: [] # No default (required) result_map: "" ``` ## Fields ### `processors[]` A list of processors to apply to mapped requests. When processing message batches the resulting batch must match the size and ordering of the input batch, therefore filtering, grouping should not be performed within these processors. **Type**: `array` ### `request_map` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that describes how to create a request payload suitable for the child processors of this branch. If left empty then the branch will begin with an exact copy of the origin message (including metadata). **Type**: `string` **Default**: `""` ```yaml # Examples: request_map: |- root = { "id": this.doc.id, "content": this.doc.body.text } # --- request_map: |- root = if this.type == "foo" { this.foo.request } else { deleted() } ``` ### `result_map` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that describes how the resulting messages from branched processing should be mapped back into the original payload. If left empty the origin message will remain unchanged (including metadata). **Type**: `string` **Default**: `""` ```yaml # Examples: result_map: |- meta foo_code = metadata("code") root.foo_result = this # --- result_map: |- meta = metadata() root.bar.body = this.body root.bar.id = this.user.id # --- result_map: root.raw_result = content().string() # --- result_map: |- root.enrichments.foo = if metadata("request_failed") != null { throw(metadata("request_failed")) } else { this } # --- result_map: |- # Retain only the updated metadata fields which were present in the origin message meta = metadata().filter(v -> @.get(v.key) != null) ``` ## Examples ### HTTP Request This example strips the request message into an empty body, grabs an HTTP payload, and places the result back into the original message at the path `image.pull_count`: ```yaml pipeline: processors: - branch: request_map: 'root = ""' processors: - http: url: https://hub.docker.com/v2/repositories/jeffail/benthos verb: GET headers: Content-Type: application/json result_map: root.image.pull_count = this.pull_count # Example input: {"id":"foo","some":"pre-existing data"} # Example output: {"id":"foo","some":"pre-existing data","image":{"pull_count":1234}} ``` ### Non Structured Results When the result of your branch processors is unstructured and you wish to simply set a resulting field to the raw output use the content function to obtain the raw bytes of the resulting message and then coerce it into your value type of choice: ```yaml pipeline: processors: - branch: request_map: 'root = this.document.id' processors: - cache: resource: descriptions_cache key: ${! content() } operator: get result_map: root.document.description = content().string() # Example input: {"document":{"id":"foo","content":"hello world"}} # Example output: {"document":{"id":"foo","content":"hello world","description":"this is a cool doc"}} ``` ### Lambda Function This example maps a new payload for triggering a lambda function with an ID and username from the original message, and the result of the lambda is discarded, meaning the original message is unchanged. ```yaml pipeline: processors: - branch: request_map: '{"id":this.doc.id,"username":this.user.name}' processors: - aws_lambda: function: trigger_user_update # Example input: {"doc":{"id":"foo","body":"hello world"},"user":{"name":"fooey"}} # Output matches the input, which is unchanged ``` ### Conditional Caching This example caches a document by a message ID only when the type of the document is a foo: ```yaml pipeline: processors: - branch: request_map: | meta id = this.id root = if this.type == "foo" { this.document } else { deleted() } processors: - cache: resource: TODO operator: set key: ${! @id } value: ${! content() } ``` --- # Page 185: cache **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cache.md --- # cache Performs operations against a [cache resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) for each message, allowing you to store or retrieve data within message payloads. For use cases where you wish to cache the result of processors consider using the [`cached` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cached/) instead. This processor will interpolate functions within the `key` and `value` fields individually for each message. This allows you to specify dynamic keys and values based on the contents of the message payloads and metadata. You can find a list of functions in [Bloblang queries](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). #### Common ```yml processor: label: "" cache: resource: "" # No default (required) operator: set # No default (required) key: "" # No default (required) value: "" # No default (optional) ``` #### Advanced ```yml processor: label: "" cache: resource: "" # No default (required) operator: set # No default (required) key: "" # No default (required) value: "" # No default (optional) ttl: "" # No default (optional) ``` ## Examples ### Deduplication Deduplication can be done using the add operator with a key extracted from the message payload, since it fails when a key already exists we can remove the duplicates using a [`mapping` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mapping/): ```yaml pipeline: processors: - cache: resource: foocache operator: add key: '${! json("message.id") }' value: "storeme" - mapping: root = if errored() { deleted() } cache_resources: - label: foocache redis: url: tcp://TODO:6379 ``` ### Deduplication Batch-Wide Sometimes it’s necessary to deduplicate a batch of messages (also known as a window) by a single identifying value. This can be done by introducing a [`branch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/), which executes the cache only once on behalf of the batch, in this case with a value make from a field extracted from the first and last messages of the batch: ```yaml pipeline: processors: # Try and add one message to a cache that identifies the whole batch - branch: request_map: | root = if batch_index() == 0 { json("id").from(0) + json("meta.tail_id").from(-1) } else { deleted() } processors: - cache: resource: foocache operator: add key: ${! content() } value: t # Delete all messages if we failed - mapping: | root = if errored().from(0) { deleted() } ``` ### Hydration It’s possible to enrich payloads with content previously stored in a cache by using the [`branch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/) processor: ```yaml pipeline: processors: - branch: processors: - cache: resource: foocache operator: get key: '${! json("message.document_id") }' result_map: 'root.message.document = this' # NOTE: If the data stored in the cache is not valid JSON then use # something like this instead: # result_map: 'root.message.document = content().string()' cache_resources: - label: foocache memcached: addresses: [ "TODO:11211" ] ``` ## Fields ### `key` A key to use with the cache. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `operator` The [operation](#operators) to perform with the cache. **Type**: `string` **Options**: `set`, `add`, `get`, `delete`, `exists` ### `resource` The [`cache` resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) to target with this processor. **Type**: `string` ### `ttl` The time to live (TTL) of each individual item as a duration string. After this period an item will be eligible for removal during the next compaction. Not all caches support per-key TTLs, those that do will have a configuration field `default_ttl`, and those that do not will fall back to their generally configured TTL setting. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: ttl: 60s # --- ttl: 5m # --- ttl: 36h ``` ### `value` A value to use with the cache (when applicable). This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ## Operators ### `set` Set a key in the cache to a value. If the key already exists the contents are overridden. ### `add` Set a key in the cache to a value. If the key already exists the action fails with a 'key already exists' error, which can be detected with [processor error handling](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). ### `get` Retrieve the contents of a cached key and replace the original message payload with the result. If the key does not exist the action fails with an error, which can be detected with [processor error handling](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). ### `delete` Delete a key and its contents from the cache. If the key does not exist the action is a no-op and will not fail with an error. ### `exists` Check if a given key exists in the cache and replace the original message payload with `true` or `false`. --- # Page 186: cached **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cached.md --- # cached Cache the result of applying one or more processors to messages identified by a key. If the key already exists within the cache the contents of the message will be replaced with the cached result instead of applying the processors. This component is therefore useful in situations where an expensive set of processors need only be executed periodically. The format of the data when stored within the cache is a custom and versioned schema chosen to balance performance and storage space. It is therefore not possible to point this processor to a cache that is pre-populated with data that this processor has not created itself. #### Common ```yml processor: label: "" cached: cache: "" # No default (required) skip_on: "" # No default (optional) key: "" # No default (required) ttl: "" # No default (optional) processors: [] # No default (required) ``` #### Advanced ```yml processor: label: "" cached: cache: "" # No default (required) skip_on: "" # No default (optional) key: "" # No default (required) ttl: "" # No default (optional) processors: [] # No default (required) ``` ## Examples ### Cached Enrichment In the following example we want to we enrich messages consumed from Kafka with data specific to the origin topic partition, we do this by placing an `http` processor within a `branch`, where the HTTP URL contains interpolation functions with the topic and partition in the path. However, it would be inefficient to make this HTTP request for every single message as the result is consistent for all data of a given topic partition. We can solve this by placing our enrichment call within a `cached` processor where the key contains the topic and partition, resulting in messages that originate from the same topic/partition combination using the cached result of the prior. ```yaml pipeline: processors: - branch: processors: - cached: key: '${! meta("kafka_topic") }-${! meta("kafka_partition") }' cache: foo_cache processors: - mapping: 'root = ""' - http: url: http://example.com/enrichment/${! meta("kafka_topic") }/${! meta("kafka_partition") } verb: GET result_map: 'root.enrichment = this' cache_resources: - label: foo_cache memory: # Disable compaction so that cached items never expire compaction_interval: "" ``` ### Periodic Global Enrichment In the following example we enrich all messages with the same data obtained from a static URL with an `http` processor within a `branch`. However, we expect the data from this URL to change roughly every 10 minutes, so we configure a `cached` processor with a static key (since this request is consistent for all messages) and a TTL of `10m`. ```yaml pipeline: processors: - branch: request_map: 'root = ""' processors: - cached: key: static_foo cache: foo_cache ttl: 10m processors: - http: url: http://example.com/get/foo.json verb: GET result_map: 'root.foo = this' cache_resources: - label: foo_cache memory: {} ``` ## Fields ### `cache` The cache resource to read and write processor results from. **Type**: `string` ### `key` A key to be resolved for each message, if the key already exists in the cache then the cached result is used, otherwise the processors are applied and the result is cached under this key. The key could be static and therefore apply generally to all messages or it could be an interpolated expression that is potentially unique for each message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: key: my_foo_result # --- key: ${! this.document.id } # --- key: ${! meta("kafka_key") } # --- key: ${! meta("kafka_topic") } ``` ### `processors[]` The list of processors whose result will be cached. **Type**: `array` ### `skip_on` A condition that can be used to skip caching the results from the processors. **Type**: `string` ```yaml # Examples: skip_on: errored() ``` ### `ttl` An optional expiry period to set for each cache entry. Some caches only have a general TTL and will therefore ignore this setting. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` --- # Page 187: catch **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/catch.md --- # catch Applies a list of child processors _only_ when a previous processing step has failed. Behaves similarly to the [`for_each`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/for_each/) processor, where a list of child processors are applied to individual messages of a batch. However, processors are only applied to messages that failed a processing step prior to the catch. For example, with the following config: ```yaml pipeline: processors: - resource: foo - catch: - resource: bar - resource: baz ``` If the processor `foo` fails for a particular message, that message will be fed into the processors `bar` and `baz`. Messages that do not fail for the processor `foo` will skip these processors. When messages leave the catch block their fail flags are cleared. This processor is useful for when it’s possible to recover failed messages, or when special actions (such as logging/metrics) are required before dropping them. > 📝 **NOTE** > > When strict error handling (`error_handling.strict`) is enabled this processor does not recover anything, as a failed message short-circuits past it rather than reaching it. Use the [`try_catch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/try_catch/) processor instead, which contains both the fallible step and its recovery. More information about error handling can be found in [Error handling](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). ## Common ```yml processor: label: "" catch: [] ``` ## Advanced ```yml processor: label: "" catch: [] ``` --- # Page 188: cohere_chat **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cohere_chat.md --- # cohere_chat Generates responses to messages in a chat conversation, using the Cohere API. This processor sends the contents of user prompts to the Cohere API, which generates responses. By default, the processor submits the entire payload of each message as a string, unless you use the `prompt` configuration field to customize it. The model can also call external tools that you define in the `tools` field, and uses their results as supplementary context when it generates a response. To learn more about chat completion, see the [Cohere API documentation](https://docs.cohere.com/docs/chat-api). ### Common ```yml processor: label: "" cohere_chat: base_url: https://api.cohere.com api_key: "" # No default (required) model: "" # No default (required) prompt: "" # No default (optional) system_prompt: "" # No default (optional) max_tokens: 0 # No default (optional) temperature: 0 # No default (optional) response_format: text json_schema: "" # No default (optional) max_tool_calls: 10 tools: [] ``` ### Advanced ```yml processor: label: "" cohere_chat: base_url: https://api.cohere.com api_key: "" # No default (required) model: "" # No default (required) prompt: "" # No default (optional) system_prompt: "" # No default (optional) max_tokens: 0 # No default (optional) temperature: 0 # No default (optional) response_format: text json_schema: "" # No default (optional) schema_registry: url: "" # No default (required) subject: "" # No default (required) refresh_interval: "" # No default (optional) tls: skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] oauth: enabled: false consumer_key: "" consumer_secret: "" access_token: "" access_token_secret: "" basic_auth: enabled: false username: "" password: "" jwt: enabled: false private_key_file: "" signing_method: "" claims: {} headers: {} top_p: 0 # No default (optional) frequency_penalty: 0 # No default (optional) presence_penalty: 0 # No default (optional) seed: 0 # No default (optional) stop: [] # No default (optional) max_tool_calls: 10 tools: [] ``` ## Fields ### `api_key` Your API key for the Cohere API. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `base_url` The base URL to use for API requests. **Type**: `string` **Default**: `https://api.cohere.com` ### `frequency_penalty` A number between `0.0` and `1.0`. Higher values penalize new tokens more strongly based on the frequency of their appearance in the prompt and the text so far. This decreases the model’s likelihood to repeat the same line verbatim. **Type**: `float` ### `json_schema` The JSON schema to use when responding in `json_schema` format. To learn more about the JSON schema features supported, see the [Cohere documentation](https://docs.cohere.com/docs/structured-outputs-json). **Type**: `string` ### `max_tokens` The maximum number of tokens to allow in the chat completion. **Type**: `int` ### `max_tool_calls` The maximum number of tool calls the model can perform. **Type**: `int` **Default**: `10` ### `model` The name of the Cohere model you want to use. **Type**: `string` ```yaml # Examples: model: command-r-plus # --- model: command-r # --- model: command # --- model: command-light ``` ### `presence_penalty` A number between `0.0` and `1.0`. Higher values penalize new tokens more strongly if they have already appeared in the prompt or the text so far, regardless of how often. This increases the model’s likelihood to talk about new topics. **Type**: `float` ### `prompt` The user prompt you want to generate a response for. By default, the processor submits the entire payload of each message as a string. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `response_format` Choose the model’s output format. If `json_schema` is specified, then you must also configure a `json_schema` or `schema_registry`. **Type**: `string` **Default**: `text` **Options**: `text`, `json`, `json_schema` ### `schema_registry` The schema registry to dynamically load schemas from when responding in `json_schema` format. Schemas themselves must be in JSON format. To learn more about the JSON schema features supported, see the [Cohere documentation](https://docs.cohere.com/docs/structured-outputs-json). **Type**: `object` ### `schema_registry.basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `schema_registry.basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `schema_registry.jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `schema_registry.jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `schema_registry.jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `schema_registry.jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `schema_registry.jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `schema_registry.oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `schema_registry.oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `schema_registry.refresh_interval` The refresh rate for fetching the latest schema. If not specified the schema does not refresh. **Type**: `string` ### `schema_registry.subject` The subject name to fetch the schema for. **Type**: `string` ### `schema_registry.tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `schema_registry.tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `schema_registry.tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `schema_registry.tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `schema_registry.tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `schema_registry.tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `schema_registry.tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `schema_registry.url` The base URL of the schema registry service. **Type**: `string` ### `seed` If specified, the Cohere API makes a best effort to sample deterministically. Repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. **Type**: `int` ### `stop[]` Specify up to five sequences to stop the API from generating further tokens. **Type**: `array` ### `system_prompt` The system prompt to submit along with the user prompt. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `temperature` The sampling temperature, between `0` and `2`, that tunes the randomness of the generated text. Lower values make the output more focused and deterministic, and higher values make it more random. If you don’t set this field, the Cohere API uses its default of `0.3`. To increase randomness further, also raise `top_p`. **Type**: `float` ### `tools[]` External tools that the model can invoke, such as functions, APIs, or web browsing. You can define subpipelines of processors that implement these tools, enabling the model to use agent-like behavior to decide when and how to invoke them to enhance response generation. **Type**: `array` **Default**: `[]` ### `tools[].description` A description of this tool. The LLM uses it to decide whether to invoke the tool. **Type**: `string` ### `tools[].name` The name of this tool. **Type**: `string` ### `tools[].parameters` The parameters the LLM needs to provide to invoke this tool. **Type**: `object` ### `tools[].parameters.properties` The parameters the LLM can provide when it invokes this tool, keyed by parameter name. **Type**: `object` ### `tools[].parameters.properties.description` A description of this parameter. **Type**: `string` ### `tools[].parameters.properties.enum[]` The values this parameter is limited to. Leave empty to accept any value. **Type**: `array` **Default**: `[]` ### `tools[].parameters.properties.type` The type of this parameter. **Type**: `string` ### `tools[].parameters.required[]` The names of the parameters the LLM must provide when it invokes this tool. **Type**: `array` **Default**: `[]` ### `tools[].processors[]` The processors to run when the LLM invokes this tool. They receive a message whose payload is the tool call arguments as a JSON object, and their output is returned to the LLM as the tool result. **Type**: `array` ### `top_p` Nucleus sampling, sent to the Cohere API as the `p` parameter. The model considers only the most likely tokens whose total probability mass is `top_p`. The Cohere API accepts values from `0.01` to `0.99`, and uses `0.75` if you don’t set this field. **Type**: `float` ## Example In this pipeline configuration, the Command R+ model executes a number of processors, which make a tool call to retrieve weather data for a specific city. ```yaml input: generate: count: 1 mapping: | root = "What is the weather like in Chicago?" pipeline: processors: - cohere_chat: auth_token: my_cohere_api_token model: command-r-plus prompt: "${!content().string()}" tools: - name: GetWeather description: "Retrieve the weather for a specific city" parameters: required: ["city"] properties: city: type: string description: the city to look up the weather for processors: - http: verb: GET url: 'https://wttr.in/${!this.city}?T' headers: User-Agent: curl/8.11.1 # Returns a text string from the weather website output: stdout: {} ``` --- # Page 189: cohere_embeddings **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cohere_embeddings.md --- # cohere_embeddings Generates vector embeddings to represent input text, using the Cohere API. This processor sends text strings to the Cohere API, which generates vector embeddings. By default, the processor submits the entire payload of each message as a string, unless you use the `text_mapping` configuration field to customize it. To learn more about vector embeddings, see the [Cohere API documentation](https://docs.cohere.com/docs/embeddings). #### Common ```yml processor: label: "" cohere_embeddings: base_url: https://api.cohere.com api_key: "" # No default (required) model: "" # No default (required) text_mapping: "" # No default (optional) input_type: search_document dimensions: 0 # No default (optional) ``` #### Advanced ```yml processor: label: "" cohere_embeddings: base_url: https://api.cohere.com api_key: "" # No default (required) model: "" # No default (required) text_mapping: "" # No default (optional) input_type: search_document dimensions: 0 # No default (optional) ``` ## Examples ### Store embedding vectors in Qdrant Computes embeddings for some generated data and stores them in [Qdrant](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/qdrant/). ```yaml input: generate: interval: 1s mapping: | root = {"text": fake("paragraph")} pipeline: processors: - cohere_embeddings: model: embed-english-v3 api_key: "${COHERE_API_KEY}" text_mapping: "root = this.text" output: qdrant: grpc_host: localhost:6334 collection_name: "example_collection" id: "root = uuid_v4()" vector_mapping: "root = this" ``` ## Fields ### `api_key` Your API key for the Cohere API. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `base_url` The base URL to use for API requests. **Type**: `string` **Default**: `https://api.cohere.com` ### `dimensions` The number of dimensions (numerical values) in each vector embedding generated by this processor. This parameter only supports [`embed-v4.0`](https://docs.cohere.com/v2/docs/embeddings) and newer models. Possible values are `256`, `512`, `1024`, and `1536`. **Type**: `int` ### `input_type` The type of text input passed to the model. **Type**: `string` **Default**: `search_document` | Option | Summary | | --- | --- | | `classification` | Used for embeddings passed through a text classifier. | | `clustering` | Used for the embeddings run through a clustering algorithm. | | `search_document` | Used for embeddings stored in a vector database for search use-cases. | | `search_query` | Used for embeddings of search queries run against a vector DB to find relevant documents. | ### `model` The name of the Cohere model you want to use. **Type**: `string` ```yaml # Examples: model: embed-english-v3.0 # --- model: embed-english-light-v3.0 # --- model: embed-multilingual-v3.0 # --- model: embed-multilingual-light-v3.0 ``` ### `text_mapping` A Bloblang mapping that returns the text you want to generate vector embeddings for. By default, the processor submits the entire payload of each message as a string. **Type**: `string` --- # Page 190: cohere_rerank **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cohere_rerank.md --- # cohere_rerank Reranks a list of documents by their relevance to a query, using the Cohere API. This processor sends document strings to the [Cohere API](https://docs.cohere.com/reference/rerank), which reranks them based on the relevance to the query. To learn more about reranking, see the [Cohere API documentation](https://docs.cohere.com/docs/rerank-2). The output of this processor is an array of objects. Each object has the following fields: - `document`: The original document content. - `relevance_score`: How relevant the document is to the query. - `index`: The document’s position within the input documents array. The objects are ordered by their relevance score (highest first). #### Common ```yml processor: label: "" cohere_rerank: base_url: https://api.cohere.com api_key: "" # No default (required) model: "" # No default (required) query: "" # No default (required) documents: "" # No default (required) top_n: "0" max_tokens_per_doc: 4096 ``` #### Advanced ```yml processor: label: "" cohere_rerank: base_url: https://api.cohere.com api_key: "" # No default (required) model: "" # No default (required) query: "" # No default (required) documents: "" # No default (required) top_n: "0" max_tokens_per_doc: 4096 ``` ## Metadata - `relevance_scores`: An array of scores for each input document that indicates how relevant it is to the query. The scores are in the same order as the documents in the input. The higher the score, the more relevant the document. ## Examples ### Rerank some documents based on a query Rerank some documents based on a query ```yaml input: generate: interval: 1s mapping: | root = { "query": fake("sentence"), "docs": [fake("paragraph"), fake("paragraph"), fake("paragraph")], } pipeline: processors: - cohere_rerank: model: rerank-v3.5 api_key: "${COHERE_API_KEY}" query: "${!this.query}" documents: "root = this.docs" output: stdout: {} ``` ## Fields ### `api_key` Your API key for the Cohere API. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `base_url` The base URL to use for API requests. **Type**: `string` **Default**: `https://api.cohere.com` ### `documents` A list of text strings that are compared to the specified query. For optimal performance, Cohere recommends that you: - Send fewer than 1000 documents in a single request. - Send structured data in YAML format. **Type**: `string` ### `max_tokens_per_doc` This processor automatically truncates long documents to the specified number of tokens. **Type**: `int` **Default**: `4096` ### `model` The name of the Cohere model you want to use. **Type**: `string` ```yaml # Examples: model: rerank-v3.5 ``` ### `query` The search query you want to execute. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `top_n` The number of documents to return when the query is executed. If set to `0`, all documents are returned. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `0` --- # Page 191: compress **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/compress.md --- # compress Compresses messages according to the selected algorithm. Supported compression algorithms are: \[flate gzip lz4 pgzip snappy zlib\] The 'level' field might not apply to all algorithms. #### Common ```yml processor: label: "" compress: algorithm: flate # No default (required) level: -1 ``` #### Advanced ```yml processor: label: "" compress: algorithm: flate # No default (required) level: -1 ``` ## Fields ### `algorithm` The compression algorithm to use. **Type**: `string` **Options**: `flate`, `gzip`, `lz4`, `pgzip`, `snappy`, `zlib` ### `level` The level of compression to use. May not be applicable to all algorithms. **Type**: `int` **Default**: `-1` --- # Page 192: decompress **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/decompress.md --- # decompress Decompresses messages according to the selected algorithm. Supported decompression algorithms are: \[bzip2 flate gzip lz4 pgzip snappy zlib\] #### Common ```yml processor: label: "" decompress: algorithm: bzip2 # No default (required) ``` #### Advanced ```yml processor: label: "" decompress: algorithm: bzip2 # No default (required) ``` ## Fields ### `algorithm` The decompression algorithm to use. **Type**: `string` **Options**: `bzip2`, `flate`, `gzip`, `lz4`, `pgzip`, `snappy`, `zlib` --- # Page 193: dedupe **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/dedupe.md --- # dedupe Deduplicates messages by storing a key value in a cache using the `add` operator. If the key already exists within the cache it is dropped. Caches must be configured as resources, for more information check out the [cache documentation](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/). When using this processor with an output target that might fail you should always wrap the output within an indefinite [`retry`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/retry/) block. This ensures that during outages your messages aren’t reprocessed after failures, which would result in messages being dropped. ## Batch deduplication This processor enacts on individual messages only, in order to perform a deduplication on behalf of a batch (or window) of messages instead use the [`cache` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cache/#examples). ## Delivery guarantees Performing deduplication on a stream using a distributed cache voids any at-least-once guarantees that it previously had. This is because the cache will preserve message signatures even if the message fails to leave the Redpanda Connect pipeline, which would cause message loss in the event of an outage at the output sink followed by a restart of the Redpanda Connect instance (or a server crash, etc). This problem can be mitigated by using an in-memory cache and distributing messages to horizontally scaled Redpanda Connect pipelines partitioned by the deduplication key. However, in situations where at-least-once delivery guarantees are important it is worth avoiding deduplication in favour of implement idempotent behavior at the edge of your stream pipelines. ### Common ```yml processor: label: "" dedupe: cache: "" # No default (required) key: "" # No default (required) drop_on_err: true ``` ### Advanced ```yml processor: label: "" dedupe: cache: "" # No default (required) key: "" # No default (required) drop_on_err: true ``` ## Fields ### `cache` The [`cache` resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) to target with this processor. **Type**: `string` ### `drop_on_err` Whether messages should be dropped when the cache returns a general error such as a network issue. **Type**: `bool` **Default**: `true` ### `key` An interpolated string yielding the key to deduplicate by for each message. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: key: ${! meta("kafka_key") } # --- key: ${! content().hash("xxhash64") } ``` ## Examples ### Deduplicate based on Kafka key The following configuration demonstrates a pipeline that deduplicates messages based on the Kafka key. ```yaml pipeline: processors: - dedupe: cache: keycache key: ${! meta("kafka_key") } cache_resources: - label: keycache memory: default_ttl: 60s ``` --- # Page 194: for_each **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/for_each.md --- # for_each A processor that applies a list of child processors to messages of a batch as though they were each a batch of one message. This is useful for forcing batch wide processors such as [`dedupe`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/dedupe/) or interpolations such as the `value` field of the `metadata` processor to execute on individual message parts of a batch instead. Please note that most processors already process per message of a batch, and this processor is not needed in those cases. ## Common ```yml processor: label: "" for_each: [] ``` ## Advanced ```yml processor: label: "" for_each: [] ``` --- # Page 195: gcp_bigquery_select **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/gcp_bigquery_select.md --- # gcp_bigquery_select Executes a `SELECT` query against BigQuery and replaces messages with the rows returned. #### Common ```yml processor: label: "" gcp_bigquery_select: project: "" # No default (required) credentials_json: "" table: "" # No default (required) columns: [] # No default (required) where: "" # No default (optional) job_labels: {} args_mapping: "" # No default (optional) prefix: "" # No default (optional) suffix: "" # No default (optional) ``` #### Advanced ```yml processor: label: "" gcp_bigquery_select: project: "" # No default (required) credentials_json: "" table: "" # No default (required) columns: [] # No default (required) where: "" # No default (optional) job_labels: {} args_mapping: "" # No default (optional) prefix: "" # No default (optional) suffix: "" # No default (optional) ``` ## Examples ### Word count Given a stream of English terms, enrich the messages with the word count from Shakespeare’s public works: ```yaml pipeline: processors: - branch: processors: - gcp_bigquery_select: project: test-project table: bigquery-public-data.samples.shakespeare columns: - word - sum(word_count) as total_count where: word = ? suffix: | GROUP BY word ORDER BY total_count DESC LIMIT 10 args_mapping: root = [ this.term ] result_map: | root.count = this.get("0.total_count") ``` ## Fields ### `args_mapping` An optional [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that evaluates to an array of values for the `?` placeholders in the `where` field, in order. Each value is sent to BigQuery as a positional query parameter. **Type**: `string` ```yaml # Examples: args_mapping: root = [ "article", now().ts_format("2006-01-02") ] ``` ### `columns[]` A list of columns to query. **Type**: `array` ### `credentials_json` The Google Service Account credentials in JSON format (optional). Provide the contents of the credentials file as plain JSON, not Base64-encoded. Use this field to authenticate with Google Cloud services. If this field is empty, the component uses [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials). For more information about creating service account credentials, see [Google’s service account documentation](https://developers.google.com/workspace/guides/create-credentials#create_credentials_for_a_service_account). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `job_labels` A map of labels to add to the query job. **Type**: `object` **Default**: `{}` ### `prefix` Optional GoogleSQL text to add before the `SELECT` keyword of the generated query, for example a `WITH` clause. **Type**: `string` ### `project` The GCP project where the query job runs. **Type**: `string` ### `suffix` Optional GoogleSQL text to append after the generated query, for example `GROUP BY`, `ORDER BY`, or `LIMIT` clauses. **Type**: `string` ### `table` The fully-qualified name of the BigQuery table to query. **Type**: `string` ```yaml # Examples: table: bigquery-public-data.samples.shakespeare ``` ### `where` An optional `WHERE` clause to add to the query. The `args_mapping` field populates the placeholder arguments. Placeholders must always be question marks (`?`). **Type**: `string` ```yaml # Examples: where: type = ? and created_at > ? # --- where: user_id = ? ``` --- # Page 196: gcp_vertex_ai_chat **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/gcp_vertex_ai_chat.md --- # gcp_vertex_ai_chat Generates responses to messages in a chat conversation, using the Vertex AI API. This processor sends prompts to your chosen large language model (LLM) and generates text from the responses, using the Vertex AI API. For more information, see the [Vertex AI documentation](https://cloud.google.com/vertex-ai/docs). #### Common ```yml processor: label: "" gcp_vertex_ai_chat: project: "" # No default (required) credentials_json: "" # No default (optional) location: "" # No default (required) model: "" # No default (required) prompt: "" # No default (optional) history: "" # No default (optional) attachment: "" # No default (optional) temperature: 0 # No default (optional) max_tokens: 0 # No default (optional) response_format: text tools: [] ``` #### Advanced ```yml processor: label: "" gcp_vertex_ai_chat: project: "" # No default (required) credentials_json: "" # No default (optional) location: "" # No default (required) model: "" # No default (required) prompt: "" # No default (optional) system_prompt: "" # No default (optional) history: "" # No default (optional) attachment: "" # No default (optional) temperature: 0 # No default (optional) max_tokens: 0 # No default (optional) response_format: text top_p: 0 # No default (optional) top_k: 0 # No default (optional) stop: [] # No default (optional) presence_penalty: 0 # No default (optional) frequency_penalty: 0 # No default (optional) max_tool_calls: 10 tools: [] ``` ## Fields ### `attachment` Additional data like an image to send with the prompt to the model. The result of the mapping must be a byte array, and the content type is automatically detected. **Type**: `string` ```yaml # Examples: attachment: 'root = this.image.decode("base64") # decode base64 encoded image' ``` ### `credentials_json` An optional field to set a Google Service Account Credentials JSON. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `frequency_penalty` Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim. **Type**: `float` ### `history` Historical messages to include in the chat request. The result of the bloblang query should be an array of objects of the form of \[{"role": "", "content":""}\], where `role` is `user` or `model`. **Type**: `string` ### `location` Specify the location of a fine tuned model. For base models, you can omit this field. **Type**: `string` ```yaml # Examples: location: us-central1 ``` ### `max_tokens` The maximum number of output tokens to generate per message. **Type**: `int` ### `max_tool_calls` The maximum number of sequential tool calls. **Type**: `int` **Default**: `10` ### `model` The name of the LLM to use. For a full list of models, see the [Vertex AI Model Garden](https://console.cloud.google.com/vertex-ai/model-garden). **Type**: `string` ```yaml # Examples: model: gemini-1.5-pro-001 # --- model: gemini-1.5-flash-001 ``` ### `presence_penalty` Positive values penalize new tokens if they appear in the text already, increasing the model’s likelihood to include new topics. **Type**: `float` ### `project` The GCP project ID to use. **Type**: `string` ### `prompt` The user prompt you want to generate a response for. By default, the processor submits the entire payload of each message as a string. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `response_format` The format of the generated response. You must also prompt the model to output the appropriate response type. **Type**: `string` **Default**: `text` **Options**: `text`, `json` ### `stop[]` Sets the stop sequences to use. When the model encounters one of these sequences, it stops generating text and returns the final response. **Type**: `array` ### `system_prompt` The system prompt to submit along with the user prompt. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `temperature` Controls the randomness of predictions. **Type**: `float` ### `tools[]` The tools to allow the LLM to invoke. This allows building subpipelines that the LLM can choose to invoke to execute agentic-like actions. **Type**: `array` **Default**: `[]` ### `tools[].description` A description of this tool. The LLM uses it to decide whether to invoke the tool. **Type**: `string` ### `tools[].name` The name of this tool. **Type**: `string` ### `tools[].parameters` The parameters the LLM needs to provide to invoke this tool. **Type**: `object` ### `tools[].parameters.properties` The parameters the LLM can provide when it invokes this tool, keyed by parameter name. **Type**: `object` ### `tools[].parameters.properties.description` A description of this parameter. **Type**: `string` ### `tools[].parameters.properties.enum[]` The values this parameter is limited to. Leave empty to accept any value. **Type**: `array` **Default**: `[]` ### `tools[].parameters.properties.type` The type of this parameter. **Type**: `string` ### `tools[].parameters.required[]` The names of the parameters the LLM must provide when it invokes this tool. **Type**: `array` **Default**: `[]` ### `tools[].processors[]` The processors to run when the LLM invokes this tool. They receive a message whose payload is the tool call arguments as a JSON object, and their output is returned to the LLM as the tool result. **Type**: `array` ### `top_k` Enables top-k sampling (optional). **Type**: `float` ### `top_p` Enables nucleus sampling (optional). **Type**: `float` ## Examples ### Use processors as tool calls This example allows gemini to execute a subpipeline as a tool call to get more data. ```yaml input: generate: count: 1 mapping: | root = "What is the weather like in Chicago?" pipeline: processors: - gcp_vertex_ai_chat: model: gemini-2.5-flash-preview-05-20 project: my-project location: us-central1 prompt: "${!content().string()}" tools: - name: GetWeather description: "Retrieve the weather for a specific city" parameters: required: ["city"] properties: city: type: string description: the city to lookup the weather for processors: - http: verb: GET url: 'https://wttr.in/${!this.city}?T' headers: # Spoof curl user-agent to get a plaintext text User-Agent: curl/8.11.1 output: stdout: {} ``` --- # Page 197: gcp_vertex_ai_embeddings **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/gcp_vertex_ai_embeddings.md --- # gcp_vertex_ai_embeddings Generates vector embeddings to represent input text, using the Vertex AI API. This processor sends text strings to the Vertex AI API, which generates vector embeddings. By default, the processor submits the entire payload of each message as a string, unless you use the `text` configuration field to customize it. For more information, see the [Vertex AI documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings). #### Common ```yml processor: label: "" gcp_vertex_ai_embeddings: project: "" # No default (required) credentials_json: "" # No default (optional) location: us-central1 model: "" # No default (required) task_type: RETRIEVAL_DOCUMENT text: "" # No default (optional) output_dimensions: 0 # No default (optional) ``` #### Advanced ```yml processor: label: "" gcp_vertex_ai_embeddings: project: "" # No default (required) credentials_json: "" # No default (optional) location: us-central1 model: "" # No default (required) task_type: RETRIEVAL_DOCUMENT text: "" # No default (optional) output_dimensions: 0 # No default (optional) ``` ## Fields ### `credentials_json` Set your Google Service Account Credentials as JSON (optional). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `location` The location of the Vertex AI model that you want to use. **Type**: `string` **Default**: `us-central1` ### `model` The name of the embedding model to use. For a full list of models, see the [Vertex AI Model Garden](https://console.cloud.google.com/vertex-ai/model-garden). **Type**: `string` ```yaml # Examples: model: text-embedding-004 # --- model: text-multilingual-embedding-002 ``` ### `output_dimensions` The maximum length of a generated vector embedding. If this value is set, generated embeddings are truncated to this size. **Type**: `int` ### `project` The ID of your Google Cloud project. **Type**: `string` ### `task_type` Use the following options to optimize embeddings that the model generates for specific use cases. **Type**: `string` **Default**: `RETRIEVAL_DOCUMENT` | Option | Summary | | --- | --- | | `CLASSIFICATION` | optimize for being able classify texts according to preset labels | | `CLUSTERING` | optimize for clustering texts based on their similarities | | `FACT_VERIFICATION` | optimize for queries that are proving or disproving a fact such as "apples grow underground" | | `QUESTION_ANSWERING` | optimize for search proper questions such as "Why is the sky blue?" | | `RETRIEVAL_DOCUMENT` | optimize for documents that will be searched (also known as a corpus) | | `RETRIEVAL_QUERY` | optimize for queries such as "What is the best fish recipe?" or "best restaurant in Chicago" | | `SEMANTIC_SIMILARITY` | optimize for text similarity | ### `text` The text you want to generate vector embeddings for. By default, the processor submits the entire payload of each message as a string. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` --- # Page 198: google_drive_download **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/google_drive_download.md --- # google_drive_download Downloads files from Google Drive. Can download a file from Google Drive based on a file ID. ## Authentication By default, this connector will use [Google Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials) to authenticate with Google APIs. To use this mechanism locally, run these gcloud commands: ```bash # Log in for the application default credentials and add scopes for read-only Drive access gcloud auth application-default login --scopes='openid,https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/drive.readonly' # When logging in with a user account, you may need to set the quota project for the application default credentials gcloud auth application-default set-quota-project ``` Replace `` with your Google Cloud project ID. Otherwise if using a service account, you can create a JSON key for the service account and set it in the `credentials_json` field. In order for a service account to access files in Google Drive either files need to be explicitly shared with the service account email, otherwise [domain wide delegation](https://support.google.com/a/answer/162106) can be used to share all files within a Google Workspace. Try out the [example pipeline on this page](#examples), which downloads all files from your Google Drive. ### Common ```yml processor: label: "" google_drive_download: credentials_json: "" # No default (optional) file_id: "" # No default (required) mime_type: "" # No default (required) shared_drives: false ``` ### Advanced ```yml processor: label: "" google_drive_download: credentials_json: "" # No default (optional) file_id: "" # No default (required) mime_type: "" # No default (required) export_mime_types: application/vnd.google-apps.document: "text/markdown" application/vnd.google-apps.drawing: "image/png" application/vnd.google-apps.presentation: "application/pdf" application/vnd.google-apps.script: "application/vnd.google-apps.script+json" application/vnd.google-apps.spreadsheet: "text/csv" shared_drives: false ``` ## Fields ### `credentials_json` The JSON key for your service account (optional). If left empty, Application Default Credentials are used. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `export_mime_types` Maps Google Drive MIME types to [supported file export formats](https://developers.google.com/workspace/drive/api/guides/ref-export-formats). The MIME type is the key, and the export format is the value. **Type**: `object` **Default**: ```yaml application/vnd.google-apps.document: "text/markdown" application/vnd.google-apps.drawing: "image/png" application/vnd.google-apps.presentation: "application/pdf" application/vnd.google-apps.script: "application/vnd.google-apps.script+json" application/vnd.google-apps.spreadsheet: "text/csv" ``` ```yaml # Examples: export_mime_types: application/vnd.google-apps.document: application/pdf application/vnd.google-apps.drawing: application/pdf application/vnd.google-apps.presentation: application/pdf application/vnd.google-apps.spreadsheet: application/pdf # --- export_mime_types: application/vnd.google-apps.document: application/vnd.openxmlformats-officedocument.wordprocessingml.document application/vnd.google-apps.drawing: image/svg+xml application/vnd.google-apps.presentation: application/vnd.openxmlformats-officedocument.presentationml.presentation application/vnd.google-apps.spreadsheet: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet ``` ### `file_id` The ID of the file to download from Google Drive. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `mime_type` The [MIME type](https://developers.google.com/workspace/drive/api/guides/mime-types) of the file for download. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `shared_drives` Whether or not to include shared drives. **Type**: `bool` **Default**: `false` ## Examples ### Download files from Google Drive This examples downloads all the files from Google Drive ```yaml pipeline: processors: - google_drive_search: query: "name = 'Test Doc'" - google_drive_download: file_id: "${!this.id}" mime_type: "${!this.mimeType}" ``` --- # Page 199: google_drive_list_labels **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/google_drive_list_labels.md --- # google_drive_list_labels Lists labels for a file in Google Drive. For more about labels, see the [Google Drive labels guide](https://developers.google.com/workspace/drive/api/guides/about-labels). ## Authentication By default, this connector will use [Google Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials) to authenticate with Google APIs. To use this mechanism locally, run these gcloud commands: ```bash # Log in for the application default credentials and add scopes for read-only Drive access gcloud auth application-default login --scopes='openid,https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/drive.labels.readonly' # When logging in with a user account, you may need to set the quota project for the application default credentials gcloud auth application-default set-quota-project ``` Replace `` with your Google Cloud project ID. Otherwise if using a service account, you can create a JSON key for the service account and set it in the `credentials_json` field. In order for a service account to access files in Google Drive either files need to be explicitly shared with the service account email, otherwise [domain wide delegation](https://support.google.com/a/answer/162106) can be used to share all files within a Google Workspace. ### Common ```yml processor: label: "" google_drive_list_labels: credentials_json: "" # No default (optional) ``` ### Advanced ```yml processor: label: "" google_drive_list_labels: credentials_json: "" # No default (optional) ``` ## Fields ### `credentials_json` The JSON key for your service account (optional). If left empty, Application Default Credentials are used. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` --- # Page 200: google_drive_search **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/google_drive_search.md --- # google_drive_search Searches Google Drive for files matching the provided query. This processor searches for files in Google Drive using the provided query. Search results are emitted as message batch, where each message is a [Google Drive File](https://developers.google.com/workspace/drive/api/reference/rest/v3/files#File) ## Authentication By default, this connector will use [Google Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials) to authenticate with Google APIs. To use this mechanism locally, run these gcloud commands: ```bash # Log in for the application default credentials and add scopes for read-only Drive access gcloud auth application-default login --scopes='openid,https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/drive.readonly' # When logging in with a user account, you may need to set the quota project for the application default credentials gcloud auth application-default set-quota-project ``` Replace `` with your Google Cloud project ID. Otherwise if using a service account, you can create a JSON key for the service account and set it in the `credentials_json` field. In order for a service account to access files in Google Drive either files need to be explicitly shared with the service account email, otherwise [domain wide delegation](https://support.google.com/a/answer/162106) can be used to share all files within a Google Workspace. Try out the [example pipeline on this page](#examples), which searches for and downloads all Google Drive files that match the specified query. ### Common ```yml processor: label: "" google_drive_search: credentials_json: "" # No default (optional) query: "" # No default (required) projection: - "id" - "name" - "mimeType" - "size" - "labelInfo" include_label_ids: "" max_results: 64 shared_drives: false ``` ### Advanced ```yml processor: label: "" google_drive_search: credentials_json: "" # No default (optional) query: "" # No default (required) projection: - "id" - "name" - "mimeType" - "size" - "labelInfo" include_label_ids: "" max_results: 64 shared_drives: false ``` ## Fields ### `credentials_json` The JSON key for your service account (optional). If left empty, Application Default Credentials are used. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `include_label_ids` A comma delimited list of label IDs to include in the Google Drive search result. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `max_results` The maximum number of search results to return. **Type**: `int` **Default**: `64` ### `projection[]` Partial fields to include in the Google Drive search result. **Type**: `array` **Default**: ```yaml - "id" - "name" - "mimeType" - "size" - "labelInfo" ``` ### `query` Specify a search query to locate matching files in Google Drive. This field supports: - The same query syntax as the Google Drive UI - [Bloblang interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries) for dynamic query generation **Type**: `string` ### `shared_drives` Whether or not to include shared drives in the result. **Type**: `bool` **Default**: `false` ## Examples ### Search & download files from Google Drive This examples downloads all the files from Google Drive that are returned in the query ```yaml input: stdin: {} pipeline: processors: - google_drive_search: query: "${!content().string()}" - mutation: 'meta path = this.name' - google_drive_download: file_id: "${!this.id}" mime_type: "${!this.mimeType}" output: file: path: "${!@path}" codec: all-bytes ``` --- # Page 201: group_by_value **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/group_by_value.md --- # group_by_value Splits a batch of messages into N batches, where each resulting batch contains a group of messages determined by a [function interpolated string](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries) evaluated per message. This allows you to group messages using arbitrary fields within their content or metadata, process them individually, and send them to unique locations as per their group. The functionality of this processor depends on being applied across messages that are batched. You can find out more about batching [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). To further divide each group into individual messages, follow this processor with a [`split` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/split/). ### Common ```yml processor: label: "" group_by_value: value: "" # No default (required) ``` ### Advanced ```yml processor: label: "" group_by_value: value: "" # No default (required) ``` ## Fields ### `value` The interpolated string to group based on. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: value: ${! meta("kafka_key") } # --- value: ${! json("foo.bar") }-${! meta("baz") } ``` ## Examples If we were consuming Kafka messages and needed to group them by their key, archive the groups, and send them to S3 with the key as part of the path we could achieve that with the following: ```yaml pipeline: processors: - group_by_value: value: ${! meta("kafka_key") } - archive: format: tar - compress: algorithm: gzip output: aws_s3: bucket: TODO path: docs/${! meta("kafka_key") }/${! counter() }-${! timestamp_unix_nano() }.tar.gz ``` --- # Page 202: group_by **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/group_by.md --- # group_by Splits a [batch of messages](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/) into N batches, where each resulting batch contains a group of messages determined by a [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/). Once the groups are established a list of processors are applied to their respective grouped batch, which can be used to label the batch as per their grouping. Messages that do not pass the check of any specified group are placed in their own group. The functionality of this processor depends on being applied across messages that are batched. You can find out more about batching [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). To further divide each group into individual messages, follow this processor with a [`split` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/split/). #### Common ```yml processor: label: "" group_by: - check: "" # No default (required) processors: [] ``` #### Advanced ```yml processor: label: "" group_by: - check: "" # No default (required) processors: [] ``` ## Fields ### `check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that should return a boolean value indicating whether a message belongs to a given group. **Type**: `string` ```yaml # Examples: check: this.type == "foo" # --- check: this.contents.urls.contains("https://benthos.dev/") # --- check: "true" ``` ### `processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to execute on the newly formed group. **Type**: `array` **Default**: `[]` ## Examples ### Grouped Processing Imagine we have a batch of messages that we wish to split into a group of foos and everything else, which should be sent to different output destinations based on those groupings. We also need to send the foos as a tar gzip archive. For this purpose we can use the `group_by` processor with a [`switch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/switch/) output: ```yaml pipeline: processors: - group_by: - check: content().contains("this is a foo") processors: - archive: format: tar - compress: algorithm: gzip - mapping: 'meta grouping = "foo"' output: switch: cases: - check: meta("grouping") == "foo" output: gcp_pubsub: project: foo_prod topic: only_the_foos - output: gcp_pubsub: project: somewhere_else topic: no_foos_here ``` --- # Page 203: http **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/http.md --- # http Performs an HTTP request using a message batch as the request body, and replaces the original message parts with the body of the response. The `rate_limit` field can be used to specify a rate limit [resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/about/) to cap the rate of requests across all parallel components service wide. The URL and header values of this type can be dynamically set using function interpolations described [here](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). In order to map or encode the payload to a specific request body, and map the response back into the original payload instead of replacing it entirely, you can use the [`branch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/). ## Response codes Redpanda Connect considers any response code between 200 and 299 inclusive to indicate a successful response, you can add more success status codes with the field `successful_on`. When a request returns a response code within the `backoff_on` field it will be retried after increasing intervals. When a request returns a response code within the `drop_on` field it will not be reattempted and is immediately considered a failed request. ## Add metadata If the request returns an error response code this processor sets a metadata field `http_status_code` on the resulting message. Use the field `extract_headers` to specify rules for which other headers should be copied into the resulting message from the response. ## Error handling When all retry attempts for a message are exhausted the processor cancels the attempt. These failed messages will continue through the pipeline unchanged, but can be dropped or placed in a dead letter queue according to your config, you can read about [these patterns](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). ### Common ```yml processor: label: "" http: url: "" # No default (required) verb: POST headers: {} rate_limit: "" # No default (optional) timeout: 5s parallel: false ``` ### Advanced ```yml processor: label: "" http: url: "" # No default (required) verb: POST headers: {} metadata: include_prefixes: [] include_patterns: [] dump_request_log_level: "" oauth: enabled: false consumer_key: "" consumer_secret: "" access_token: "" access_token_secret: "" oauth2: enabled: false client_key: "" client_secret: "" token_url: "" scopes: [] endpoint_params: {} basic_auth: enabled: false username: "" password: "" jwt: enabled: false private_key_file: "" signing_method: "" claims: {} headers: {} tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] extract_headers: include_prefixes: [] include_patterns: [] rate_limit: "" # No default (optional) timeout: 5s retry_period: 1s max_retry_backoff: 300s retries: 3 follow_redirects: true backoff_on: - 429 drop_on: [] successful_on: [] proxy_url: "" # No default (optional) disable_http2: false batch_as_multipart: false parallel: false ``` ## Fields ### `backoff_on[]` A list of status codes that indicate a request failure and trigger retries with an increasing backoff period between attempts. **Type**: `array` **Default**: ```yaml - 429 ``` ### `basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `batch_as_multipart` When set to `true`, sends all messages in a batch as a single request using [RFC1341](https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html). When set to `false`, sends messages in a batch as individual requests. **Type**: `bool` **Default**: `false` ### `disable_http2` Whether to disable HTTP/2. By default, HTTP/2 is enabled. **Type**: `bool` **Default**: `false` ### `drop_on[]` A list of status codes that indicate a request failure where retries should not be attempted. This helps avoid unnecessary retries for requests that are unlikely to succeed. > 📝 **NOTE** > > In these cases, the _request_ is dropped, but the _message_ that triggered the request is retained. **Type**: `array` **Default**: `[]` ### `dump_request_log_level` EXPERIMENTAL: Set the logging level for the request and response payloads of each HTTP request. **Type**: `string` **Default**: `""` **Options**: `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL`, `""` ### `extract_headers` Specify which response headers to add to the resulting messages as metadata. Header keys are automatically converted to lowercase before matching, so make sure that your patterns target the lowercase versions of the expected header keys. **Type**: `object` ### `extract_headers.include_patterns[]` A list of explicit metadata key regular expression (re2) patterns to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_patterns: - .* # --- include_patterns: - _timestamp_unix$ ``` ### `extract_headers.include_prefixes[]` A list of explicit metadata key prefixes to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_prefixes: - foo_ - bar_ # --- include_prefixes: - kafka_ # --- include_prefixes: - content- ``` ### `follow_redirects` Whether to transparently follow redirects, that is, responses with HTTP status codes in the 300-399 range. If set to `false`, the response message includes the body, status, and headers from the redirect response, and the component does not make a request to the URL specified in the `Location` header. **Type**: `bool` **Default**: `true` ### `headers` A map of headers to add to the request. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` **Default**: `{}` ```yaml # Examples: headers: Content-Type: application/octet-stream traceparent: ${! tracing_span().traceparent } ``` ### `jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `max_retry_backoff` The maximum period to wait between failed requests. **Type**: `string` **Default**: `300s` ### `metadata` Specify matching rules that determine which metadata keys should be added to the HTTP request as headers. **Type**: `object` ### `metadata.include_patterns[]` A list of explicit metadata key regular expression (re2) patterns to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_patterns: - .* # --- include_patterns: - _timestamp_unix$ ``` ### `metadata.include_prefixes[]` A list of explicit metadata key prefixes to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_prefixes: - foo_ - bar_ # --- include_prefixes: - kafka_ # --- include_prefixes: - content- ``` ### `oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `oauth2` Configures authentication with OAuth version 2 using the client credentials token flow. To exchange a refresh token instead, add a `grant_type` parameter with the value `refresh_token` and a `refresh_token` parameter with the token to `endpoint_params`. **Type**: `object` ### `oauth2.client_key` A value used to identify the client to the token provider. **Type**: `string` **Default**: `""` ### `oauth2.client_secret` The secret used to establish ownership of the client key. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth2.enabled` Whether to use OAuth version 2 in requests. **Type**: `bool` **Default**: `false` ### `oauth2.endpoint_params` A map of optional parameters to send to the token provider with client credentials token requests. Each value must be an array of strings. **Type**: `object` **Default**: `{}` ```yaml # Examples: endpoint_params: audience: - https://example.com resource: - https://api.example.com ``` ### `oauth2.scopes[]` A list of requested permissions (optional). **Type**: `array` **Default**: `[]` ### `oauth2.token_url` The URL of the token provider. **Type**: `string` **Default**: `""` ### `parallel` When processing batched messages, this field determines whether messages in the batch are sent in parallel. If set to `false`, messages are sent serially. **Type**: `bool` **Default**: `false` ### `proxy_url` An HTTP proxy URL (optional). **Type**: `string` ### `rate_limit` A [rate limit](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/about/) to throttle requests by (optional). **Type**: `string` ### `retries` The maximum number of retry attempts to make. **Type**: `int` **Default**: `3` ### `retry_period` The period to wait between failed requests before retrying. For status codes listed in `backoff_on`, this is the starting period, which increases with each attempt up to `max_retry_backoff`. **Type**: `string` **Default**: `1s` ### `successful_on[]` A list of HTTP status codes that should be considered successful, even if they are not 2XX codes. This is useful for handling cases where non-2XX codes indicate that the request was processed successfully, such as `303 See Other` or `409 Conflict`. By default, all 2XX codes are considered successful unless they are specified in the `backoff_on` or `drop_on` fields, regardless of this field. **Type**: `array` **Default**: `[]` ### `timeout` A static timeout to apply to requests. **Type**: `string` **Default**: `5s` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL to connect to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `verb` A verb to connect with. **Type**: `string` **Default**: `POST` ```yaml # Examples: verb: POST # --- verb: GET # --- verb: DELETE ``` ## Examples ### Branched Request This example uses a [`branch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/) to strip the request message into an empty body, grab an HTTP payload, and place the result back into the original message at the path `repo.status`: ```yaml pipeline: processors: - branch: request_map: 'root = ""' processors: - http: url: https://hub.docker.com/v2/repositories/jeffail/benthos verb: GET headers: Content-Type: application/json result_map: 'root.repo.status = this' ``` --- # Page 204: insert_part **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/insert_part.md --- # insert_part Insert a new message into a batch at an index. If the specified index is greater than the length of the existing batch it will be appended to the end. The index can be negative, and if so the message will be inserted from the end counting backwards starting from -1. E.g. if index = -1 then the new message will become the last of the batch, if index = -2 then the new message will be inserted before the last message, and so on. If the negative index is greater than the length of the existing batch it will be inserted at the beginning. The new message will have metadata copied from the first pre-existing message of the batch. This processor will interpolate functions within the 'content' field, you can find a list of functions [here](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). #### Common ```yml processor: label: "" insert_part: index: -1 content: "" ``` #### Advanced ```yml processor: label: "" insert_part: index: -1 content: "" ``` ## Fields ### `content` The content of the message being inserted. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ### `index` The index within the batch to insert the message at. **Type**: `int` **Default**: `-1` --- # Page 205: jira **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/jira.md --- # jira > ⚠️ **WARNING: Deprecated in 4.100.0** > > Deprecated in 4.100.0 > > This component is deprecated and will be removed in the next major version release. To stream Jira issues, comments, or changelog entries, use the [`jira` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/jira/) instead. Queries Jira resources and returns structured data. > 📝 **NOTE** > > This component isn’t available in [GPU-enabled pipelines](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/resource-management/). #### Common ```yaml processor: label: "" jira: username: "" # No default (required) api_token: "" # No default (required) max_results_per_page: 50 base_url: "" # No default (required) timeout: 5s ``` #### Advanced ```yaml processor: label: "" jira: username: "" # No default (required) api_token: "" # No default (required) max_results_per_page: 50 base_url: "" # No default (required) timeout: 5s tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] proxy_url: "" disable_http2: false tps_limit: 0 tps_burst: 1 backoff: initial_interval: 1s max_interval: 30s max_retries: 3 tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s http: max_idle_conns: 100 max_idle_conns_per_host: 0 max_conns_per_host: 64 idle_conn_timeout: 1m30s tls_handshake_timeout: 10s expect_continue_timeout: 1s response_header_timeout: 0s disable_keep_alives: false disable_compression: false max_response_header_bytes: 1048576 max_response_body_bytes: 10485760 write_buffer_size: 4096 read_buffer_size: 4096 h2: strict_max_concurrent_requests: false max_decoder_header_table_size: 4096 max_encoder_header_table_size: 4096 max_read_frame_size: 16384 max_receive_buffer_per_connection: 1048576 max_receive_buffer_per_stream: 1048576 send_ping_timeout: 0s ping_timeout: 15s write_byte_timeout: 0s access_log_level: "" access_log_body_limit: 0 ``` Executes Jira API queries based on input messages and returns structured results. The processor handles pagination, retries, and field expansion automatically. Supports querying the following Jira resources: - Issues (JQL queries) - Issue transitions - Users - Roles - Project versions - Project categories - Project types - Projects The processor authenticates using basic authentication with username and API token. Input messages should contain valid Jira queries in JSON format. Set `base_url` to the URL of your Jira instance, for example `https://your-domain.atlassian.net`. ## Fields ### `access_log_body_limit` Maximum bytes of request/response body to include in logs. 0 to skip body logging. **Type**: `int` **Default**: `0` ### `access_log_level` Log level for HTTP request/response logging. Empty disables logging. **Type**: `string` **Default**: `""` **Options**: `""`, `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR` ### `api_token` The Jira API token for the specified account. You can generate an API token from your [Atlassian account settings](https://id.atlassian.com/manage-profile/security/api-tokens). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `backoff` Adaptive backoff configuration for 429 (Too Many Requests) responses. Always active. **Type**: `object` ### `backoff.initial_interval` Initial interval between retries on 429 responses. **Type**: `string` **Default**: `1s` ### `backoff.max_interval` Maximum interval between retries on 429 responses. **Type**: `string` **Default**: `30s` ### `backoff.max_retries` Maximum number of retries on 429 responses. **Type**: `int` **Default**: `3` ### `base_url` The base URL of the target service (for example, `https://api.example.com`). TLS is enabled automatically for `https` URLs. **Type**: `string` ### `disable_http2` Disable HTTP/2 and force HTTP/1.1. **Type**: `bool` **Default**: `false` ### `http` HTTP transport settings controlling connection pooling, timeouts, and HTTP/2. **Type**: `object` ### `http.disable_compression` Disable automatic decompression of gzip responses. **Type**: `bool` **Default**: `false` ### `http.disable_keep_alives` Disable HTTP keep-alive connections; each request uses a new connection. **Type**: `bool` **Default**: `false` ### `http.expect_continue_timeout` Maximum time to wait for a server’s 100-continue response before sending the body. 0 means the body is sent immediately. **Type**: `string` **Default**: `1s` ### `http.h2` HTTP/2-specific transport settings. Only applied when HTTP/2 is enabled. **Type**: `object` ### `http.h2.max_decoder_header_table_size` Upper limit in bytes for the HPACK header table used to decode headers from the peer. Must be less than 4 MiB. **Type**: `int` **Default**: `4096` ### `http.h2.max_encoder_header_table_size` Upper limit in bytes for the HPACK header table used to encode headers sent to the peer. Must be less than 4 MiB. **Type**: `int` **Default**: `4096` ### `http.h2.max_read_frame_size` Largest HTTP/2 frame this endpoint will read. Valid range: 16 KiB to 16 MiB. **Type**: `int` **Default**: `16384` ### `http.h2.max_receive_buffer_per_connection` Maximum flow-control window size in bytes for data received on a connection. Must be at least 64 KiB and less than 4 MiB. **Type**: `int` **Default**: `1048576` ### `http.h2.max_receive_buffer_per_stream` Maximum flow-control window size in bytes for data received on a single stream. Must be less than 4 MiB. **Type**: `int` **Default**: `1048576` ### `http.h2.ping_timeout` Timeout waiting for a PING response before closing the connection. **Type**: `string` **Default**: `15s` ### `http.h2.send_ping_timeout` Idle timeout after which a PING frame is sent to verify connection health. 0 disables health checks. **Type**: `string` **Default**: `0s` ### `http.h2.strict_max_concurrent_requests` When true, new requests block when a connection’s concurrency limit is reached instead of opening a new connection. **Type**: `bool` **Default**: `false` ### `http.h2.write_byte_timeout` Timeout for writing data to a connection. The timer resets whenever bytes are written. 0 disables the timeout. **Type**: `string` **Default**: `0s` ### `http.idle_conn_timeout` How long an idle connection remains in the pool before being closed. 0 disables the timeout. **Type**: `string` **Default**: `1m30s` ### `http.max_conns_per_host` Maximum total connections (active + idle) per host. 0 means unlimited. **Type**: `int` **Default**: `64` ### `http.max_idle_conns` Maximum total number of idle (keep-alive) connections across all hosts. 0 means unlimited. **Type**: `int` **Default**: `100` ### `http.max_idle_conns_per_host` Maximum idle connections to keep per host. 0 (the default) uses GOMAXPROCS+1. **Type**: `int` **Default**: `0` ### `http.max_response_body_bytes` Maximum bytes of response body the client will read. The response body is wrapped with a limit reader; reads beyond this cap return EOF. 0 disables the limit. **Type**: `int` **Default**: `10485760` ### `http.max_response_header_bytes` Maximum bytes of response headers to allow. **Type**: `int` **Default**: `1048576` ### `http.read_buffer_size` Size in bytes of the per-connection read buffer. **Type**: `int` **Default**: `4096` ### `http.response_header_timeout` Maximum time to wait for response headers after writing the full request. 0 disables the timeout. **Type**: `string` **Default**: `0s` ### `http.tls_handshake_timeout` Maximum time to wait for a TLS handshake to complete. 0 disables the timeout. **Type**: `string` **Default**: `10s` ### `http.write_buffer_size` Size in bytes of the per-connection write buffer. **Type**: `int` **Default**: `4096` ### `max_results_per_page` The maximum number of results to return per page when calling the Jira API. [Pagination](https://docs.atlassian.com/software/jira/docs/api/REST/9.17.0/#pagination) in the Jira API is zero-based, so the first page starts at `0`. **Type**: `int` **Default**: `50` ### `proxy_url` HTTP proxy URL. Empty string disables proxying. **Type**: `string` **Default**: `""` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `timeout` HTTP request timeout. **Type**: `string` **Default**: `5s` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `tps_burst` Maximum burst size for rate limiting. **Type**: `int` **Default**: `1` ### `tps_limit` Rate limit in requests per second. 0 disables rate limiting. **Type**: `float` **Default**: `0` ### `username` The username or email address of the Jira account. **Type**: `string` ## Examples ### Minimal configuration Basic Jira processor setup with required fields only ```yaml pipeline: processors: - jira: base_url: "https://your-domain.atlassian.net" username: "${JIRA_USERNAME}" api_token: "${JIRA_API_TOKEN}" ``` ### Full configuration with tuning Complete configuration with pagination and timeout settings ```yaml pipeline: processors: - jira: base_url: "https://your-domain.atlassian.net" username: "${JIRA_USERNAME}" api_token: "${JIRA_API_TOKEN}" max_results_per_page: 200 timeout: "30s" ``` --- # Page 206: jmespath **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/jmespath.md --- # jmespath Executes a [JMESPath query](http://jmespath.org/) on JSON documents and replaces the message with the resulting document. > 💡 **TIP: Try out Bloblang** > > Try out Bloblang > > For better performance and improved capabilities try native Redpanda Connect mapping with the [`mapping` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mapping/). #### Common ```yml processor: label: "" jmespath: query: "" # No default (required) ``` #### Advanced ```yml processor: label: "" jmespath: query: "" # No default (required) ``` ## Fields ### `query` The JMESPath query to apply to messages. **Type**: `string` ## Examples ### Mapping When receiving JSON documents of the form: ```json { "locations": [ {"name": "Seattle", "state": "WA"}, {"name": "New York", "state": "NY"}, {"name": "Bellevue", "state": "WA"}, {"name": "Olympia", "state": "WA"} ] } ``` We could collapse the location names from the state of Washington into a field `Cities`: ```json {"Cities": "Bellevue, Olympia, Seattle"} ``` With the following config: ```yaml pipeline: processors: - jmespath: query: "locations[?state == 'WA'].name | sort(@) | {Cities: join(', ', @)}" ``` --- # Page 207: jq **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/jq.md --- # jq Transforms and filters messages using jq queries. > 💡 **TIP: Try out Bloblang** > > Try out Bloblang > > For better performance and improved capabilities try out native Redpanda Connect mapping with the [`mapping` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mapping/). The provided query is executed on each message, targeting either the contents as a structured JSON value or as a raw string using the field `raw`, and the message is replaced with the query result. Message metadata is also accessible within the query from the variable `$metadata`. This processor uses the [gojq library](https://github.com/itchyny/gojq), and therefore does not require jq to be installed as a dependency. However, this also means there are some [differences in how these queries are executed](https://github.com/itchyny/gojq#difference-to-jq) versus the jq cli. If the query does not emit any value then the message is filtered, if the query returns multiple values then the resulting message will be an array containing all values. The full query syntax is described in [jq’s documentation](https://stedolan.github.io/jq/manual/). ## Error handling Queries can fail, in which case the message remains unchanged, errors are logged, and the message is flagged as having failed, allowing you to use [standard processor error handling patterns](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). ### Common ```yml processor: label: "" jq: query: "" # No default (required) ``` ### Advanced ```yml processor: label: "" jq: query: "" # No default (required) raw: false output_raw: false ``` ## Fields ### `output_raw` Whether to output raw text (unquoted) instead of JSON strings when the emitted values are string types. **Type**: `bool` **Default**: `false` ### `query` The jq query to filter and transform messages with. **Type**: `string` ### `raw` Whether to process the input as a raw string instead of as JSON. **Type**: `bool` **Default**: `false` ## Examples ### Mapping When receiving JSON documents of the form: ```json { "locations": [ {"name": "Seattle", "state": "WA"}, {"name": "New York", "state": "NY"}, {"name": "Bellevue", "state": "WA"}, {"name": "Olympia", "state": "WA"} ] } ``` We could collapse the location names from the state of Washington into a field `Cities`: ```json {"Cities": "Bellevue, Olympia, Seattle"} ``` With the following config: ```yaml pipeline: processors: - jq: query: '{Cities: .locations | map(select(.state == "WA").name) | sort | join(", ") }' ``` --- # Page 208: json_schema **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/json_schema.md --- # json_schema Checks messages against a provided JSONSchema definition but does not change the payload under any circumstances. If a message does not match the schema it can be caught using [error handling methods](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). Please refer to the [JSON Schema website](https://json-schema.org/) for information and tutorials regarding the syntax of the schema. ### Common ```yml processor: label: "" json_schema: schema: "" # No default (optional) schema_path: "" # No default (optional) ``` ### Advanced ```yml processor: label: "" json_schema: schema: "" # No default (optional) schema_path: "" # No default (optional) ``` ## Fields ### `schema` A schema to apply. Use either this or the `schema_path` field. **Type**: `string` ### `schema_path` The path of a schema document to apply. Use either this or the `schema` field. **Type**: `string` ## Examples With the following JSONSchema document: ```json { "$id": "https://example.com/person.schema.json", "$schema": "http://json-schema.org/draft-07/schema#", "title": "Person", "type": "object", "properties": { "firstName": { "type": "string", "description": "The person's first name." }, "lastName": { "type": "string", "description": "The person's last name." }, "age": { "description": "Age in years which must be equal to or greater than zero.", "type": "integer", "minimum": 0 } } } ``` And the following Redpanda Connect configuration: ```yaml pipeline: processors: - json_schema: schema_path: "file://path_to_schema.json" - catch: - log: level: ERROR message: "Schema validation failed due to: ${!error()}" - mapping: 'root = deleted()' # Drop messages that fail ``` If a payload being processed looked like: ```json {"firstName":"John","lastName":"Doe","age":-21} ``` Then a log message would appear explaining the fault and the payload would be dropped. --- # Page 209: log **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/log.md --- # log Prints a log event for each message. Messages always remain unchanged. The log message can be set using function interpolations described in [Bloblang queries](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries) which allows you to log the contents and metadata of messages. The `level` field determines the log level of the printed events and can be any of the following values: TRACE, DEBUG, INFO, WARN, ERROR. ## Structured fields It’s also possible add custom fields to logs when the format is set to a structured form such as `json` or `logfmt` with the config field [`fields_mapping`](#fields_mapping): ```yaml pipeline: processors: - log: level: DEBUG message: hello world fields_mapping: | root.reason = "cus I wana" root.id = this.id root.age = this.user.age root.kafka_topic = meta("kafka_topic") ``` ### Common ```yml processor: label: "" log: level: INFO fields_mapping: "" # No default (optional) message: "" ``` ### Advanced ```yml processor: label: "" log: level: INFO fields_mapping: "" # No default (optional) message: "" ``` ## Fields ### `fields_mapping` An optional [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that can be used to specify extra fields to add to the log. If log fields are also added with the `fields` field then those values will override matching keys from this mapping. **Type**: `string` ```yaml # Examples: fields_mapping: |- root.reason = "cus I wana" root.id = this.id root.age = this.user.age.number() root.kafka_topic = meta("kafka_topic") ``` ### `level` The log level to use. **Type**: `string` **Default**: `INFO` **Options**: `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE` ### `message` The message to print. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` --- # Page 210: mapping **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mapping.md --- # mapping Executes a [Bloblang](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) mapping on messages, creating a new document that replaces (or filters) the original message. Bloblang is a powerful language that enables a wide range of mapping, transformation and filtering tasks. For more information, see [About Bloblang](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/). If your mapping is large and you’d prefer for it to live in a separate file then you can execute a mapping directly from a file with the expression `from ""`, where the path must be absolute, or relative from the location that Redpanda Connect is executed from. Note: This processor is equivalent to the [Bloblang](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/bloblang/#component-rename) one. The latter will be deprecated in a future release. ## Input document immutability Mapping operates by creating an entirely new object during assignments, this has the advantage of treating the original referenced document as immutable and therefore queryable at any stage of your mapping. For example, with the following mapping: ```coffeescript root.id = this.id root.invitees = this.invitees.filter(i -> i.mood >= 0.5) root.rejected = this.invitees.filter(i -> i.mood < 0.5) ``` Notice that we mutate the value of `invitees` in the resulting document by filtering out objects with a lower mood. However, even after doing so we’re still able to reference the unchanged original contents of this value from the input document in order to populate a second field. Within this mapping we also have the flexibility to reference the mutable mapped document by using the keyword `root` (i.e. `root.invitees`) on the right-hand side instead. Mapping documents is advantageous in situations where the result is a document with a dramatically different shape to the input document, since we are effectively rebuilding the document in its entirety and might as well keep a reference to the unchanged input document throughout. However, in situations where we are only performing minor alterations to the input document, the rest of which is unchanged, it might be more efficient to use the [`mutation` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mutation/) instead. ## Error handling Bloblang mappings can fail, in which case the message remains unchanged, errors are logged, and the message is flagged as having failed, allowing you to use [standard processor error handling patterns](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). However, Bloblang itself also provides powerful ways of ensuring your mappings do not fail by specifying desired [fallback behavior](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/#error-handling). ### Common ```yml processor: label: "" mapping: "" # No default (required) ``` ### Advanced ```yml processor: label: "" mapping: "" # No default (required) ``` ## Examples ### Mapping Given JSON documents containing an array of fans: ```json { "id":"foo", "description":"a show about foo", "fans":[ {"name":"bev","obsession":0.57}, {"name":"grace","obsession":0.21}, {"name":"ali","obsession":0.89}, {"name":"vic","obsession":0.43} ] } ``` We can reduce the documents down to just the ID and only those fans with an obsession score above 0.5, giving us: ```json { "id":"foo", "fans":[ {"name":"bev","obsession":0.57}, {"name":"ali","obsession":0.89} ] } ``` With the following config: ```yaml pipeline: processors: - mapping: | root.id = this.id root.fans = this.fans.filter(fan -> fan.obsession > 0.5) ``` ### More Mapping When receiving JSON documents of the form: ```json { "locations": [ {"name": "Seattle", "state": "WA"}, {"name": "New York", "state": "NY"}, {"name": "Bellevue", "state": "WA"}, {"name": "Olympia", "state": "WA"} ] } ``` We could collapse the location names from the state of Washington into a field `Cities`: ```json {"Cities": "Bellevue, Olympia, Seattle"} ``` With the following config: ```yaml pipeline: processors: - mapping: | root.Cities = this.locations. filter(loc -> loc.state == "WA"). map_each(loc -> loc.name). sort().join(", ") ``` --- # Page 211: metric **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/metric.md --- # metric Emit custom metrics by extracting values from messages. This processor works by evaluating an [interpolated field `value`](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries) for each message and updating a emitted metric according to the [type](#types). Custom metrics such as these are emitted along with Redpanda Connect internal metrics, where you can customize where metrics are sent, which metric names are emitted and rename them as/when appropriate. For more information see the [metrics docs](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/about/). #### Common ```yml processor: label: "" metric: type: counter # No default (required) name: "" # No default (required) labels: {} # No default (optional) value: "" ``` #### Advanced ```yml processor: label: "" metric: type: counter # No default (required) name: "" # No default (required) labels: {} # No default (optional) value: "" ``` ## Fields ### `labels` A map of label names and values that can be used to enrich metrics. Labels are not supported by some metric destinations, in which case the metrics series are combined. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` ```yaml # Examples: labels: topic: ${! meta("kafka_topic") } type: ${! json("doc.type") } ``` ### `name` The name of the metric to create, this must be unique across all Redpanda Connect components otherwise it will overwrite those other metrics. **Type**: `string` ### `type` The metric [type](#types) to create. **Type**: `string` **Options**: `counter`, `counter_by`, `gauge`, `timing` ### `value` For some metric types specifies a value to set, increment. Certain metrics exporters such as Prometheus support floating point values, but those that do not will cast a floating point value into an integer. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` **Default**: `""` ## Examples ### Counter In this example we emit a counter metric called `Foos`, which increments for every message processed, and we label the metric with some metadata about where the message came from and a field from the document that states what type it is. We also configure our metrics to emit to CloudWatch, and explicitly only allow our custom metric and some internal Redpanda Connect metrics to emit. ```yaml pipeline: processors: - metric: name: Foos type: counter labels: topic: ${! meta("kafka_topic") } partition: ${! meta("kafka_partition") } type: ${! json("document.type").or("unknown") } metrics: mapping: | root = if ![ "Foos", "input_received", "output_sent" ].contains(this) { deleted() } aws_cloudwatch: namespace: ProdConsumer ``` ### Gauge In this example we emit a gauge metric called `FooSize`, which is given a value extracted from JSON messages at the path `foo.size`. We then also configure our Prometheus metric exporter to only emit this custom metric and nothing else. We also label the metric with some metadata. ```yaml pipeline: processors: - metric: name: FooSize type: gauge labels: topic: ${! meta("kafka_topic") } value: ${! json("foo.size") } metrics: mapping: 'if this != "FooSize" { deleted() }' prometheus: {} ``` ## Types ### `counter` Increments a counter by exactly 1, the contents of `value` are ignored by this type. ### `counter_by` If the contents of `value` can be parsed as a positive integer value then the counter is incremented by this value. For example, the following configuration will increment the value of the `count.custom.field` metric by the contents of `field.some.value`: ```yaml pipeline: processors: - metric: type: counter_by name: CountCustomField value: ${!json("field.some.value")} ``` ### `gauge` If the contents of `value` can be parsed as a positive integer value then the gauge is set to this value. For example, the following configuration will set the value of the `gauge.custom.field` metric to the contents of `field.some.value`: ```yaml pipeline: processors: - metric: type: gauge name: GaugeCustomField value: ${!json("field.some.value")} ``` ### `timing` Equivalent to `gauge` where instead the metric is a timing. It is recommended that timing values are recorded in nanoseconds in order to be consistent with standard Redpanda Connect timing metrics, as in some cases these values are automatically converted into other units such as when exporting timings as histograms with Prometheus metrics. --- # Page 212: mongodb **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mongodb.md --- # mongodb Performs operations against MongoDB for each message, allowing you to store or retrieve data within message payloads. > 📝 **NOTE** > > If the service only accepts connections from allowlisted IP addresses, add your cluster’s egress addresses to its allowlist before you deploy the pipeline. On BYOC clusters, see [Allow Pipeline Traffic Through External Firewalls](https://docs.redpanda.com/cloud-data-platform/networking/connect-external-allowlist/) to find the addresses. For Dedicated or Serverless clusters, contact Redpanda support for the addresses. #### Common ```yml processor: label: "" mongodb: url: "" # No default (required) database: "" # No default (required) username: "" password: "" collection: "" # No default (required) operation: insert-one write_concern: w: majority j: false w_timeout: "" document_map: "" filter_map: "" hint_map: "" upsert: false ``` #### Advanced ```yml processor: label: "" mongodb: url: "" # No default (required) database: "" # No default (required) username: "" password: "" app_name: benthos aws: enabled: false region: "" # No default (optional) session_duration: 1h id: "" # No default (optional) secret: "" # No default (optional) token: "" # No default (optional) role: "" # No default (optional) role_external_id: "" # No default (optional) roles: [] # No default (optional) collection: "" # No default (required) operation: insert-one write_concern: w: majority j: false w_timeout: "" document_map: "" filter_map: "" hint_map: "" upsert: false json_marshal_mode: canonical ``` ## Fields ### `app_name` The client application name. **Type**: `string` **Default**: `benthos` ### `aws` AWS IAM authentication using the `MONGODB-AWS` mechanism, for example against MongoDB Atlas. When enabled, IAM credentials are used instead of a static username and password. Role-derived session credentials are resolved when the component connects and are re-resolved whenever it reconnects. The `mongodb` processor and cache establish their client once at creation and cannot refresh expiring session credentials, so `role`, `roles` and session tokens are rejected for those components; use the ambient credential chain or long-lived access keys with them. For long-running pipelines, prefer the ambient credential chain (leave keys and roles unset), which the driver refreshes automatically. **Type**: `object` ### `aws.enabled` Enable AWS IAM authentication using the driver-native `MONGODB-AWS` mechanism. The MongoDB Atlas database user must be created with the AWS IAM authentication type, and connections require TLS. When no static credentials or roles are configured, the ambient AWS credential chain (environment variables, EC2 instance profile, EKS pod role) is used and expiring credentials are refreshed automatically. **Type**: `bool` **Default**: `false` ### `aws.id` The AWS access key ID to authenticate with. When empty, the default AWS credential chain is used. **Type**: `string` ### `aws.region` The AWS region used when assuming roles (for STS calls). Only used when `role` or `roles` are configured; the ambient and static-key paths ignore it. If no region is specified then the environment default is used. **Type**: `string` ### `aws.role` Optional AWS IAM role ARN to assume for authentication. Cannot be combined with `roles`; use the `roles` array instead when chaining multiple roles. **Type**: `string` ### `aws.role_external_id` Optional external ID to use when assuming the role set in `role`. Each entry in `roles` sets its own external ID. **Type**: `string` ### `aws.roles[]` Optional array of AWS IAM roles to assume for authentication. Roles are assumed in sequence, each using the credentials of the previous one, enabling chaining for purposes such as cross-account access. Each role can optionally specify an external ID. Cannot be combined with `role`. **Type**: `array` ### `aws.roles[].role` AWS IAM role ARN to assume. **Type**: `string` **Default**: `""` ### `aws.roles[].role_external_id` Optional external ID for the role assumption. **Type**: `string` **Default**: `""` ### `aws.secret` The AWS secret access key that pairs with `id`. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `aws.session_duration` The duration of the STS session requested when assuming roles. AWS requires at least 15 minutes and caps sessions created through role chaining at one hour. Only used when `role` or `roles` are configured. For long-running pipelines, prefer the ambient credential chain over a fixed session duration, since the driver refreshes ambient credentials automatically as they near expiry. **Type**: `string` **Default**: `1h` ### `aws.token` The AWS session token to use with `id` and `secret`. Required only when using short-term credentials. **Type**: `string` ### `collection` The name of the target collection. **Type**: `string` ### `database` The name of the target MongoDB database. **Type**: `string` ### `document_map` A Bloblang map that represents a document to store in MongoDB, expressed as [extended JSON in canonical form](https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/). The `document_map` parameter is required for the following database operations: `insert-one`, `replace-one`, `update-one`, and `aggregate`. **Type**: `string` **Default**: `""` ```yaml # Examples: document_map: |- root.a = this.foo root.b = this.bar ``` ### `filter_map` A Bloblang map that represents a filter for a MongoDB command, expressed as [extended JSON in canonical form](https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/). The `filter_map` parameter is required for all database operations except `insert-one`. The `filter_map` is used to find documents for the specified operation. For example, for a `delete-one` operation, the filter map should include the fields required to locate the document for deletion. **Type**: `string` **Default**: `""` ```yaml # Examples: filter_map: |- root.a = this.foo root.b = this.bar ``` ### `hint_map` A Bloblang map that represents a hint or index for a MongoDB command to use, expressed as [extended JSON in canonical form](https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/). This map is optional, and is used with all operations except `insert-one`. Define a `hint_map` to improve performance when finding documents in the MongoDB database. **Type**: `string` **Default**: `""` ```yaml # Examples: hint_map: |- root.a = this.foo root.b = this.bar ``` ### `json_marshal_mode` Controls the format used to convert BSON documents to JSON in the output message. **Type**: `string` **Default**: `canonical` | Option | Summary | | --- | --- | | `canonical` | A string format that emphasizes type preservation at the expense of readability and interoperability. That is, conversion from canonical to BSON will generally preserve type information except in certain specific cases. | | `relaxed` | A string format that emphasizes readability and interoperability at the expense of type preservation. That is, conversion from relaxed format to BSON can lose type information. | ### `operation` The MongoDB database operation to perform. **Type**: `string` **Default**: `insert-one` **Options**: `insert-one`, `delete-one`, `delete-many`, `replace-one`, `update-one`, `find-one`, `aggregate` ### `password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `upsert` The `upsert` parameter is optional, and only applies for `update-one` and `replace-one` operations. If the filter specified in `filter_map` matches an existing document, this operation updates or replaces the document, otherwise a new document is created. **Type**: `bool` **Default**: `false` ### `url` The URL of the target MongoDB server. **Type**: `string` ```yaml # Examples: url: mongodb://localhost:27017 ``` ### `username` The username to connect to the database. **Type**: `string` **Default**: `""` ### `write_concern` The [write concern settings](https://www.mongodb.com/docs/manual/reference/write-concern/) for the MongoDB connection. **Type**: `object` ### `write_concern.j` The `j` option requests acknowledgement from MongoDB that write operations are written to the journal. **Type**: `bool` **Default**: `false` ### `write_concern.w` The `w` option requests acknowledgement that write operations propagate to the specified number of MongoDB instances. Set it to `majority` to wait for a calculated majority of nodes to acknowledge the write operation, to an integer to specify the minimum number of nodes that must acknowledge the operation, or to the name of a custom write concern configured in the cluster. **Type**: `string` **Default**: `majority` ### `write_concern.w_timeout` The write concern timeout. **Type**: `string` **Default**: `""` --- # Page 213: mutation **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mutation.md --- # mutation Executes a [Bloblang](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) mapping and directly transforms the contents of messages, mutating (or deleting) them. Bloblang is a powerful language that enables a wide range of mapping, transformation and filtering tasks. For more information, see [About Bloblang](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/). If your mapping is large and you’d prefer for it to live in a separate file then you can execute a mapping directly from a file with the expression `from ""`, where the path must be absolute, or relative from the location that Redpanda Connect is executed from. ## Input document mutability A mutation is a mapping that transforms input documents directly, this has the advantage of reducing the need to copy the data fed into the mapping. However, this also means that the referenced document is mutable and therefore changes throughout the mapping. For example, with the following Bloblang: ```coffeescript root.rejected = this.invitees.filter(i -> i.mood < 0.5) root.invitees = this.invitees.filter(i -> i.mood >= 0.5) ``` Notice that we create a field `rejected` by copying the array field `invitees` and filtering out objects with a high mood. We then overwrite the field `invitees` by filtering out objects with a low mood, resulting in two array fields that are each a subset of the original. If we were to reverse the ordering of these assignments like so: ```coffeescript root.invitees = this.invitees.filter(i -> i.mood >= 0.5) root.rejected = this.invitees.filter(i -> i.mood < 0.5) ``` Then the new field `rejected` would be empty as we have already mutated `invitees` to exclude the objects that it would be populated by. We can solve this problem either by carefully ordering our assignments or by capturing the original array using a variable (`let invitees = this.invitees`). Mutations are advantageous over a standard mapping in situations where the result is a document with mostly the same shape as the input document, since we can avoid unnecessarily copying data from the referenced input document. However, in situations where we are creating an entirely new document shape it can be more convenient to use the traditional [`mapping` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mapping/) instead. ## Error handling Bloblang mappings can fail, in which case the error is logged and the message is flagged as having failed, allowing you to use [standard processor error handling patterns](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). However, Bloblang itself also provides powerful ways of ensuring your mappings do not fail by specifying desired [fallback behavior](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/#error-handling). ### Common ```yml processor: label: "" mutation: "" # No default (required) ``` ### Advanced ```yml processor: label: "" mutation: "" # No default (required) ``` ## Examples ### Mapping Given JSON documents containing an array of fans: ```json { "id":"foo", "description":"a show about foo", "fans":[ {"name":"bev","obsession":0.57}, {"name":"grace","obsession":0.21}, {"name":"ali","obsession":0.89}, {"name":"vic","obsession":0.43} ] } ``` We can reduce the documents down to just the ID and only those fans with an obsession score above 0.5, giving us: ```json { "id":"foo", "fans":[ {"name":"bev","obsession":0.57}, {"name":"ali","obsession":0.89} ] } ``` With the following config: ```yaml pipeline: processors: - mutation: | root.description = deleted() root.fans = this.fans.filter(fan -> fan.obsession > 0.5) ``` ### More Mapping When receiving JSON documents of the form: ```json { "locations": [ {"name": "Seattle", "state": "WA"}, {"name": "New York", "state": "NY"}, {"name": "Bellevue", "state": "WA"}, {"name": "Olympia", "state": "WA"} ] } ``` We could collapse the location names from the state of Washington into a field `Cities`: ```json {"Cities": "Bellevue, Olympia, Seattle"} ``` With the following config: ```yaml pipeline: processors: - mutation: | root.Cities = this.locations. filter(loc -> loc.state == "WA"). map_each(loc -> loc.name). sort().join(", ") ``` --- # Page 214: nats_kv **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/nats_kv.md --- # nats_kv Performs operations on a NATS key-value bucket. ## KV operations The NATS KV processor supports a multitude of KV operations via the [`operation`](#operation) field. Along with `get`, `put`, and `delete`, this processor supports atomic operations like `update` and `create`, as well as utility operations like `purge`, `history`, and `keys`. ## Metadata This processor adds the following metadata fields to each message, depending on the chosen `operation`: ### get, get_revision - `nats_kv_key` - `nats_kv_bucket` - `nats_kv_revision` - `nats_kv_delta` - `nats_kv_operation` - `nats_kv_created` ### create, update, delete, purge - `nats_kv_key` - `nats_kv_bucket` - `nats_kv_revision` - `nats_kv_operation` ### keys - `nats_kv_bucket` ## Connection name When monitoring and managing a production [NATS system](https://docs.nats.io/nats-concepts/overview), it is often useful to know which connection a message was sent or received from. This can be achieved by setting the connection name option when creating a NATS connection. Redpanda Connect will automatically set the connection name based off the label of the given NATS component, so that monitoring tools between NATS and Redpanda Connect can stay in sync. ## Authentication There are several components within Redpanda Connect which uses NATS services. You will find that each of these components support optional advanced authentication parameters for [NKeys](https://docs.nats.io/nats-server/configuration/securing_nats/auth_intro/nkey_auth) and [User Credentials](https://docs.nats.io/using-nats/developer/connecting/creds). See an [in-depth tutorial](https://docs.nats.io/running-a-nats-service/nats_admin/security/jwt). ### NKey file The NATS server can use these NKeys in several ways for authentication. The simplest is for the server to be configured with a list of known public keys. The server then generates a challenge for each connection request from a client, and the client must respond to the challenge by signing it with its private NKey configured in the `nkey_file` or `nkey` field. [More details](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth). ### User credentials NATS server supports decentralized authentication based on JSON Web Tokens (JWT). Clients need an [user JWT](https://docs.nats.io/nats-server/configuration/securing_nats/jwt#json-web-tokens) and a corresponding [NKey secret](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth) when connecting to a server which is configured to use this authentication scheme. The `user_credentials_file` field should point to a file containing both the private key and the JWT and can be generated with the [nsc tool](https://docs.nats.io/nats-tools/nsc). Alternatively, the `user_jwt` field can contain a plain text JWT and the `user_nkey_seed` field can contain the plain text NKey Seed. [More details](https://docs.nats.io/using-nats/developer/connecting/creds). ### Token The `token` field can contain a plain text token string for [token-based authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/tokens). ### User and password The `user` and `password` fields can be used for [username/password authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/username_password). #### Common ```yml processor: label: "" nats_kv: urls: [] # No default (required) bucket: "" # No default (required) operation: create # No default (required) key: "" # No default (required) ``` #### Advanced ```yml processor: label: "" nats_kv: urls: [] # No default (required) max_reconnects: 0 # No default (optional) bucket: "" # No default (required) operation: create # No default (required) key: "" # No default (required) revision: "" # No default (optional) timeout: 5s tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] tls_handshake_first: false auth: nkey_file: "" # No default (optional) nkey: "" # No default (optional) user_credentials_file: "" # No default (optional) user_jwt: "" # No default (optional) user_nkey_seed: "" # No default (optional) user: "" # No default (optional) password: "" # No default (optional) token: "" # No default (optional) ``` ## Fields ### `auth` Optional configuration of NATS authentication parameters. **Type**: `object` ### `auth.nkey` Your NKey seed (private key) for NATS authentication. NKeys provide cryptographic authentication without passwords. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: nkey: UDXU4RCSJNZOIQHZNWXHXORDPRTGNJAHAHFRGZNEEJCPQTT2M7NLCNF4 ``` ### `auth.nkey_file` An optional file containing a NKey seed. **Type**: `string` ```yaml # Examples: nkey_file: ./seed.nk ``` ### `auth.password` An optional plain text password (given along with the corresponding user name). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.token` An optional plain text token. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user` An optional plain text user name (given along with the corresponding user password). **Type**: `string` ### `auth.user_credentials_file` An optional file containing user credentials which consist of a user JWT and corresponding NKey seed. **Type**: `string` ```yaml # Examples: user_credentials_file: ./user.creds ``` ### `auth.user_jwt` An optional plaintext user JWT to use along with the corresponding user NKey seed. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user_nkey_seed` An optional plaintext user NKey seed to use along with the corresponding user JWT. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `bucket` The name of the KV bucket. **Type**: `string` ```yaml # Examples: bucket: my_kv_bucket ``` ### `key` The key for each message. Supports [wildcards](https://docs.nats.io/nats-concepts/subjects#wildcards) for the `history` and `keys` operations. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: key: foo # --- key: foo.bar.baz # --- key: foo.* # --- key: foo.> # --- key: foo.${! json("meta.type") } ``` ### `max_reconnects` The maximum number of times to attempt to reconnect to the server. If negative, it will never stop trying to reconnect. **Type**: `int` ### `operation` The operation to perform on the KV bucket. **Type**: `string` | Option | Summary | | --- | --- | | `create` | Adds the key/value pair if it does not exist. Returns an error if it already exists. | | `delete` | Deletes the key/value pair, but keeps historical values. | | `get` | Returns the latest value for `key`. | | `get_revision` | Returns the value of `key` for the specified `revision`. | | `history` | Returns historical values of `key` as an array of objects containing the following fields: `key`, `value`, `bucket`, `revision`, `delta`, `operation`, `created`. | | `keys` | Returns the keys in the `bucket` which match the `keys_filter` as an array of strings. | | `purge` | Deletes the key/value pair and all historical values. | | `put` | Places a new value for the key into the store. | | `update` | Updates the value for `key` only if the `revision` matches the latest revision. | ### `revision` The revision of the key to operate on. Used for `get_revision` and `update` operations. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: revision: "42" # --- revision: ${! @nats_kv_revision } ``` ### `timeout` The maximum period to wait on an operation before aborting and returning an error. **Type**: `string` **Default**: `5s` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `tls_handshake_first` Whether to perform the initial TLS handshake before sending the NATS INFO protocol message. This is required when connecting to some NATS servers that expect TLS to be established immediately after connection, before any protocol negotiation. **Type**: `bool` **Default**: `false` ### `urls[]` A list of URLs to connect to. If a list item contains commas, it will be expanded into multiple URLs. **Type**: `array` ```yaml # Examples: urls: - "nats://127.0.0.1:4222" # --- urls: - "nats://username:password@127.0.0.1:4222" ``` --- # Page 215: nats_request_reply **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/nats_request_reply.md --- # nats_request_reply Sends a message to a NATS subject and expects a reply back from a NATS subscriber acting as a responder. ## Metadata This input adds the following metadata fields to each message: - `nats_subject` - `nats_sequence_stream` - `nats_sequence_consumer` - `nats_num_delivered` - `nats_num_pending` - `nats_domain` - `nats_timestamp_unix_nano` You can access these metadata fields using [function interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). ## Connection name When monitoring and managing a production [NATS system](https://docs.nats.io/nats-concepts/overview), it is often useful to know which connection a message was sent or received from. This can be achieved by setting the connection name option when creating a NATS connection. Redpanda Connect will automatically set the connection name based off the label of the given NATS component, so that monitoring tools between NATS and Redpanda Connect can stay in sync. ## Authentication There are several components within Redpanda Connect which uses NATS services. You will find that each of these components support optional advanced authentication parameters for [NKeys](https://docs.nats.io/nats-server/configuration/securing_nats/auth_intro/nkey_auth) and [User Credentials](https://docs.nats.io/using-nats/developer/connecting/creds). See an [in-depth tutorial](https://docs.nats.io/running-a-nats-service/nats_admin/security/jwt). ### NKey file The NATS server can use these NKeys in several ways for authentication. The simplest is for the server to be configured with a list of known public keys. The server then generates a challenge for each connection request from a client, and the client must respond to the challenge by signing it with its private NKey configured in the `nkey_file` or `nkey` field. [More details](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth). ### User credentials NATS server supports decentralized authentication based on JSON Web Tokens (JWT). Clients need an [user JWT](https://docs.nats.io/nats-server/configuration/securing_nats/jwt#json-web-tokens) and a corresponding [NKey secret](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth) when connecting to a server which is configured to use this authentication scheme. The `user_credentials_file` field should point to a file containing both the private key and the JWT and can be generated with the [nsc tool](https://docs.nats.io/nats-tools/nsc). Alternatively, the `user_jwt` field can contain a plain text JWT and the `user_nkey_seed` field can contain the plain text NKey Seed. [More details](https://docs.nats.io/using-nats/developer/connecting/creds). ### Token The `token` field can contain a plain text token string for [token-based authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/tokens). ### User and password The `user` and `password` fields can be used for [username/password authentication](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/username_password). #### Common ```yml processor: label: "" nats_request_reply: urls: [] # No default (required) subject: "" # No default (required) headers: {} metadata: include_prefixes: [] include_patterns: [] timeout: 3s ``` #### Advanced ```yml processor: label: "" nats_request_reply: urls: [] # No default (required) max_reconnects: 0 # No default (optional) subject: "" # No default (required) inbox_prefix: "" # No default (optional) headers: {} metadata: include_prefixes: [] include_patterns: [] timeout: 3s tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] tls_handshake_first: false auth: nkey_file: "" # No default (optional) nkey: "" # No default (optional) user_credentials_file: "" # No default (optional) user_jwt: "" # No default (optional) user_nkey_seed: "" # No default (optional) user: "" # No default (optional) password: "" # No default (optional) token: "" # No default (optional) ``` ## Fields ### `auth` Optional configuration of NATS authentication parameters. **Type**: `object` ### `auth.nkey` Your NKey seed (private key) for NATS authentication. NKeys provide cryptographic authentication without passwords. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ```yaml # Examples: nkey: UDXU4RCSJNZOIQHZNWXHXORDPRTGNJAHAHFRGZNEEJCPQTT2M7NLCNF4 ``` ### `auth.nkey_file` An optional file containing a NKey seed. **Type**: `string` ```yaml # Examples: nkey_file: ./seed.nk ``` ### `auth.password` An optional plain text password (given along with the corresponding user name). > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.token` An optional plain text token. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user` An optional plain text user name (given along with the corresponding user password). **Type**: `string` ### `auth.user_credentials_file` An optional file containing user credentials which consist of a user JWT and corresponding NKey seed. **Type**: `string` ```yaml # Examples: user_credentials_file: ./user.creds ``` ### `auth.user_jwt` An optional plaintext user JWT to use along with the corresponding user NKey seed. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `auth.user_nkey_seed` An optional plaintext user NKey seed to use along with the corresponding user JWT. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `headers` Explicit message headers to add to messages. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `object` **Default**: `{}` ```yaml # Examples: headers: Content-Type: application/json Timestamp: ${!meta("Timestamp")} ``` ### `inbox_prefix` Set an explicit inbox prefix for the response subject **Type**: `string` ```yaml # Examples: inbox_prefix: _INBOX_joe ``` ### `max_reconnects` The maximum number of times to attempt to reconnect to the server. If negative, it will never stop trying to reconnect. **Type**: `int` ### `metadata` Specify which metadata values are added to messages as NATS headers, alongside any explicit `headers`. **Type**: `object` ### `metadata.include_patterns[]` A list of explicit metadata key regular expression (re2) patterns to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_patterns: - .* # --- include_patterns: - _timestamp_unix$ ``` ### `metadata.include_prefixes[]` A list of explicit metadata key prefixes to match against. **Type**: `array` **Default**: `[]` ```yaml # Examples: include_prefixes: - foo_ - bar_ # --- include_prefixes: - kafka_ # --- include_prefixes: - content- ``` ### `subject` A subject to write to. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: subject: foo.bar.baz # --- subject: ${! meta("kafka_topic") } # --- subject: foo.${! json("meta.type") } ``` ### `timeout` A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as 300ms, -1.5h or 2h45m. Valid time units are ns, us (or µs), ms, s, m, h. **Type**: `string` **Default**: `3s` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `tls_handshake_first` Whether to perform the initial TLS handshake before sending the NATS INFO protocol message. This is required when connecting to some NATS servers that expect TLS to be established immediately after connection, before any protocol negotiation. **Type**: `bool` **Default**: `false` ### `urls[]` A list of URLs to connect to. If a list item contains commas, it will be expanded into multiple URLs. **Type**: `array` ```yaml # Examples: urls: - "nats://127.0.0.1:4222" # --- urls: - "nats://username:password@127.0.0.1:4222" ``` --- # Page 216: noop **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/noop.md --- # noop Noop is a processor that does nothing, the message passes through unchanged. Why? Sometimes doing nothing is the braver option. ## Common ```yml processor: label: "" noop: {} ``` ## Advanced ```yml processor: label: "" noop: {} ``` --- # Page 217: ollama_chat **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/ollama_chat.md --- # ollama_chat Generates responses to messages in a chat conversation, using the Ollama API. This processor sends prompts to your chosen Ollama large language model (LLM) and generates text from the responses, using the Ollama API. The model can also call external tools that you define in the [`tools`](#tools) field to retrieve more information to answer a prompt. By default, the processor starts and runs a locally installed Ollama server. Alternatively, to use an already running Ollama server, add your server details to the `server_address` field. You can [download and install Ollama from the Ollama website](https://ollama.com/download). For more information, see the [Ollama documentation](https://github.com/ollama/ollama/tree/main/docs) and [Examples](#examples). > 📝 **NOTE** > > Ollama connectors are currently only available on BYOC GCP clusters. > ⚠️ **CAUTION** > > When Redpanda Connect runs a data pipeline with a Ollama processor in it, Redpanda Cloud deploys a GPU-powered instance for the exclusive use of that pipeline. As pricing is based on resource consumption, this can have cost implications. > 📝 **NOTE** > > This component is available only in [GPU-enabled pipelines](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/resource-management/). #### Common ```yml processor: label: "" ollama_chat: model: "" # No default (required) prompt: "" # No default (optional) image: "" # No default (optional) response_format: text max_tokens: 0 # No default (optional) temperature: 0 # No default (optional) save_prompt_metadata: false history: "" # No default (optional) tools: [] runner: context_size: 0 # No default (optional) batch_size: 0 # No default (optional) server_address: "" # No default (optional) ``` #### Advanced ```yml processor: label: "" ollama_chat: model: "" # No default (required) prompt: "" # No default (optional) system_prompt: "" # No default (optional) image: "" # No default (optional) response_format: text max_tokens: 0 # No default (optional) temperature: 0 # No default (optional) num_keep: 0 # No default (optional) seed: 0 # No default (optional) top_k: 0 # No default (optional) top_p: 0 # No default (optional) repeat_penalty: 0 # No default (optional) presence_penalty: 0 # No default (optional) frequency_penalty: 0 # No default (optional) stop: [] # No default (optional) save_prompt_metadata: false history: "" # No default (optional) max_tool_calls: 3 tools: [] runner: context_size: 0 # No default (optional) batch_size: 0 # No default (optional) gpu_layers: 0 # No default (optional) threads: 0 # No default (optional) use_mmap: false # No default (optional) server_address: "" # No default (optional) cache_directory: "" # No default (optional) download_url: "" # No default (optional) ``` ## Fields ### `cache_directory` If `server_address` is not set, download the Ollama binary to this directory and use it as a model cache. **Type**: `string` ```yaml # Examples: cache_directory: /opt/cache/connect/ollama ``` ### `download_url` If `server_address` is not set, download the Ollama binary from this URL. The default value is the official Ollama GitHub release for this platform. **Type**: `string` ### `frequency_penalty` A number between `-2.0` and `2.0` that the processor sends to the Ollama server as the `frequency_penalty` model option. Positive values penalize each token in proportion to how often it has already appeared in the text, which makes the model less likely to repeat the same line verbatim. A value of `0` is not sent, so the server’s default applies. **Type**: `float` ### `history` Include historical messages in a chat request. You must use a Bloblang query to create an array of objects in the form of `[{"role": "", "content":""}]` where: - `role` is the sender of the original messages, either `system`, `user`, `assistant`, or `tool`. - `content` is the text of the original messages. **Type**: `string` ### `image` An optional image to submit along with the `prompt` value. The result should be a byte array. **Type**: `string` ```yaml # Examples: image: 'root = this.image.decode("base64") # decode base64 encoded image' ``` ### `max_tokens` The maximum number of tokens to predict and output. Limiting the amount of output means that requests are processed faster and have a fixed limit on the cost. **Type**: `int` ### `max_tool_calls` The maximum number of sequential calls you can make to external tools to retrieve additional information to answer a prompt. **Type**: `int` **Default**: `3` ### `model` The name of the Ollama model to use. For a full list of models, see the [Ollama website](https://ollama.com/models). **Type**: `string` ```yaml # Examples: model: llama3.1 # --- model: gemma2 # --- model: qwen2 # --- model: phi3 ``` ### `num_keep` Specify the number of tokens from the initial prompt to retain when the model resets its internal context. By default, this value is set to `4`. Use `-1` to retain all tokens from the initial prompt. **Type**: `int` ### `presence_penalty` A number between `-2.0` and `2.0` that the processor sends to the Ollama server as the `presence_penalty` model option. Positive values penalize every token that has already appeared in the text, regardless of how often, which makes the model more likely to move on to new topics. A value of `0` is not sent, so the server’s default applies. **Type**: `float` ### `prompt` The user prompt you want to generate a response for. By default, the processor submits the entire payload of each message as a string. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `repeat_penalty` Sets how strongly to penalize repetitions. A higher value, for example 1.5, will penalize repetitions more strongly. A lower value, for example 0.9, will be more lenient. **Type**: `float` ### `response_format` The format of the response the Ollama model generates. If specifying JSON output, then the `prompt` should specify that the output should be in JSON as well. **Type**: `string` **Default**: `text` **Options**: `text`, `json` ### `runner` Options for the model runner that are used when the model is first loaded into memory. **Type**: `object` ### `runner.batch_size` The maximum number of requests to process in parallel. **Type**: `int` ### `runner.context_size` Sets the size of the context window used to generate the next token. Using a larger context window uses more memory and takes longer to process. **Type**: `int` ### `runner.gpu_layers` Sets the number of layers to offload to the GPU for computation. This generally results in increased performance. By default, the runtime decides the number of layers dynamically. **Type**: `int` ### `runner.threads` Sets the number of threads to use during response generation. For optimal performance, set this value to the number of physical CPU cores your system has. By default, the runtime decides the optimal number of threads. **Type**: `int` ### `runner.use_mmap` Map the model into memory. Set to `true` to load only the necessary parts of the model into memory. This setting is only supported on Unix systems. **Type**: `bool` ### `save_prompt_metadata` Set to `true` to save the prompt value to a metadata field (`@prompt`) on the corresponding output message. If you use the `system_prompt` field, its value is also saved to an `@system_prompt` metadata field on each output message. **Type**: `bool` **Default**: `false` ### `seed` Sets the random number seed to use for generation. Setting this to a specific number will make the model generate the same text for the same prompt. **Type**: `int` ```yaml # Examples: seed: 42 ``` ### `server_address` The address of the Ollama server to use. Leave this field blank and the processor starts and runs a local Ollama server, or specify the address of your own local or remote server. **Type**: `string` ```yaml # Examples: server_address: http://127.0.0.1:11434 ``` ### `stop[]` Sets the stop sequences to use. When this pattern is encountered, the LLM stops generating text and returns the final response. **Type**: `array` ### `system_prompt` The system prompt to submit along with the user prompt. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `temperature` The temperature of the model. Increasing the temperature makes the model answer more creatively. **Type**: `int` ### `tools[]` The external tools the LLM can invoke, such as functions, APIs, or web browsing. You can build subpipelines of processors that include definitions of these tools, and the specified LLM can choose when to invoke them to help answer a prompt. **Type**: `array` **Default**: `[]` ### `tools[].description` A description of this tool. The LLM uses it to decide whether to invoke the tool. **Type**: `string` ### `tools[].name` The name of this tool. **Type**: `string` ### `tools[].parameters` The parameters the LLM needs to provide to invoke this tool. **Type**: `object` ### `tools[].parameters.properties` The parameters the LLM can provide when it invokes this tool, keyed by parameter name. **Type**: `object` ### `tools[].parameters.properties.description` A description of this parameter. **Type**: `string` ### `tools[].parameters.properties.enum[]` The values this parameter is limited to. Leave empty to accept any value. **Type**: `array` **Default**: `[]` ### `tools[].parameters.properties.type` The type of this parameter. **Type**: `string` ### `tools[].parameters.required[]` The names of the parameters the LLM must provide when it invokes this tool. **Type**: `array` **Default**: `[]` ### `tools[].processors[]` The processors to run when the LLM invokes this tool. They receive a message whose payload is the tool call arguments as a JSON object, and their output is returned to the LLM as the tool result. **Type**: `array` ### `top_k` Reduces the probability of generating nonsense. A higher value, for example `100`, will give more diverse answers. A lower value, for example `10`, will be more conservative. **Type**: `int` ### `top_p` Works together with `top-k`. A higher value, for example 0.95, will lead to more diverse text. A lower value, for example 0.5, will generate more focused and conservative text. **Type**: `float` ## Examples ### Use Llava to analyze an image This example fetches image URLs from stdin and has a multimodal LLM describe the image. ```yaml input: stdin: scanner: lines: {} pipeline: processors: - http: verb: GET url: "${!content().string()}" - ollama_chat: model: llava prompt: "Describe the following image" image: "root = content()" output: stdout: codec: lines ``` ### Use subpipelines as tool calls This example allows llama3.2 to execute a subpipeline as a tool call to get more data. ```yaml input: generate: count: 1 mapping: | root = "What is the weather like in Chicago?" pipeline: processors: - ollama_chat: model: llama3.2 prompt: "${!content().string()}" tools: - name: GetWeather description: "Retrieve the weather for a specific city" parameters: required: ["city"] properties: city: type: string description: the city to lookup the weather for processors: - http: verb: GET url: 'https://wttr.in/${!this.city}?T' headers: # Spoof curl user-ageent to get a plaintext text User-Agent: curl/8.11.1 output: stdout: {} ``` --- # Page 218: ollama_embeddings **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/ollama_embeddings.md --- # ollama_embeddings > 📝 **NOTE** > > Ollama connectors are currently only available on BYOC GCP clusters. > ⚠️ **CAUTION** > > When Redpanda Connect runs a data pipeline with a Ollama processor in it, Redpanda Cloud deploys a GPU-powered instance for the exclusive use of that pipeline. As pricing is based on resource consumption, this can have cost implications. Generates vector embeddings from text, using the Ollama API. This processor sends text to your chosen Ollama large language model (LLM) and creates vector embeddings, using the Ollama API. Vector embeddings are long arrays of numbers that represent values or objects, in this case text. By default, the processor starts and runs a locally installed Ollama server. Alternatively, to use an already running Ollama server, add your server details to the `server_address` field. You can [download and install Ollama from the Ollama website](https://ollama.com/download). For more information, see the [Ollama documentation](https://github.com/ollama/ollama/tree/main/docs). > 📝 **NOTE** > > This component is available only in [GPU-enabled pipelines](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/resource-management/). #### Common ```yml processor: label: "" ollama_embeddings: model: "" # No default (required) text: "" # No default (optional) runner: context_size: 0 # No default (optional) batch_size: 0 # No default (optional) server_address: "" # No default (optional) ``` #### Advanced ```yml processor: label: "" ollama_embeddings: model: "" # No default (required) text: "" # No default (optional) runner: context_size: 0 # No default (optional) batch_size: 0 # No default (optional) gpu_layers: 0 # No default (optional) threads: 0 # No default (optional) use_mmap: false # No default (optional) server_address: "" # No default (optional) cache_directory: "" # No default (optional) download_url: "" # No default (optional) ``` ## Fields ### `cache_directory` If `server_address` is not set, download the Ollama binary to this directory and use it as a model cache. **Type**: `string` ```yaml # Examples: cache_directory: /opt/cache/connect/ollama ``` ### `download_url` If `server_address` is not set, download the Ollama binary from this URL. The default value is the official Ollama GitHub release for this platform. **Type**: `string` ### `model` The name of the Ollama model to use. For a full list of models, see the [Ollama website](https://ollama.com/models). **Type**: `string` ```yaml # Examples: model: nomic-embed-text # --- model: mxbai-embed-large # --- model: snowflake-artic-embed # --- model: all-minilm ``` ### `runner` Options for the model runner that are used when the model is first loaded into memory. **Type**: `object` ### `runner.batch_size` The maximum number of requests to process in parallel. **Type**: `int` ### `runner.context_size` Sets the size of the context window used to generate the next token. Using a larger context window uses more memory and takes longer to process. **Type**: `int` ### `runner.gpu_layers` Sets the number of layers to offload to the GPU for computation. This generally results in increased performance. By default, the runtime decides the number of layers dynamically. **Type**: `int` ### `runner.threads` Sets the number of threads to use during response generation. For optimal performance, set this value to the number of physical CPU cores your system has. By default, the runtime decides the optimal number of threads. **Type**: `int` ### `runner.use_mmap` Map the model into memory. Set to `true` to load only the necessary parts of the model into memory. This setting is only supported on Unix systems. **Type**: `bool` ### `server_address` The address of the Ollama server to use. Leave this field blank and the processor starts and runs a local Ollama server, or specify the address of your own local or remote server. **Type**: `string` ```yaml # Examples: server_address: http://127.0.0.1:11434 ``` ### `text` The text you want to generate vector embeddings for. By default, the processor submits the entire payload of each message as a string. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ## Examples ### Store embedding vectors in Qdrant Computes embeddings for some generated data and stores them in [Qdrant](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/qdrant/). ```yaml input: generate: interval: 1s mapping: | root = {"text": fake("paragraph")} pipeline: processors: - ollama_embeddings: model: snowflake-artic-embed text: "${!this.text}" output: qdrant: grpc_host: localhost:6334 collection_name: "example_collection" id: "root = uuid_v4()" vector_mapping: "root = this" ``` ### Store embedding vectors in CyborgDB Computes embeddings for some generated data and stores them in [CyborgDB](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/cyborgdb/). ```yaml input: generate: interval: 1s mapping: | root = {"text": fake("paragraph")} pipeline: processors: - ollama_embeddings: model: snowflake-artic-embed text: "${!this.text}" output: cyborgdb: host: "${CYBORGDB_HOST}" api_key: "${CYBORGDB_API_KEY}" index_key: "${CYBORGDB_INDEX_KEY}" index_name: "my_encrypted_index" operation: "upsert" id: "root = uuid_v4()" vector_mapping: "root = this" ``` ### Store embedding vectors in Clickhouse Compute embeddings for some generated data and store it within [Clickhouse](https://clickhouse.com/) ```yaml input: generate: interval: 1s mapping: | root = {"text": fake("paragraph")} pipeline: processors: - branch: processors: - ollama_embeddings: model: snowflake-artic-embed text: "${!this.text}" result_map: | root.embeddings = this output: sql_insert: driver: clickhouse dsn: "clickhouse://localhost:9000" table: searchable_text columns: ["id", "text", "vector"] args_mapping: "root = [uuid_v4(), this.text, this.embeddings]" ``` --- # Page 219: ollama_moderation **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/ollama_moderation.md --- # ollama_moderation Checks whether responses from a large language model (LLM) are safe, using the Ollama API. This processor checks LLM response safety using either [Llama Guard 3](https://ollama.com/library/llama-guard3) (`llama-guard3`) or [ShieldGemma](https://ollama.com/library/shieldgemma) (`shieldgemma`). This processor is for response classification only. To check whether a prompt is safe, use the [`ollama_chat` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/ollama_chat/). By default, the processor starts and runs a locally installed Ollama server. Alternatively, to use an already running Ollama server, add your server details to the `server_address` field. You can [download and install Ollama from the Ollama website](https://ollama.com/download). For more information, see the [Ollama documentation](https://github.com/ollama/ollama/tree/main/docs) and [Examples](#examples). > 📝 **NOTE** > > Ollama connectors are currently only available on BYOC GCP clusters. > ⚠️ **CAUTION** > > When Redpanda Connect runs a data pipeline with a Ollama processor in it, Redpanda Cloud deploys a GPU-powered instance for the exclusive use of that pipeline. As pricing is based on resource consumption, this can have cost implications. > 📝 **NOTE** > > This component is available only in [GPU-enabled pipelines](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/resource-management/). #### Common ```yml processor: label: "" ollama_moderation: model: llama-guard3 # No default (required) prompt: "" # No default (required) response: "" # No default (required) runner: context_size: 0 # No default (optional) batch_size: 0 # No default (optional) server_address: "" # No default (optional) ``` #### Advanced ```yml processor: label: "" ollama_moderation: model: llama-guard3 # No default (required) prompt: "" # No default (required) response: "" # No default (required) runner: context_size: 0 # No default (optional) batch_size: 0 # No default (optional) gpu_layers: 0 # No default (optional) threads: 0 # No default (optional) use_mmap: false # No default (optional) server_address: "" # No default (optional) cache_directory: "" # No default (optional) download_url: "" # No default (optional) ``` ## Fields ### `cache_directory` If `server_address` is not set, download the Ollama binary to this directory and use it as a model cache. **Type**: `string` ```yaml # Examples: cache_directory: /opt/cache/connect/ollama ``` ### `download_url` If `server_address` is not set, download the Ollama binary from this URL. The default value is the official Ollama GitHub release for this platform. **Type**: `string` ### `model` The name of the Ollama LLM to use. **Type**: `string` | Option | Summary | | --- | --- | | `llama-guard3` | When using llama-guard3, two pieces of metadata is added: @safe with the value of `yes` or `no` and the second being @category for the safety category violation. For more information see the [Llama Guard 3 Model Card](https://ollama.com/library/llama-guard3). | | `shieldgemma` | When using shieldgemma, the model output is a single piece of metadata of @safe with a value of `yes` or `no` if the response is not in violation of its defined safety policies. | ```yaml # Examples: model: llama-guard3 # --- model: shieldgemma ``` ### `prompt` The prompt you used to generate a response from an LLM. If you’re using the `ollama_chat` processor, you can set the `save_prompt_metadata` field to save the contents of your prompts. You can then run them through the `ollama_moderation` processor to check the model responses for safety. You can also check the safety of your prompts. For more information, see the [`ollama_chat` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/ollama_chat/) documentation. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `response` The LLM’s response that you want to check for safety (classify as safe or unsafe content). This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `runner` Options for the model runner that are used when the model is first loaded into memory. **Type**: `object` ### `runner.batch_size` The maximum number of requests to process in parallel. **Type**: `int` ### `runner.context_size` Sets the size of the context window used to generate the next token. Using a larger context window uses more memory and takes longer to process. **Type**: `int` ### `runner.gpu_layers` Sets the number of layers to offload to the GPU for computation. This generally results in increased performance. By default, the runtime decides the number of layers dynamically. **Type**: `int` ### `runner.threads` Sets the number of threads to use during response generation. For optimal performance, set this value to the number of physical CPU cores your system has. By default, the runtime decides the optimal number of threads. **Type**: `int` ### `runner.use_mmap` Map the model into memory. Set to `true` to load only the necessary parts of the model into memory. This setting is only supported on Unix systems. **Type**: `bool` ### `server_address` The address of the Ollama server to use. Leave this field blank and the processor starts and runs a local Ollama server, or specify the address of your own local or remote server. **Type**: `string` ```yaml # Examples: server_address: http://127.0.0.1:11434 ``` ## Examples ### Use Llama Guard 3 classify a LLM response This example uses Llama Guard 3 to check if another model responded with a safe or unsafe content. ```yaml input: stdin: scanner: lines: {} pipeline: processors: - ollama_chat: model: llava prompt: "${!content().string()}" save_prompt_metadata: true - ollama_moderation: model: llama-guard3 prompt: "${!@prompt}" response: "${!content().string()}" - mapping: | root.response = content().string() root.is_safe = @safe output: stdout: codec: lines ``` --- # Page 220: openai_chat_completion **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_chat_completion.md --- # openai_chat_completion Generates responses to messages in a chat conversation, using the OpenAI API. This processor sends the contents of user prompts to the OpenAI API, which generates responses. By default, the processor submits the entire payload of each message as a string, unless you use the `prompt` configuration field to customize it. The model can also call external tools that you define in the [`tools`](#tools) field, and uses their results as supplementary context when it generates a response. To learn more about chat completion, see the [OpenAI API documentation](https://platform.openai.com/docs/guides/chat-completions) and [Examples](#examples). #### Common ```yml processor: label: "" openai_chat_completion: server_address: https://api.openai.com/v1 api_key: "" # No default (required) model: "" # No default (required) prompt: "" # No default (optional) system_prompt: "" # No default (optional) history: "" # No default (optional) image: "" # No default (optional) max_tokens: 0 # No default (optional) temperature: 0 # No default (optional) user: "" # No default (optional) response_format: text json_schema: name: "" # No default (required) schema: "" # No default (required) tools: [] # No default (required) ``` #### Advanced ```yml processor: label: "" openai_chat_completion: server_address: https://api.openai.com/v1 api_key: "" # No default (required) model: "" # No default (required) prompt: "" # No default (optional) system_prompt: "" # No default (optional) history: "" # No default (optional) image: "" # No default (optional) max_tokens: 0 # No default (optional) temperature: 0 # No default (optional) user: "" # No default (optional) response_format: text json_schema: name: "" # No default (required) description: "" # No default (optional) schema: "" # No default (required) schema_registry: url: "" # No default (required) name_prefix: schema_registry_id_ subject: "" # No default (required) refresh_interval: "" # No default (optional) tls: skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] oauth: enabled: false consumer_key: "" consumer_secret: "" access_token: "" access_token_secret: "" basic_auth: enabled: false username: "" password: "" jwt: enabled: false private_key_file: "" signing_method: "" claims: {} headers: {} top_p: 0 # No default (optional) frequency_penalty: 0 # No default (optional) presence_penalty: 0 # No default (optional) seed: 0 # No default (optional) stop: [] # No default (optional) tools: [] # No default (required) ``` ## Fields ### `api_key` The API secret key for OpenAI API. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `frequency_penalty` Specify a number between `-2.0` and `2.0`. Positive values penalize new tokens based on the frequency of their appearance in the text so far. This decreases the model’s likelihood to repeat the same line verbatim. **Type**: `float` ### `history` Include messages from a prior conversation. You must use a Bloblang query to create an array of objects in the form of `[{"role": "user", "content": ""}, {"role":"assistant", "content":""}]` where: - `role` is the sender of the original messages, either `system`, `user`, or `assistant`. - `content` is the text of the original messages. **Type**: `string` ### `image` An optional image to submit along with the prompt. The result of the Bloblang mapping must be a byte array. **Type**: `string` ```yaml # Examples: image: 'root = this.image.decode("base64") # decode base64 encoded image' ``` ### `json_schema` The JSON schema used by the model when generating responses in `json_schema` format. To learn more about supported JSON schema features, see the [OpenAI documentation](https://platform.openai.com/docs/guides/structured-outputs#supported-schemas). **Type**: `object` ### `json_schema.description` An optional description, which helps the model understand the schema’s purpose. **Type**: `string` ### `json_schema.name` The name of the JSON schema to use. **Type**: `string` ### `json_schema.schema` The JSON schema for the model to use when generating the output. **Type**: `string` ### `max_tokens` The maximum number of tokens to generate for chat completion. **Type**: `int` ### `model` The name of the OpenAI model to use. **Type**: `string` ```yaml # Examples: model: gpt-4o # --- model: gpt-4o-mini # --- model: gpt-4 # --- model: gpt4-turbo ``` ### `presence_penalty` Specify a number between `-2.0` and `2.0`. Positive values penalize new tokens if they have appeared in the text so far. This increases the model’s likelihood to talk about new topics. **Type**: `float` ### `prompt` The user prompt you want to generate a response for. By default, the processor submits the entire payload of each message as a string. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `response_format` Specify the output format of the configured `model`. If you choose the `json_schema` option, you must also configure a `json_schema` or `schema_registry`. **Type**: `string` **Default**: `text` **Options**: `text`, `json`, `json_schema` ### `schema_registry` The schema registry to dynamically load schemas for model responses in `json_schema` format. Schemas must be in JSON format. To learn more about supported JSON schema features, see the [OpenAI documentation](https://platform.openai.com/docs/guides/structured-outputs#supported-schemas). **Type**: `object` ### `schema_registry.basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `schema_registry.basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `schema_registry.jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `schema_registry.jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `schema_registry.jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `schema_registry.jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `schema_registry.jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `schema_registry.name_prefix` A prefix to add to the schema registry name. To form the complete schema registry name, the schema ID is appended as a suffix. **Type**: `string` **Default**: `schema_registry_id_` ### `schema_registry.oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `schema_registry.oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `schema_registry.refresh_interval` How frequently to poll the schema registry for the latest schema. If not specified, the schema does not refresh. **Type**: `string` ### `schema_registry.subject` The subject name used to fetch the schema from the schema registry. **Type**: `string` ### `schema_registry.tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `schema_registry.tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `schema_registry.tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `schema_registry.tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `schema_registry.tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `schema_registry.tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `schema_registry.tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `schema_registry.url` The base URL of the schema registry service. **Type**: `string` ### `seed` When set to a specific number, the model makes a best effort to generate consistent responses for requests that use the same prompt, seed, and parameters. Determinism is not guaranteed. **Type**: `int` ### `server_address` The OpenAI API endpoint to which the processor sends requests. Update the default value to use a different OpenAI-compatible service. **Type**: `string` **Default**: `https://api.openai.com/v1` ### `stop[]` Specify up to four stop sequences to use. When the model encounters a stop pattern, it stops generating text and returns the final response. **Type**: `array` ### `system_prompt` The system prompt to submit along with the user prompt. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `temperature` Choose a sampling temperature between `0` and `2`: - Higher values, such as `0.8` make the output more random. - Lower values, such as `0.2` make the output more focused and deterministic. Redpanda recommends adding a value for this field or `top_p`, but not both. **Type**: `float` ### `tools[]` External tools the model can invoke, such as functions, APIs, or web browsing. You can build subpipelines of processors that include definitions of these tools, and the specified model can choose when to invoke them to help answer a prompt. > 📝 **NOTE** > > If you don’t want to use external tools, enter an empty array `tools: []`. **Type**: `array` ### `tools[].description` A description of this tool. The LLM uses it to decide whether to invoke the tool. **Type**: `string` ### `tools[].name` The name of this tool. **Type**: `string` ### `tools[].parameters` The parameters the LLM needs to provide to invoke this tool. **Type**: `object` **Default**: `[]` ### `tools[].parameters.properties` The parameters the LLM can provide when it invokes this tool, keyed by parameter name. **Type**: `object` ### `tools[].parameters.properties.description` A description of this parameter. **Type**: `string` ### `tools[].parameters.properties.enum[]` The values this parameter is limited to. Leave empty to accept any value. **Type**: `array` **Default**: `[]` ### `tools[].parameters.properties.type` The type of this parameter. **Type**: `string` ### `tools[].parameters.required[]` The names of the parameters the LLM must provide when it invokes this tool. **Type**: `array` **Default**: `[]` ### `tools[].processors[]` The processors to run when the LLM invokes this tool. They receive a message whose payload is the tool call arguments as a JSON object, and their output is returned to the LLM as the tool result. **Type**: `array` ### `top_p` An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. For example, a `top_p` of `0.1` means only the tokens comprising the top 10% probability mass are sampled. Redpanda recommends adding a value for this field or `temperature`, but not both. **Type**: `float` ### `user` A unique identifier that represents the end-user generating the prompt. This value can help OpenAI monitor and detect [platform abuse](https://openai.com/policies/usage-policies/). This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ## Examples ### Use GPT-4o analyze an image This example fetches image URLs from stdin and has GPT-4o describe the image. ```yaml input: stdin: scanner: lines: {} pipeline: processors: - http: verb: GET url: "${!content().string()}" - openai_chat_completion: model: gpt-4o api_key: TODO prompt: "Describe the following image" image: "root = content()" output: stdout: codec: lines ``` ### Provide historical chat history This pipeline provides a historical chat history to GPT-4o using a cache. ```yaml input: stdin: scanner: lines: {} pipeline: processors: - mapping: | root.prompt = content().string() - branch: processors: - cache: resource: mem operator: get key: history - catch: - mapping: 'root = []' result_map: 'root.history = this' - branch: processors: - openai_chat_completion: model: gpt-4o api_key: TODO prompt: "${!this.prompt}" history: 'root = this.history' result_map: 'root.response = content().string()' - mutation: | root.history = this.history.concat([ {"role": "user", "content": this.prompt}, {"role": "assistant", "content": this.response}, ]) - cache: resource: mem operator: set key: history value: '${!this.history}' - mapping: | root = this.response output: stdout: codec: lines cache_resources: - label: mem memory: {} ``` ### Use GPT-4o to call a tool This example asks GPT-4o to respond with the weather by invoking an HTTP processor to get the forecast. ```yaml input: generate: count: 1 mapping: | root = "What is the weather like in Chicago?" pipeline: processors: - openai_chat_completion: model: gpt-4o api_key: "${OPENAI_API_KEY}" prompt: "${!content().string()}" tools: - name: GetWeather description: "Retrieve the weather for a specific city" parameters: required: ["city"] properties: city: type: string description: the city to look up the weather for processors: - http: verb: GET url: 'https://wttr.in/${!this.city}?T' headers: User-Agent: curl/8.11.1 # Returns a text string from the weather website output: stdout: {} ``` --- # Page 221: openai_embeddings **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_embeddings.md --- # openai_embeddings Generates vector embeddings to represent input text, using the OpenAI API. This processor sends text strings to the OpenAI API, which generates vector embeddings. By default, the processor submits the entire payload of each message as a string, unless you use the `text_mapping` configuration field to customize it. To learn more about vector embeddings, see the [OpenAI API documentation](https://platform.openai.com/docs/guides/embeddings). #### Common ```yml processor: label: "" openai_embeddings: server_address: https://api.openai.com/v1 api_key: "" # No default (required) model: "" # No default (required) text_mapping: "" # No default (optional) dimensions: 0 # No default (optional) ``` #### Advanced ```yml processor: label: "" openai_embeddings: server_address: https://api.openai.com/v1 api_key: "" # No default (required) model: "" # No default (required) text_mapping: "" # No default (optional) dimensions: 0 # No default (optional) ``` ## Fields ### `api_key` The API secret key for OpenAI API. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `dimensions` The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models. **Type**: `int` ### `model` The name of the OpenAI model to use. **Type**: `string` ```yaml # Examples: model: text-embedding-3-large # --- model: text-embedding-3-small # --- model: text-embedding-ada-002 ``` ### `server_address` The OpenAI API endpoint to which the processor sends requests. Update the default value to use a different OpenAI-compatible service. **Type**: `string` **Default**: `https://api.openai.com/v1` ### `text_mapping` A Bloblang mapping that returns the text you want to generate vector embeddings for. By default, the processor submits the entire payload of each message as a string. **Type**: `string` ## Examples ### Store embedding vectors in Pinecone Computes embeddings for some generated data and stores them in [Pinecone](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/pinecone/). ```yaml input: generate: interval: 1s mapping: | root = {"text": fake("paragraph")} pipeline: processors: - openai_embeddings: model: text-embedding-3-large api_key: "${OPENAI_API_KEY}" text_mapping: "root = this.text" output: pinecone: host: "${PINECONE_HOST}" api_key: "${PINECONE_API_KEY}" id: "root = uuid_v4()" vector_mapping: "root = this" ``` ### Store embedding vectors in CyborgDB Computes embeddings for some generated data and stores them in [CyborgDB](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/cyborgdb/). ```yaml input: generate: interval: 1s mapping: | root = {"text": fake("paragraph")} pipeline: processors: - openai_embeddings: model: text-embedding-3-large api_key: "${OPENAI_API_KEY}" text_mapping: "root = this.text" output: cyborgdb: host: "${CYBORGDB_HOST}" api_key: "${CYBORGDB_API_KEY}" index_key: "${CYBORGDB_INDEX_KEY}" index_name: "my_encrypted_index" operation: "upsert" id: "root = uuid_v4()" vector_mapping: "root = this" ``` --- # Page 222: openai_image_generation **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_image_generation.md --- # openai_image_generation Generates an image from a text description and other attributes, using OpenAI API. This processor sends an image description and other attributes, such as image size and quality to the OpenAI API, which generates an image. By default, the processor submits the entire payload of each message as a string, unless you use the `prompt` configuration field to customize it. To learn more about image generation, see the [OpenAI API documentation](https://platform.openai.com/docs/guides/images). #### Common ```yml processor: label: "" openai_image_generation: server_address: https://api.openai.com/v1 api_key: "" # No default (required) model: "" # No default (required) prompt: "" # No default (optional) ``` #### Advanced ```yml processor: label: "" openai_image_generation: server_address: https://api.openai.com/v1 api_key: "" # No default (required) model: "" # No default (required) prompt: "" # No default (optional) quality: "" # No default (optional) size: "" # No default (optional) style: "" # No default (optional) ``` ## Fields ### `api_key` The API secret key for OpenAI API. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `model` The name of the OpenAI model to use. **Type**: `string` ```yaml # Examples: model: dall-e-3 # --- model: dall-e-2 ``` ### `prompt` A text description of the image you want to generate. The `prompt` field accepts a maximum of 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`. **Type**: `string` ### `quality` The quality of the image to generate. Use `hd` to create images with finer details and greater consistency across the image. This parameter is only supported for `dall-e-3` models. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: quality: standard # --- quality: hd ``` ### `server_address` The OpenAI API endpoint to which the processor sends requests. Update the default value to use a different OpenAI-compatible service. **Type**: `string` **Default**: `https://api.openai.com/v1` ### `size` The size of the generated image. Choose from `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. Choose from `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: size: 1024x1024 # --- size: 512x512 # --- size: 1792x1024 # --- size: 1024x1792 ``` ### `style` The style of the generated image. Choose from `vivid` or `natural`. Vivid causes the model to lean towards generating hyperreal and dramatic images. Natural causes the model to produce more natural, less hyperreal looking images. This parameter is only supported for `dall-e-3`. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: style: vivid # --- style: natural ``` --- # Page 223: openai_speech **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_speech.md --- # openai_speech Generates audio from a text description and other attributes, using OpenAI API. This processor sends a text description and other attributes, such as a voice type and format to the OpenAI API, which generates audio. By default, the processor submits the entire payload of each message as a string, unless you use the `input` configuration field to customize it. To learn more about turning text into spoken audio, see the [OpenAI API documentation](https://platform.openai.com/docs/guides/text-to-speech). #### Common ```yml processor: label: "" openai_speech: server_address: https://api.openai.com/v1 api_key: "" # No default (required) model: "" # No default (required) input: "" # No default (optional) voice: "" # No default (required) ``` #### Advanced ```yml processor: label: "" openai_speech: server_address: https://api.openai.com/v1 api_key: "" # No default (required) model: "" # No default (required) input: "" # No default (optional) voice: "" # No default (required) response_format: "" # No default (optional) ``` ## Fields ### `api_key` The API secret key for OpenAI API. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `input` A text description of the audio you want to generate. The `input` field accepts a maximum of 4096 characters. **Type**: `string` ### `model` The name of the OpenAI model to use. **Type**: `string` ```yaml # Examples: model: tts-1 # --- model: tts-1-hd ``` ### `response_format` The format to generate audio in. Default is `mp3`. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: response_format: mp3 # --- response_format: opus # --- response_format: aac # --- response_format: flac # --- response_format: wav # --- response_format: pcm ``` ### `server_address` The OpenAI API endpoint to which the processor sends requests. Update the default value to use a different OpenAI-compatible service. **Type**: `string` **Default**: `https://api.openai.com/v1` ### `voice` The type of voice to use when generating the audio. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: voice: alloy # --- voice: echo # --- voice: fable # --- voice: onyx # --- voice: nova # --- voice: shimmer ``` --- # Page 224: openai_transcription **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_transcription.md --- # openai_transcription Generates a transcription of spoken audio in the input language, using the OpenAI API. This processor sends an audio file object along with the input language to OpenAI API to generate a transcription. By default, the processor submits the entire payload of each message as a string, unless you use the `file` configuration field to customize it. To learn more about audio transcription, see the: [OpenAI API documentation](https://platform.openai.com/docs/guides/speech-to-text). #### Common ```yml processor: label: "" openai_transcription: server_address: https://api.openai.com/v1 api_key: "" # No default (required) model: "" # No default (required) file: "" # No default (required) ``` #### Advanced ```yml processor: label: "" openai_transcription: server_address: https://api.openai.com/v1 api_key: "" # No default (required) model: "" # No default (required) file: "" # No default (required) language: "" # No default (optional) prompt: "" # No default (optional) ``` ## Fields ### `api_key` The API secret key for OpenAI API. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `file` The audio file object (not file name) to transcribe, in one of the following formats: `flac`, `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `ogg`, `wav`, or `webm`. **Type**: `string` ### `language` The language of the input audio. Supplying the input language in ISO-639-1 format improves accuracy and latency. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: language: en # --- language: fr # --- language: de # --- language: zh ``` ### `model` The name of the OpenAI model to use. **Type**: `string` ```yaml # Examples: model: whisper-1 ``` ### `prompt` Optional text to guide the model’s style or continue a previous audio segment. The prompt should match the audio language. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `server_address` The OpenAI API endpoint to which the processor sends requests. Update the default value to use a different OpenAI-compatible service. **Type**: `string` **Default**: `https://api.openai.com/v1` --- # Page 225: openai_translation **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/openai_translation.md --- # openai_translation Translates spoken audio into English, using the OpenAI API. This processor sends an audio file object to OpenAI API to generate a translation. By default, the processor submits the entire payload of each message as a string, unless you use the `file` configuration field to customize it. To learn more about translation, see the [OpenAI API documentation](https://platform.openai.com/docs/guides/speech-to-text). #### Common ```yml processor: label: "" openai_translation: server_address: https://api.openai.com/v1 api_key: "" # No default (required) model: "" # No default (required) file: "" # No default (optional) ``` #### Advanced ```yml processor: label: "" openai_translation: server_address: https://api.openai.com/v1 api_key: "" # No default (required) model: "" # No default (required) file: "" # No default (optional) prompt: "" # No default (optional) ``` ## Fields ### `api_key` The API secret key for OpenAI API. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `file` The audio file object (not file name) to translate, in one of the following formats: `flac`, `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `ogg`, `wav`, or `webm`. **Type**: `string` ### `model` The name of the OpenAI model to use. **Type**: `string` ```yaml # Examples: model: whisper-1 ``` ### `prompt` Optional text to guide the model’s style or continue a previous audio segment. The prompt should match the audio language. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `server_address` The OpenAI API endpoint to which the processor sends requests. Update the default value to use a different OpenAI-compatible service. **Type**: `string` **Default**: `https://api.openai.com/v1` --- # Page 226: parallel **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/parallel.md --- # parallel A processor that applies a list of child processors to messages of a batch as though they were each a batch of one message (similar to the [`for_each`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/for_each/) processor), but where each message is processed in parallel. The field `cap`, if greater than zero, caps the maximum number of parallel processing threads. The functionality of this processor depends on being applied across messages that are batched. You can find out more about batching in [Message batching](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). #### Common ```yml processor: label: "" parallel: cap: 0 processors: [] # No default (required) ``` #### Advanced ```yml processor: label: "" parallel: cap: 0 processors: [] # No default (required) ``` ## Fields ### `cap` The maximum number of messages to have processing at a given time. **Type**: `int` **Default**: `0` ### `processors[]` A list of child processors to apply. **Type**: `array` --- # Page 227: parquet_decode **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/parquet_decode.md --- # parquet_decode Decodes [Parquet files](https://parquet.apache.org/docs/) into a batch of structured messages. This processor uses [https://github.com/parquet-go/parquet-go](https://github.com/parquet-go/parquet-go), which is itself experimental. As a result, how this processor functions can change outside of major version releases. #### Common ```yml processor: label: "" parquet_decode: handle_logical_types: v1 ``` #### Advanced ```yml processor: label: "" parquet_decode: handle_logical_types: v1 ``` ## Fields ### `handle_logical_types` Set to `v2` to enable enhanced decoding of logical types, or keep the default value (`v1`) to ignore logical type metadata when decoding values. In Parquet format, logical types are represented using standard physical types along with metadata that provides additional context. For example, UUIDs are stored as a `FIXED_LEN_BYTE_ARRAY` physical type, but the schema metadata identifies them as UUIDs. By enabling `v2`, this processor uses the metadata descriptions of logical types to produce more meaningful values during decoding. > 📝 **NOTE** > > Each version enables the logical type handling for that version and all earlier versions, which allows handling of new logical types to be introduced without breaking existing pipelines. When creating new pipelines, Redpanda recommends that you use the newest available version. **Type**: `string` **Default**: `v1` | Option | Summary | | --- | --- | | `v1` | No special handling of logical types | | `v2` | - TIMESTAMP - decodes as an RFC3339 string describing the time. If the `isAdjustedToUTC` flag is set to true in the parquet file, the time zone will be set to UTC. If it is set to false the time zone will be set to local time.
- UUID - decodes as a string, i.e. `00112233-4455-6677-8899-aabbccddeeff`. | ```yaml # Examples: handle_logical_types: v2 ``` ## Examples ### Reading Parquet Files from AWS S3 In this example we consume files from AWS S3 as they’re written by listening onto an SQS queue for upload events. We make sure to use the `to_the_end` scanner which means files are read into memory in full, which then allows us to use a `parquet_decode` processor to expand each file into a batch of messages. Finally, we write the data out to local files as newline delimited JSON. ```yaml input: aws_s3: bucket: TODO prefix: foos/ scanner: to_the_end: {} sqs: url: TODO processors: - parquet_decode: {} output: file: codec: lines path: './foos/${! meta("s3_key") }.jsonl' ``` --- # Page 228: parquet_encode **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/parquet_encode.md --- # parquet_encode Encodes [Parquet files](https://parquet.apache.org/docs/) from a batch of structured messages. This processor uses [https://github.com/parquet-go/parquet-go](https://github.com/parquet-go/parquet-go), which is itself experimental. As a result, how this processor functions can change outside of major version releases. #### Common ```yml processor: label: "" parquet_encode: schema: [] # No default (optional) schema_metadata: "" default_compression: uncompressed ``` #### Advanced ```yml processor: label: "" parquet_encode: schema: [] # No default (optional) schema_metadata: "" default_compression: uncompressed default_encoding: DELTA_LENGTH_BYTE_ARRAY default_timestamp_unit: NANOSECOND ``` ## Fields ### `default_compression` The default compression type to use for fields. **Type**: `string` **Default**: `uncompressed` **Options**: `uncompressed`, `snappy`, `gzip`, `brotli`, `zstd`, `lz4raw` ### `default_encoding` The default encoding type to use for fields. A custom default encoding is only necessary when consuming data with libraries that do not support `DELTA_LENGTH_BYTE_ARRAY`. **Type**: `string` **Default**: `DELTA_LENGTH_BYTE_ARRAY` **Options**: `DELTA_LENGTH_BYTE_ARRAY`, `PLAIN` ### `default_timestamp_unit` The precision used when encoding TIMESTAMP logical types. The default `NANOSECOND` matches historical behaviour, but `TIMESTAMP(NANOS)` is not readable by Apache Spark (Databricks), AWS Athena or DuckDB; set this to `MICROSECOND` (or `MILLISECOND`) when writing Parquet files intended for consumption by those engines. **Type**: `string` **Default**: `NANOSECOND` **Options**: `NANOSECOND`, `MICROSECOND`, `MILLISECOND` ### `schema[]` Parquet schema. **Type**: `array` ### `schema[].fields[]` A list of child fields. **Type**: `array` ```yaml # Examples: fields: - name: foo type: INT64 - name: bar type: BYTE_ARRAY ``` ### `schema[].name` The name of the column. **Type**: `string` ### `schema[].optional` Whether the field is optional. **Type**: `bool` **Default**: `false` ### `schema[].repeated` Whether the field is repeated. **Type**: `bool` **Default**: `false` ### `schema[].type` The type of the column, only applicable for leaf columns with no child fields. Some logical types can be specified here such as UTF8. **Type**: `string` **Options**: `BOOLEAN`, `INT32`, `INT64`, `FLOAT`, `DOUBLE`, `BYTE_ARRAY`, `UTF8`, `TIMESTAMP`, `BSON`, `ENUM`, `JSON`, `UUID` ### `schema_metadata` Optionally specify a metadata field containing a schema definition to use for encoding instead of a statically defined schema. For batches of messages, the first message’s schema will be applied to all subsequent messages of the batch. **Type**: `string` **Default**: `""` ## Examples ### Writing Parquet Files to AWS S3 In this example we use the batching mechanism of an `aws_s3` output to collect a batch of messages in memory, which then converts it to a parquet file and uploads it. ```yaml output: aws_s3: bucket: TODO path: 'stuff/${! timestamp_unix() }-${! uuid_v4() }.parquet' batching: count: 1000 period: 10s processors: - parquet_encode: schema: - name: id type: INT64 - name: weight type: DOUBLE - name: content type: BYTE_ARRAY default_compression: zstd ``` --- # Page 229: parse_log **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/parse_log.md --- # parse_log Parses common log [Formats](#formats) into [structured data](#codecs). This is easier and often much faster than `grok`. #### Common ```yml processor: label: "" parse_log: format: syslog_rfc5424 # No default (required) ``` #### Advanced ```yml processor: label: "" parse_log: format: syslog_rfc5424 # No default (required) best_effort: true allow_rfc3339: true default_year: current default_timezone: UTC ``` ## Fields ### `allow_rfc3339` Also accept timestamps in rfc3339 format while parsing. Applicable to format `syslog_rfc3164`. **Type**: `bool` **Default**: `true` ### `best_effort` Still returns partially parsed messages even if an error occurs. **Type**: `bool` **Default**: `true` ### `default_timezone` Sets the strategy to decide the timezone for rfc3164 timestamps. Applicable to format `syslog_rfc3164`. This value should follow the [time.LoadLocation](https://golang.org/pkg/time/#LoadLocation) format. **Type**: `string` **Default**: `UTC` ### `default_year` Sets the strategy used to set the year for rfc3164 timestamps. Applicable to format `syslog_rfc3164`. When set to `current` the current year will be set, when set to an integer that value will be used. Leave this field empty to not set a default year at all. **Type**: `string` **Default**: `current` ### `format` A common log [format](#formats) to parse. **Type**: `string` **Options**: `syslog_rfc5424`, `syslog_rfc3164` ## Codecs Currently the only supported structured data codec is `json`. ## Formats ### `syslog_rfc5424` Attempts to parse a log following the [Syslog RFC5424](https://tools.ietf.org/html/rfc5424) spec. The resulting structured document may contain any of the following fields: - `message` (string) - `timestamp` (string, RFC3339) - `facility` (int) - `severity` (int) - `priority` (int) - `version` (int) - `hostname` (string) - `procid` (string) - `appname` (string) - `msgid` (string) - `structureddata` (object) ### `syslog_rfc3164` Attempts to parse a log following the [Syslog rfc3164](https://tools.ietf.org/html/rfc3164) spec. The resulting structured document may contain any of the following fields: - `message` (string) - `timestamp` (string, RFC3339) - `facility` (int) - `severity` (int) - `priority` (int) - `hostname` (string) - `procid` (string) - `appname` (string) - `msgid` (string) --- # Page 230: processors **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/processors.md --- # processors A processor grouping several sub-processors. This processor is useful in situations where you want to collect several processors under a single resource identifier, whether it is for making your configuration easier to read and navigate, or for improving the testability of your configuration. The behavior of child processors will match exactly the behavior they would have under any other processors block. #### Common ```yml processor: label: "" processors: [] ``` #### Advanced ```yml processor: label: "" processors: [] ``` ## Examples ### Grouped Processing Imagine we have a collection of processors who cover a specific functionality. We could use this processor to group them together and make it easier to read and mock during testing by giving the whole block a label: ```yaml pipeline: processors: - label: my_super_feature processors: - log: message: "Let's do something cool" - archive: format: json_array - mapping: root.items = this ``` --- # Page 231: qdrant **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/qdrant.md --- # qdrant Query items within a [Qdrant](https://qdrant.tech/) collection. #### Common ```yml processor: label: "" qdrant: grpc_host: "" # No default (required) api_token: "" collection_name: "" # No default (required) vector_mapping: "" # No default (required) filter: "" # No default (optional) payload_fields: [] payload_filter: include limit: 10 ``` #### Advanced ```yml processor: label: "" qdrant: grpc_host: "" # No default (required) api_token: "" tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] collection_name: "" # No default (required) vector_mapping: "" # No default (required) filter: "" # No default (optional) payload_fields: [] payload_filter: include limit: 10 ``` ## Fields ### `api_token` The Qdrant API token to use for authentication, which defaults to an empty string. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `collection_name` The name of the Qdrant collection you want to query. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `filter` Specify additional filtering to perform on returned results. Mappings must return a valid Qdrant filter using the proto3-encoded form. For examples, see the [Qdrant documentation](https://qdrant.tech/documentation/concepts/filtering/). **Type**: `string` ```yaml # Examples: filter: | root.must = [ {"has_id":{"has_id":[{"num": 8}, { "uuid":"1234-5678-90ab-cdef" }]}}, {"field":{"key": "city", "match": {"text": "London"}}}, ] # --- filter: | root.must = [ {"field":{"key": "city", "match": {"text": "London"}}}, ] root.must_not = [ {"field":{"color": "city", "match": {"text": "red"}}}, ] ``` ### `grpc_host` The gRPC host of the Qdrant server. **Type**: `string` ```yaml # Examples: grpc_host: localhost:6334 # --- grpc_host: xyz-example.eu-central.aws.cloud.qdrant.io:6334 ``` ### `limit` The maximum number of points to return from the collection. **Type**: `int` **Default**: `10` ### `payload_fields[]` The fields to include or exclude in returned results. Use this field in combination with `payload_filter`. **Type**: `array` **Default**: `[]` ### `payload_filter` Whether to include or exclude the fields specified in `payload_fields` from the returned results. **Type**: `string` **Default**: `include` | Option | Summary | | --- | --- | | `exclude` | Exclude the payload fields specified in `payload_fields`. | | `include` | Include the payload fields specified in `payload_fields`. | ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `vector_mapping` A mapping that extracts the search vector from the input message. The processor uses this vector to query the collection. **Type**: `string` ```yaml # Examples: vector_mapping: root = [1.2, 0.5, 0.76] # --- vector_mapping: root = this.vector # --- vector_mapping: root = [[0.352,0.532,0.532,0.234],[0.352,0.532,0.532,0.234]] # --- vector_mapping: 'root = {"some_sparse": {"indices":[23,325,532],"values":[0.352,0.532,0.532]}}' # --- vector_mapping: 'root = {"some_multi": [[0.352,0.532,0.532,0.234],[0.352,0.532,0.532,0.234]]}' # --- vector_mapping: 'root = {"some_dense": [0.352,0.532,0.532,0.234]}' ``` --- # Page 232: rate_limit **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/rate_limit.md --- # rate_limit Throttles the throughput of a pipeline according to a specified [`rate_limit`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/about/) resource. Rate limits are shared across components and therefore apply globally to all processing pipelines. #### Common ```yml processor: label: "" rate_limit: resource: "" # No default (required) ``` #### Advanced ```yml processor: label: "" rate_limit: resource: "" # No default (required) ``` ## Fields ### `resource` The target [`rate_limit` resource](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/about/). **Type**: `string` --- # Page 233: redis_script **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/redis_script.md --- # redis_script Performs actions against Redis using [LUA scripts](https://redis.io/docs/latest/develop/programmability/eval-intro/). Actions are performed for each message and the message contents are replaced with the result. In order to merge the result into the original message compose this processor within a [`branch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/). #### Common ```yml processor: label: "" redis_script: url: "" # No default (required) script: "" # No default (required) args_mapping: "" # No default (required) keys_mapping: "" # No default (required) ``` #### Advanced ```yml processor: label: "" redis_script: url: "" # No default (required) kind: simple master: "" client_name: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] script: "" # No default (required) args_mapping: "" # No default (required) keys_mapping: "" # No default (required) retries: 3 retry_period: 500ms ``` ## Examples ### Running a script The following example will use a script execution to get next element from a sorted set and set its score with timestamp unix nano value. ```yaml pipeline: processors: - redis_script: url: TODO script: | local value = redis.call("ZRANGE", KEYS[1], '0', '0') if next(elements) == nil then return '' end redis.call("ZADD", "XX", KEYS[1], ARGV[1], value) return value keys_mapping: 'root = [ meta("key") ]' args_mapping: 'root = [ timestamp_unix_nano() ]' ``` ## Fields ### `args_mapping` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that evaluates to an array of values passed to the script, where they are available as `ARGV[1]`, `ARGV[2]`, and so on. **Type**: `string` ```yaml # Examples: args_mapping: root = [ this.key ] # --- args_mapping: root = [ meta("kafka_key"), "hardcoded_value" ] ``` ### `client_name` Set the client name for the Redis connection. **Type**: `string` **Default**: `redpanda-connect` ### `keys_mapping` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) which should evaluate to an array of keys matching in size to the number of arguments required for the specified Redis script. **Type**: `string` ```yaml # Examples: keys_mapping: root = [ this.key ] # --- keys_mapping: root = [ meta("kafka_key"), this.count ] ``` ### `kind` Specifies a simple, cluster-aware, or failover-aware redis client. **Type**: `string` **Default**: `simple` **Options**: `simple`, `cluster`, `failover` ### `master` Name of the redis master when `kind` is `failover` **Type**: `string` **Default**: `""` ```yaml # Examples: master: mymaster ``` ### `retries` The maximum number of retries before abandoning a request. **Type**: `int` **Default**: `3` ### `retry_period` The time to wait before consecutive retry attempts. **Type**: `string` **Default**: `500ms` ### `script` A script to use for the target operator. It has precedence over the 'command' field. **Type**: `string` ```yaml # Examples: script: return redis.call('set', KEYS[1], ARGV[1]) ``` ### `tls` Custom TLS settings can be used to override system defaults. **Troubleshooting** Some cloud hosted instances of Redis (such as Azure Cache) might need some hand holding in order to establish stable connections. Unfortunately, it is often the case that TLS issues will manifest as generic error messages such as "i/o timeout". If you’re using TLS and are seeing connectivity problems consider setting `enable_renegotiation` to `true`, and ensuring that the server supports at least TLS version 1.2. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL of the target Redis server. Database is optional and is supplied as the URL path. **Type**: `string` ```yaml # Examples: url: redis://:6379 # --- url: redis://localhost:6379 # --- url: redis://foousername:foopassword@redisplace:6379 # --- url: redis://:foopassword@redisplace:6379 # --- url: redis://localhost:6379/1 # --- url: redis://localhost:6379/1,redis://localhost:6380/1 ``` --- # Page 234: redis **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/redis.md --- # redis Performs actions against Redis that aren’t possible using a [`cache`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cache/) processor. Actions are performed for each message and the message contents are replaced with the result. In order to merge the result into the original message compose this processor within a [`branch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/). #### Common ```yml processor: label: "" redis: url: "" # No default (required) command: "" # No default (optional) args_mapping: "" # No default (optional) ``` #### Advanced ```yml processor: label: "" redis: url: "" # No default (required) kind: simple master: "" client_name: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] command: "" # No default (optional) args_mapping: "" # No default (optional) retries: 3 retry_period: 500ms ``` ## Examples ### Querying Cardinality If given payloads containing a metadata field `set_key` it’s possible to query and store the cardinality of the set for each message using a [`branch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/) in order to augment rather than replace the message contents: ```yaml pipeline: processors: - branch: processors: - redis: url: TODO command: scard args_mapping: 'root = [ meta("set_key") ]' result_map: 'root.cardinality = this' ``` ### Running Total If we have JSON data containing number of friends visited during covid 19: ```json {"name":"ash","month":"feb","year":2019,"friends_visited":10} {"name":"ash","month":"apr","year":2019,"friends_visited":-2} {"name":"bob","month":"feb","year":2019,"friends_visited":3} {"name":"bob","month":"apr","year":2019,"friends_visited":1} ``` We can add a field that contains the running total number of friends visited: ```json {"name":"ash","month":"feb","year":2019,"friends_visited":10,"total":10} {"name":"ash","month":"apr","year":2019,"friends_visited":-2,"total":8} {"name":"bob","month":"feb","year":2019,"friends_visited":3,"total":3} {"name":"bob","month":"apr","year":2019,"friends_visited":1,"total":4} ``` Using the `incrby` command: ```yaml pipeline: processors: - branch: processors: - redis: url: TODO command: incrby args_mapping: 'root = [ this.name, this.friends_visited ]' result_map: 'root.total = this' ``` ## Fields ### `args_mapping` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that evaluates to an array of arguments for `command`, such as the key followed by any values. The array must contain as many values as the Redis command requires. **Type**: `string` ```yaml # Examples: args_mapping: root = [ this.key ] # --- args_mapping: root = [ meta("kafka_key"), this.count ] ``` ### `client_name` Set the client name for the Redis connection. **Type**: `string` **Default**: `redpanda-connect` ### `command` The command to execute. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: command: scard # --- command: incrby # --- command: ${! meta("command") } ``` ### `kind` Specifies a simple, cluster-aware, or failover-aware redis client. **Type**: `string` **Default**: `simple` **Options**: `simple`, `cluster`, `failover` ### `master` Name of the redis master when `kind` is `failover` **Type**: `string` **Default**: `""` ```yaml # Examples: master: mymaster ``` ### `retries` The maximum number of retries before abandoning a request. **Type**: `int` **Default**: `3` ### `retry_period` The time to wait before consecutive retry attempts. **Type**: `string` **Default**: `500ms` ### `tls` Custom TLS settings can be used to override system defaults. **Troubleshooting** Some cloud hosted instances of Redis (such as Azure Cache) might need some hand holding in order to establish stable connections. Unfortunately, it is often the case that TLS issues will manifest as generic error messages such as "i/o timeout". If you’re using TLS and are seeing connectivity problems consider setting `enable_renegotiation` to `true`, and ensuring that the server supports at least TLS version 1.2. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL of the target Redis server. Database is optional and is supplied as the URL path. **Type**: `string` ```yaml # Examples: url: redis://:6379 # --- url: redis://localhost:6379 # --- url: redis://foousername:foopassword@redisplace:6379 # --- url: redis://:foopassword@redisplace:6379 # --- url: redis://localhost:6379/1 # --- url: redis://localhost:6379/1,redis://localhost:6380/1 ``` --- # Page 235: resource **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/resource.md --- # resource Resource is a processor type that runs a processor resource identified by its label. This processor allows you to reference the same configured processor resource in multiple places, and can also tidy up large nested configs. For example, the config: ```yaml pipeline: processors: - mapping: | root.message = this root.meta.link_count = this.links.length() root.user.age = this.user.age.number() ``` Is equivalent to: ```yaml pipeline: processors: - resource: foo_proc processor_resources: - label: foo_proc mapping: | root.message = this root.meta.link_count = this.links.length() root.user.age = this.user.age.number() ``` You can find out more about resources in [Resources](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/resources/) ## Common ```yml processor: resource: "" ``` ## Advanced ```yml processor: resource: "" ``` --- # Page 236: retry **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/retry.md --- # retry > ⚠️ **CAUTION** > > This component is in beta. Its behavior might change in a future release. Attempts to execute a series of child processors until success. Executes child processors and if a resulting message is errored then, after a specified backoff period, the same original message will be attempted again through those same processors. If the child processors result in more than one message then the retry mechanism will kick in if _any_ of the resulting messages are errored. It is important to note that any mutations performed on the message during these child processors will be discarded for the next retry, and therefore it is safe to assume that each execution of the child processors will always be performed on the data as it was when it first reached the retry processor. By default the retry backoff has a specified [`max_elapsed_time`](#backoffmax_elapsed_time), if this time period is reached during retries and an error still occurs these errored messages will proceed through to the next processor after the retry (or your outputs). Normal [error handling patterns](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/) can be used on these messages. In order to avoid permanent loops any error associated with messages as they first enter a retry processor will be cleared. ## Metadata This processor adds the following metadata fields to each message: - `retry_count` - The number of retry attempts. - `backoff_duration` - The total time (in nanoseconds) elapsed while performing retries. > ⚠️ **CAUTION: Batching** > > Batching > > If you wish to wrap a batch-aware series of processors then take a look at the [batching section](#batching). ### Common ```yml processor: label: "" retry: backoff: initial_interval: 500ms max_interval: 10s max_elapsed_time: 1m processors: [] # No default (required) parallel: false max_retries: 0 ``` ### Advanced ```yml processor: label: "" retry: backoff: initial_interval: 500ms max_interval: 10s max_elapsed_time: 1m processors: [] # No default (required) parallel: false max_retries: 0 ``` ## Examples ### Stop ignoring me Taz Here we have a config where I generate animal noises and send them to Taz via HTTP. Taz has a tendency to stop his servers whenever I dispatch my animals upon him, and therefore these HTTP requests sometimes fail. However, I have the retry processor and with this super power I can specify a back off policy and it will ensure that for each animal noise the HTTP processor is attempted until either it succeeds or my Redpanda Connect instance is stopped. I even go as far as to zero-out the maximum elapsed time field, which means that for each animal noise I will wait indefinitely, because I really really want Taz to receive every single animal noise that he is entitled to. ```yaml input: generate: interval: 1s mapping: 'root.noise = [ "woof", "meow", "moo", "quack" ].index(random_int(min: 0, max: 3))' pipeline: processors: - retry: backoff: initial_interval: 100ms max_interval: 5s max_elapsed_time: 0s processors: - http: url: 'http://example.com/try/not/to/dox/taz' verb: POST output: # Drop everything because it's junk data, I don't want it lol drop: {} ``` ## Fields ### `backoff` Determine time intervals and cut offs for retry attempts. **Type**: `object` ### `backoff.initial_interval` The initial period to wait between retry attempts. The retry interval increases for each failed attempt, up to the `max_interval` value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `500ms` ```yaml # Examples: initial_interval: 50ms # --- initial_interval: 1s ``` ### `backoff.max_elapsed_time` The maximum overall period of time to spend on retry attempts before the request is aborted. Setting this value to a zeroed duration (such as `0s`) will result in unbounded retries. **Type**: `string` **Default**: `1m` ```yaml # Examples: max_elapsed_time: 1m # --- max_elapsed_time: 1h ``` ### `backoff.max_interval` The maximum period to wait between retry attempts **Type**: `string` **Default**: `10s` ```yaml # Examples: max_interval: 5s # --- max_interval: 1m ``` ### `max_retries` The maximum number of retry attempts before the request is aborted. Setting this value to `0` will result in unbounded number of retries. **Type**: `int` **Default**: `0` ### `parallel` When processing batches of messages these batches are ignored and the processors apply to each message sequentially. However, when this field is set to `true` each message will be processed in parallel. Caution should be made to ensure that batch sizes do not surpass a point where this would cause resource (CPU, memory, API limits) contention. **Type**: `bool` **Default**: `false` ### `processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to execute on each message. **Type**: `array` ## Batching When messages are batched the child processors of a retry are executed for each individual message in isolation, performed serially by default but in parallel when the field [`parallel`](#parallel) is set to `true`. This is an intentional limitation of the retry processor and is done in order to ensure that errors are correctly associated with a given input message. Otherwise, the archiving, expansion, grouping, filtering and so on of the child processors could obfuscate this relationship. If the target behavior of your retried processors is "batch aware", in that you wish to perform some processing across the entire batch of messages and repeat it in the event of errors, you can use an [`archive` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/archive/) to collapse the batch into an individual message. Then, within these child processors either perform your batch aware processing on the archive, or use an [`unarchive` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/unarchive/) in order to expand the single message back out into a batch. For example, if the retry processor were being used to wrap an HTTP request where the payload data is a batch archived into a JSON array it should look something like this: ```yaml pipeline: processors: - archive: format: json_array - retry: processors: - http: url: example.com/nope verb: POST - unarchive: format: json_array ``` --- # Page 237: schema_registry_decode **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/schema_registry_decode.md --- # schema_registry_decode Automatically decodes and validates messages with schemas from a Confluent Schema Registry service. Decodes messages automatically from a schema stored within a [Confluent Schema Registry service](https://docs.confluent.io/platform/current/schema-registry/index.html) by extracting a schema ID from the message and obtaining the associated schema from the registry. If a message fails to match against the schema then it will remain unchanged and the error can be caught using [error handling methods](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). This processor uses the [Franz Kafka Schema Registry client](https://github.com/twmb/franz-go/tree/master/pkg/sr). Avro, Protobuf and Json schemas are supported, all are capable of expanding from schema references as of v4.22.0. ## Avro JSON format This processor creates documents formatted as [Avro JSON](https://avro.apache.org/docs/current/specification/#json-encoding) when decoding with Avro schemas. In this format the value of a union is encoded in JSON as follows: - if its type is `null`, then it is encoded as a JSON `null`; - otherwise it is encoded as a JSON object with one name/value pair whose name is the type’s name and whose value is the recursively encoded value. For Avro’s named types (record, fixed or enum) the user-specified name is used, for other types the type name is used. For example, the union schema `["null","string","Foo"]`, where `Foo` is a record name, would encode: - `null` as `null`; - the string `"a"` as `{"string": "a"}`; and - a `Foo` instance as `{"Foo": {…​}}`, where `{…​}` indicates the JSON encoding of a `Foo` instance. However, it is possible to instead create documents in standard/raw JSON format by setting the field [`avro.raw_unions`](#avro-raw_unions) to `true`. ## Protobuf format This processor decodes protobuf messages to JSON documents, you can read more about JSON mapping of protobuf messages here: [https://developers.google.com/protocol-buffers/docs/proto3#json](https://developers.google.com/protocol-buffers/docs/proto3#json) ## Metadata This processor also adds the following metadata to each outgoing message: schema_id: the ID of the schema in the schema registry that was associated with the message. ### Common ```yml processor: label: "" schema_registry_decode: avro: raw_unions: false # No default (optional) preserve_logical_types: false translate_kafka_connect_types: false store_schema_metadata: "" # No default (optional) protobuf: use_proto_names: false use_enum_numbers: false emit_unpopulated: false emit_default_values: false serialize_to_json: true json: coerce_data: false cache_duration: 10m url: "" # No default (required) default_schema_id: 0 # No default (optional) ``` ### Advanced ```yml processor: label: "" schema_registry_decode: avro: raw_unions: false # No default (optional) preserve_logical_types: false translate_kafka_connect_types: false mapping: "" # No default (optional) store_schema_metadata: "" # No default (optional) protobuf: use_proto_names: false use_enum_numbers: false emit_unpopulated: false emit_default_values: false serialize_to_json: true json: coerce_data: false cache_duration: 10m url: "" # No default (required) default_schema_id: 0 # No default (optional) oauth: enabled: false consumer_key: "" consumer_secret: "" access_token: "" access_token_secret: "" basic_auth: enabled: false username: "" password: "" jwt: enabled: false private_key_file: "" signing_method: "" claims: {} headers: {} tls: skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] ``` ## Fields ### `avro` Configuration for how to decode schemas that are of type AVRO. **Type**: `object` ### `avro.mapping` Define a custom mapping to apply to the JSON representation of Avro schemas. You can use mappings to convert custom types emitted by other tools, such as Debezium, into standard Avro types. **Type**: `string` ```yaml # Examples: mapping: | map isDebeziumTimestampType { root = this.type == "long" && this."connect.name" == "io.debezium.time.Timestamp" && !this.exists("logicalType") } map debeziumTimestampToAvroTimestamp { let mapped_fields = this.fields.or([]).map_each(item -> item.apply("debeziumTimestampToAvroTimestamp")) root = match { this.type == "record" => this.assign({"fields": $mapped_fields}) this.type.type() == "array" => this.assign({"type": this.type.map_each(item -> item.apply("debeziumTimestampToAvroTimestamp"))}) # Add a logical type so that it's decoded as a timestamp instead of a long. this.type.type() == "object" && this.type.apply("isDebeziumTimestampType") => this.merge({"type":{"logicalType": "timestamp-millis"}}) _ => this } } root = this.apply("debeziumTimestampToAvroTimestamp") ``` ### `avro.preserve_logical_types` Choose whether to: - Transform logical types into their primitive type (default). For example, decimals become raw bytes and timestamps become plain integers. - Preserve logical types. Set to `true` to preserve logical types, which keeps decimal types as numbers in Bloblang and timestamps as time values. **Type**: `bool` **Default**: `false` ### `avro.raw_unions` Whether Avro messages should be decoded into normal JSON (JSON that meets the expectations of regular internet JSON) rather than [Avro JSON](https://avro.apache.org/docs/current/specification/#json-encoding). If set to `false` (default), Avro messages are decoded as Avro JSON. For example, the union schema `["null","string","Transaction"]`, where `Transaction` is a record name, would be decoded as: - A `null` as a JSON `null` - The string `"a"` as `{"string": "a"}` - A `Transaction` instance as `{"Transaction": {…​}}`, where `{…​}` indicates the JSON encoding of a `Transaction` instance. If set to `true`, Avro messages are decoded as standard JSON. For example, the same union schema `["null","string","Transaction"]` is decoded as: - A `null` as JSON `null` - The string `"a"` as `"a"` - A `Transaction` instance as `{…​}`, where `{…​}` indicates the JSON encoding of a `Transaction` instance. **Type**: `bool` ### `avro.store_schema_metadata` Optionally store the schema used to decode messages as a metadata field under the given name. This field can later be referenced in other components such as a `parquet_encode` processor in order to automatically infer their schema. **Type**: `string` ### `avro.translate_kafka_connect_types` Only valid if preserve_logical_types is true. This decodes various Kafka Connect types into their bloblang equivalents when not representable by standard logical types according to the Avro standard. Types that are currently translated: | Type Name | Bloblang Type | Description | | --- | --- | --- | | io.debezium.time.Date | timestamp | Date without time (days since epoch) | | io.debezium.time.Timestamp | timestamp | Timestamp without timezone (milliseconds since epoch) | | io.debezium.time.MicroTimestamp | timestamp | Timestamp with microsecond precision | | io.debezium.time.NanoTimestamp | timestamp | Timestamp with nanosecond precision | | io.debezium.time.ZonedTimestamp | timestamp | Timestamp with timezone (ISO-8601 format) | | io.debezium.time.Year | timestamp at January 1st at 00:00:00 | Year value | | io.debezium.time.Time | timestamp at the unix epoch | Time without date (milliseconds past midnight) | | io.debezium.time.MicroTime | timestamp at the unix epoch | Time with microsecond precision | | io.debezium.time.NanoTime | timestamp at the unix epoch | Time with nanosecond precision | **Type**: `bool` **Default**: `false` ### `basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `cache_duration` The duration after which a cached schema is considered stale and is removed from the cache. **Type**: `string` **Default**: `10m` ```yaml # Examples: cache_duration: 1h # --- cache_duration: 5m ``` ### `default_schema_id` This schema ID is used when a message’s schema header cannot be read (`ErrBadHeader`). If this value is not set, schema header errors are returned. This configuration does not work with protobuf schemas. > 💡 **TIP** > > You can also use the [`with_schema_registry_header`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/#with_schema_registry_header) bloblang function to add a schema ID to messages. **Type**: `int` ### `json` Configuration for how to decode schemas that are of type JSON. **Type**: `object` ### `json.coerce_data` Whether decoded values should be coerced to match the types declared in the JSON Schema. By default JSON Schema decoding only validates the message and leaves it untouched, which means numbers are later interpreted as floating point (`double`) and date-time values as strings. When set to `true` the decoder rebuilds the message so that values match the schema: `integer` fields become 64-bit integers, `number` fields stay floating point, `string` fields with `format: date-time` become timestamps, and any `default` values declared in the schema are applied to absent fields. This is useful for downstream components that infer their schema from the decoded values, such as the `iceberg` outputs, which will then create `bigint` columns for integer fields rather than `double`. Note that, unlike the default behavior, this is no longer a read-only operation: the message contents are transformed. Because coercion is stricter than validation, a message that passes validation may still fail coercion (for example an integer that overflows a 64-bit value, or a `date-time` string that is not valid RFC 3339), in which case the error can be caught using [error handling methods](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). **Type**: `bool` **Default**: `false` ### `jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `protobuf` Configuration for how to decode schemas that are of type PROTOBUF. **Type**: `object` ### `protobuf.emit_default_values` Whether to emit default-valued primitive fields, empty lists, and empty maps. emit_unpopulated takes precedence over emit_default_values **Type**: `bool` **Default**: `false` ### `protobuf.emit_unpopulated` Whether to emit unpopulated fields. It does not emit unpopulated oneof fields or unpopulated extension fields. **Type**: `bool` **Default**: `false` ### `protobuf.serialize_to_json` If messages should be serialized to JSON bytes. If false then the message is kept in decoded form, which means that 64 bit integers are not converted to strings and types for bytes and google.protobuf.Timestamp are preserved (as they are not serialized to JSON strings). **Type**: `bool` **Default**: `true` ### `protobuf.use_enum_numbers` Emits enum values as numbers. **Type**: `bool` **Default**: `false` ### `protobuf.use_proto_names` Use proto field name instead of lowerCamelCase name. **Type**: `bool` **Default**: `false` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The base URL of the schema registry service. **Type**: `string` --- # Page 238: schema_registry_encode **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/schema_registry_encode.md --- # schema_registry_encode Automatically encodes and validates messages with schemas from a Confluent Schema Registry service. Encodes messages automatically from schemas obtained from a [Confluent Schema Registry service](https://docs.confluent.io/platform/current/schema-registry/index.html) by polling the service for the latest schema version for target subjects. This processor uses the [Franz Kafka Schema Registry client](https://github.com/twmb/franz-go/tree/master/pkg/sr). Alternatively, when `schema_metadata` is set, the processor reads a schema in benthos common schema format from message metadata (as produced by CDC inputs such as `postgresql`, `mysql_cdc`, and `microsoft_sql_server_cdc`), converts it to the target `format` (Avro or JSON Schema), registers it with the schema registry, and encodes the message. This is useful when the schema is not pre-registered in the registry and instead travels with the data. If a message fails to encode under the schema then it will remain unchanged and the error can be caught using [error handling methods](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). Avro, Protobuf and JSON Schema formats are supported. In registry-pull mode all three are auto-detected from the registry. In metadata mode Avro and JSON Schema are supported, with the target format selected via the `format` field. Schema references are supported in registry-pull mode as of v4.22.0. ## Avro JSON format By default this processor expects documents formatted as [Avro JSON](https://avro.apache.org/docs/current/specification/#json-encoding) when encoding with Avro schemas. In this format the value of a union is encoded in JSON as follows: - if its type is `null`, then it is encoded as a JSON `null`; - otherwise it is encoded as a JSON object with one name/value pair whose name is the type’s name and whose value is the recursively encoded value. For Avro’s named types (record, fixed or enum) the user-specified name is used, for other types the type name is used. For example, the union schema `["null","string","Foo"]`, where `Foo` is a record name, would encode: - `null` as `null`; - the string `"a"` as `\{"string": "a"}`; and - a `Foo` instance as `\{"Foo": {…​}}`, where `{…​}` indicates the JSON encoding of a `Foo` instance. However, it is possible to instead consume documents in standard/raw JSON format by setting `avro.raw_json` to `true`. This is strongly recommended when using `schema_metadata` mode, as CDC sources emit standard JSON rather than Avro JSON. > 📝 **NOTE** > > The top-level `avro_raw_json` field is deprecated in favor of `avro.raw_json`. ## Protobuf format This processor encodes protobuf messages either from any format parsed within Redpanda Connect (encoded as JSON by default), or from raw JSON documents, you can read more about JSON mapping of protobuf messages here: [https://developers.google.com/protocol-buffers/docs/proto3#json](https://developers.google.com/protocol-buffers/docs/proto3#json) ### Multiple message support When a target subject presents a protobuf schema that contains multiple messages it becomes ambiguous which message definition a given input data should be encoded against. In such scenarios Redpanda Connect will attempt to encode the data against each of them and select the first to successfully match against the data, this process currently **ignores all nested message definitions**. In order to speed up this exhaustive search the last known successful message will be attempted first for each subsequent input. We will be considering alternative approaches in future so please [get in touch](https://redpanda.com/slack) with thoughts and feedback. #### Common ```yml processor: label: "" schema_registry_encode: url: "" # No default (required) subject: "" # No default (required) refresh_period: 10m schema_metadata: "" format: "" # No default (optional) avro: raw_json: false # No default (optional) record_name: "" namespace: "" ``` #### Advanced ```yml processor: label: "" schema_registry_encode: url: "" # No default (required) subject: "" # No default (required) refresh_period: 10m schema_metadata: "" format: "" # No default (optional) normalize: true avro: raw_json: false # No default (optional) input_encoding: auto record_name: "" namespace: "" oauth: enabled: false consumer_key: "" consumer_secret: "" access_token: "" access_token_secret: "" basic_auth: enabled: false username: "" password: "" jwt: enabled: false private_key_file: "" signing_method: "" claims: {} headers: {} tls: skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] ``` ## Fields ### `avro` Configuration for Avro encoding. **Type**: `object` ### `avro.input_encoding` How the values in each message should be read. Avro JSON and plain JSON disagree about strings, and neither reading is a superset of the other. Avro JSON spells a `bytes` or `fixed` value as one codepoint per byte, so the unscaled decimal `0x21` is the string `"!"`; the plain reading takes a string for a decimal as decimal notation, so `"3.33"` means 3.33. The same JSON string is therefore a different value under each, and only the pipeline knows which was meant. - `auto` (the default) picks the reader from the form each message arrives in: a raw payload is read as Avro JSON, a structured message as Go values. This is right for `schema_registry_decode` feeding this processor directly, and for CDC sources, but a processor in between (a `mapping`, a `branch`) parses the payload and leaves the message structured, at which point its Avro JSON values are read the plain way and a bytes-backed decimal fails to encode. - `avro_json` reads every message as Avro JSON. Set this when the data came from `schema_registry_decode`, including when something between the two processors has parsed it. A message that carries Go values Avro JSON has no spelling for (a `[]byte` from `content()` or `decode("base64")`, or the `[]byte` and `time.Time` values that `preserve_logical_types` produces for bytes, fixed and timestamp fields) is rejected rather than encoded as the wrong value, so a pipeline that mixes those with Avro JSON values has no mode that reads both: map such fields to their Avro JSON spelling first, or split the encode. - `native` reads every message as Go and plain JSON values. Set this for hand-written JSON and for sources that spell decimals in decimal notation. This is independent of `raw_json`, which does not affect how values are read. **Type**: `string` **Default**: `auto` **Options**: `auto`, `avro_json`, `native` ### `avro.namespace` The Avro namespace for the root record type when encoding from a common schema (schema_metadata mode). **Type**: `string` **Default**: `""` ### `avro.raw_json` Whether messages encoded in Avro format should be parsed as normal JSON rather than Avro JSON. Overrides the deprecated top-level `avro_raw_json` when set. **Type**: `bool` ### `avro.record_name` The name to use for the root Avro record type when encoding from a common schema (schema_metadata mode). If empty, derived from the subject. **Type**: `string` **Default**: `""` ### `basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `format` The encoding format to use when converting a common schema from metadata. Required when `schema_metadata` is set. **Type**: `string` **Options**: `avro`, `json_schema` ### `jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `normalize` Whether to normalize the schema before registering with the schema registry (schema_metadata mode only). **Type**: `bool` **Default**: `true` ### `oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `refresh_period` The period after which a schema is refreshed for each subject, this is done by polling the schema registry service. **Type**: `string` **Default**: `10m` ```yaml # Examples: refresh_period: 60s # --- refresh_period: 1h ``` ### `schema_metadata` When set, the processor reads a schema in benthos common schema format from this metadata key on each message, converts it to the format specified by `format`, registers it with the schema registry under the configured subject, and encodes the message. When empty (the default), the processor pulls the latest schema from the registry instead. **Type**: `string` **Default**: `""` ### `subject` The schema subject to derive schemas from. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ```yaml # Examples: subject: foo # --- subject: ${! meta("kafka_topic") } ``` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The base URL of the schema registry service. **Type**: `string` --- # Page 239: select_parts **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/select_parts.md --- # select_parts Cherry pick a set of messages from a batch by their index. Indexes larger than the number of messages are simply ignored. The selected parts are added to the new message batch in the same order as the selection array. E.g. with 'parts' set to \[ 2, 0, 1 \] and the message parts \[ '0', '1', '2', '3' \], the output will be \[ '2', '0', '1' \]. If none of the selected parts exist in the input batch (resulting in an empty output message) the batch is dropped entirely. Message indexes can be negative, and if so the part will be selected from the end counting backwards starting from -1. E.g. if index = -1 then the selected part will be the last part of the message, if index = -2 then the part before the last element with be selected, and so on. This processor is only applicable to [batched messages](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). #### Common ```yml processor: label: "" select_parts: parts: [] ``` #### Advanced ```yml processor: label: "" select_parts: parts: [] ``` ## Fields ### `parts[]` An array of message indexes of a batch. Indexes can be negative, and if so the part will be selected from the end counting backwards starting from -1. **Type**: `array` **Default**: `[]` --- # Page 240: slack_thread **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/slack_thread.md --- # slack_thread Reads a Slack thread using the Slack API method conversations.replies. This processor calls the [`conversations.replies`](https://api.slack.com/methods/conversations.replies) Slack API method and replaces the message content with a JSON array of all messages in the thread. #### Common ```yml processor: label: "" slack_thread: bot_token: "" # No default (required) channel_id: "" # No default (required) thread_ts: "" # No default (required) ``` #### Advanced ```yml processor: label: "" slack_thread: bot_token: "" # No default (required) channel_id: "" # No default (required) thread_ts: "" # No default (required) ``` ## Fields ### `bot_token` Your Slack bot user’s OAuth token, which must have the correct permissions to read messages from the Slack channel specified in `channel_id`. **Type**: `string` ### `channel_id` The encoded ID of the Slack channel from which to read threads. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` ### `thread_ts` The timestamp of the parent message of the thread you want to read. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` --- # Page 241: sleep **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/sleep.md --- # sleep Sleep for a period of time specified as a duration string for each message. This processor will interpolate functions within the `duration` field, you can find a list of functions [here](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). #### Common ```yml processor: label: "" sleep: duration: "" # No default (required) ``` #### Advanced ```yml processor: label: "" sleep: duration: "" # No default (required) ``` ## Fields ### `duration` The duration of time to sleep for each execution. This field supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). **Type**: `string` --- # Page 242: split **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/split.md --- # split Breaks message batches (synonymous with multiple part messages) into smaller batches. The size of the resulting batches are determined either by a discrete size or, if the field `byte_size` is non-zero, then by total size in bytes (which ever limit is reached first). This processor is for breaking batches down into smaller ones. In order to break a single message out into multiple messages use the [`unarchive` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/unarchive/). If there is a remainder of messages after splitting a batch the remainder is also sent as a single batch. For example, if your target size was 10, and the processor received a batch of 95 message parts, the result would be 9 batches of 10 messages followed by a batch of 5 messages. #### Common ```yml processor: label: "" split: size: 1 byte_size: 0 ``` #### Advanced ```yml processor: label: "" split: size: 1 byte_size: 0 ``` ## Fields ### `byte_size` An optional target of total message bytes. **Type**: `int` **Default**: `0` ### `size` The target number of messages. **Type**: `int` **Default**: `1` --- # Page 243: sql_insert **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/sql_insert.md --- # sql_insert Inserts rows into an SQL database for each message, and leaves the message unchanged. If the query fails to execute, the message remains unchanged and the error can be caught using [error handling methods](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). #### Common ```yml processor: label: "" sql_insert: driver: mysql # No default (required) dsn: "" # No default (required) table: "" # No default (required) columns: [] # No default (required) args_mapping: "" # No default (required) ``` #### Advanced ```yml processor: label: "" sql_insert: driver: mysql # No default (required) dsn: "" # No default (required) table: "" # No default (required) columns: [] # No default (required) args_mapping: "" # No default (required) prefix: "" # No default (optional) suffix: "" # No default (optional) options: [] # No default (optional) init_files: [] # No default (optional) init_statement: "" # No default (optional) conn_max_idle_time: "" # No default (optional) conn_max_life_time: "" # No default (optional) conn_max_idle: 2 conn_max_open: 0 # No default (optional) ``` If the insert fails to execute then the message will still remain unchanged and the error can be caught using [error handling methods](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). ## Examples ### Table Insert (MySQL) Here we insert rows into a database by populating the columns id, name and topic with values extracted from messages and metadata: ```yaml pipeline: processors: - sql_insert: driver: mysql dsn: foouser:foopassword@tcp(localhost:3306)/foodb table: footable columns: [ id, name, topic ] args_mapping: | root = [ this.user.id, this.user.name, meta("kafka_topic"), ] ``` ## Dynamic SQL operations The `table` and `columns` fields are static strings that do not support Bloblang interpolation. For dynamic table names, dynamic column lists, DELETE operations, or any other SQL that `sql_insert` cannot express, use the [`sql_raw` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/sql_raw/) instead. To use Bloblang interpolation inside ``sql_raw’s `query`` field, you must enable `unsafe_dynamic_query: true`. > ⚠️ **CAUTION** > > Interpolating unsanitized values into a query can introduce SQL injection risks. Always validate or sanitize the interpolated value beforehand. ## Fields ### `args_mapping` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) which should evaluate to an array of values matching in size to the number of columns specified. **Type**: `string` ```yaml # Examples: args_mapping: root = [ this.cat.meow, this.doc.woofs[0] ] # --- args_mapping: root = [ meta("user.id") ] ``` ### `columns[]` A list of columns to insert. **Type**: `array` ```yaml # Examples: columns: - foo - bar - baz ``` ### `conn_max_idle` An optional maximum number of connections in the idle connection pool. If conn_max_open is greater than 0 but less than the new conn_max_idle, then the new conn_max_idle will be reduced to match the conn_max_open limit. If `value ⇐ 0`, no idle connections are retained. The default max idle connections is currently 2. This may change in a future release. **Type**: `int` **Default**: `2` ### `conn_max_idle_time` An optional maximum amount of time a connection may be idle. Expired connections may be closed lazily before reuse. If `value ⇐ 0`, connections are not closed due to a connections idle time. **Type**: `string` ### `conn_max_life_time` An optional maximum amount of time a connection may be reused. Expired connections may be closed lazily before reuse. If `value ⇐ 0`, connections are not closed due to a connections age. **Type**: `string` ### `conn_max_open` An optional maximum number of open connections to the database. If conn_max_idle is greater than 0 and the new conn_max_open is less than conn_max_idle, then conn_max_idle will be reduced to match the new conn_max_open limit. If `value ⇐ 0`, then there is no limit on the number of open connections. The default is 0 (unlimited). **Type**: `int` ### `driver` The database driver to use. **Type**: `string` **Options**: `mysql`, `postgres`, `pgx`, `clickhouse`, `mssql`, `sqlite`, `oracle`, `snowflake`, `trino`, `gocosmos`, `spanner`, `databricks`, `hana` ### `dsn` A Data Source Name to identify the target database. #### Drivers The following table lists the supported drivers and their DSN formats: | Driver | Data Source Name Format | | --- | --- | | `clickhouse` | [`clickhouse://[username[:password]@][netloc][:port]/dbname[?param1=value1&…​¶mN=valueN]`](https://github.com/ClickHouse/clickhouse-go#dsn) | | `mysql` | `[username[:password]@][protocol[(address)]]/dbname[?param1=value1&…​¶mN=valueN]` | | `postgres` and `pgx` | `postgres://[user[:password]@][netloc][:port][/dbname][?param1=value1&…​]` | | `mssql` | `sqlserver://[user[:password]@][netloc][:port][?database=dbname¶m1=value1&…​]` | | `sqlite` | `file:/path/to/filename.db[?param&=value1&…​]` | | `oracle` | `oracle://[username[:password]@][netloc][:port]/service_name?server=server2&server=server3` | | `snowflake` | `username[:password]@account_identifier/dbname/schemaname[?param1=value&…​¶mN=valueN]` | | `trino` | [`http[s]://user[:pass]@host[:port][?parameters]`](https://github.com/trinodb/trino-go-client#dsn-data-source-name) | | `gocosmos` | [`AccountEndpoint=;AccountKey=[;TimeoutMs=][;Version=][;DefaultDb/Db=][;AutoId=][;InsecureSkipVerify=]`](https://pkg.go.dev/github.com/microsoft/gocosmos#readme-example-usage) | | `spanner` | projects/\[PROJECT\]/instances/\[INSTANCE\]/databases/\[DATABASE\] | | `databricks` | `token:@:/` | | `hana` | `hdb://[user[:password]@]host[:port][?param1=value1&…​]` | Please note that the `postgres` and `pgx` drivers enforce SSL by default, you can override this with the parameter `sslmode=disable` if required. The `pgx` driver is an alternative to the standard `postgres` (pq) driver and comes with extra functionality such as support for array insertion. The `snowflake` driver supports multiple DSN formats. Please consult [the docs](https://pkg.go.dev/github.com/snowflakedb/gosnowflake/v2#hdr-Connection_String) for more details. For [key pair authentication](https://docs.snowflake.com/en/user-guide/key-pair-auth.html#configuring-key-pair-authentication), the DSN has the following format: `@//?warehouse=&role=&authenticator=snowflake_jwt&privateKey=`, where the value for the `privateKey` parameter can be constructed from an unencrypted RSA private key file `rsa_key.p8` using `openssl enc -d -base64 -in rsa_key.p8 | basenc --base64url -w0` (you can use `gbasenc` instead of `basenc` on OSX if you install `coreutils` via Homebrew). If you have a password-encrypted private key, you can decrypt it using `openssl pkcs8 -in rsa_key_encrypted.p8 -out rsa_key.p8`. Also, make sure fields such as the username are URL-encoded. The [`gocosmos`](https://pkg.go.dev/github.com/microsoft/gocosmos) driver is still experimental, but it has support for [hierarchical partition keys](https://learn.microsoft.com/en-us/azure/cosmos-db/hierarchical-partition-keys) as well as [cross-partition queries](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-query-container#cross-partition-query). Please refer to the [SQL notes](https://github.com/microsoft/gocosmos/blob/main/SQL.md) for details. **Type**: `string` ```yaml # Examples: dsn: clickhouse://username:password@host1:9000,host2:9000/database?dial_timeout=200ms&max_execution_time=60 # --- dsn: foouser:foopassword@tcp(localhost:3306)/foodb # --- dsn: postgres://foouser:foopass@localhost:5432/foodb?sslmode=disable # --- dsn: oracle://foouser:foopass@localhost:1521/service_name # --- dsn: token:dapi1234567890ab@dbc-a1b2345c-d6e7.cloud.databricks.com:443/sql/1.0/warehouses/abc123def456 ``` ### `init_files[]` An optional list of file paths containing SQL statements to execute immediately upon the first connection to the target database. This is a useful way to initialise tables before processing data. Glob patterns are supported, including super globs (double star). Care should be taken to ensure that the statements are idempotent, and therefore would not cause issues when run multiple times after service restarts. If both `init_statement` and `init_files` are specified the `init_statement` is executed _after_ the `init_files`. If a statement fails for any reason a warning log will be emitted but the operation of this component will not be stopped. **Type**: `array` ```yaml # Examples: init_files: - ./init/*.sql # --- init_files: - ./foo.sql - ./bar.sql ``` ### `init_statement` An optional SQL statement to execute immediately upon the first connection to the target database. This is a useful way to initialise tables before processing data. Care should be taken to ensure that the statement is idempotent, and therefore would not cause issues when run multiple times after service restarts. If both `init_statement` and `init_files` are specified the `init_statement` is executed _after_ the `init_files`. If the statement fails for any reason a warning log will be emitted but the operation of this component will not be stopped. **Type**: `string` ```yaml # Examples: init_statement: | CREATE TABLE IF NOT EXISTS some_table ( foo varchar(50) not null, bar integer, baz varchar(50), primary key (foo) ) WITHOUT ROWID; ``` ### `options[]` A list of keyword options to add before the INTO clause of the query. **Type**: `array` ```yaml # Examples: options: - DELAYED - IGNORE ``` ### `prefix` An optional prefix to prepend to the insert query (before INSERT). **Type**: `string` ### `suffix` An optional suffix to append to the insert query. **Type**: `string` ```yaml # Examples: suffix: ON CONFLICT (name) DO NOTHING ``` ### `table` The table to insert to. **Type**: `string` ```yaml # Examples: table: foo ``` --- # Page 244: sql_raw **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/sql_raw.md --- # sql_raw Runs an arbitrary SQL query against a database and (optionally) returns the result as an array of objects, one for each row returned. If the query fails to execute, the message remains unchanged and the error can be caught using [error handling methods](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). #### Common ```yml processor: label: "" sql_raw: driver: mysql # No default (required) dsn: "" # No default (required) query: "" # No default (optional) args_mapping: "" # No default (optional) exec_only: false # No default (optional) queries: [] # No default (optional) ``` #### Advanced ```yml processor: label: "" sql_raw: driver: mysql # No default (required) dsn: "" # No default (required) query: "" # No default (optional) unsafe_dynamic_query: false args_mapping: "" # No default (optional) exec_only: false # No default (optional) queries: [] # No default (optional) init_files: [] # No default (optional) init_statement: "" # No default (optional) conn_max_idle_time: "" # No default (optional) conn_max_life_time: "" # No default (optional) conn_max_idle: 2 conn_max_open: 0 # No default (optional) ``` If the query fails to execute then the message will remain unchanged and the error can be caught using [error handling methods](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). For some scenarios where you might use this processor, see [Examples](#examples). ## Fields ### `args_mapping` An optional [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that includes the same number of values in an array as the placeholder arguments in the `query` field. **Type**: `string` ```yaml # Examples: args_mapping: root = [ this.cat.meow, this.doc.woofs[0] ] # --- args_mapping: root = [ meta("user.id") ] ``` ### `conn_max_idle` An optional maximum number of connections in the idle connection pool. If conn_max_open is greater than 0 but less than the new conn_max_idle, then the new conn_max_idle will be reduced to match the conn_max_open limit. If `value ⇐ 0`, no idle connections are retained. The default max idle connections is currently 2. This may change in a future release. **Type**: `int` **Default**: `2` ### `conn_max_idle_time` An optional maximum amount of time a connection may be idle. Expired connections may be closed lazily before reuse. If `value ⇐ 0`, connections are not closed due to a connections idle time. **Type**: `string` ### `conn_max_life_time` An optional maximum amount of time a connection may be reused. Expired connections may be closed lazily before reuse. If `value ⇐ 0`, connections are not closed due to a connections age. **Type**: `string` ### `conn_max_open` An optional maximum number of open connections to the database. If conn_max_idle is greater than 0 and the new conn_max_open is less than conn_max_idle, then conn_max_idle will be reduced to match the new conn_max_open limit. If `value ⇐ 0`, then there is no limit on the number of open connections. The default is 0 (unlimited). **Type**: `int` ### `driver` The database driver to use. **Type**: `string` **Options**: `mysql`, `postgres`, `pgx`, `clickhouse`, `mssql`, `sqlite`, `oracle`, `snowflake`, `trino`, `gocosmos`, `spanner`, `databricks`, `hana` ### `dsn` A Data Source Name to identify the target database. #### Drivers The following table lists the supported drivers and their DSN formats: | Driver | Data Source Name Format | | --- | --- | | `clickhouse` | [`clickhouse://[username[:password]@][netloc][:port]/dbname[?param1=value1&…​¶mN=valueN]`](https://github.com/ClickHouse/clickhouse-go#dsn) | | `mysql` | `[username[:password]@][protocol[(address)]]/dbname[?param1=value1&…​¶mN=valueN]` | | `postgres` and `pgx` | `postgres://[user[:password]@][netloc][:port][/dbname][?param1=value1&…​]` | | `mssql` | `sqlserver://[user[:password]@][netloc][:port][?database=dbname¶m1=value1&…​]` | | `sqlite` | `file:/path/to/filename.db[?param&=value1&…​]` | | `oracle` | `oracle://[username[:password]@][netloc][:port]/service_name?server=server2&server=server3` | | `snowflake` | `username[:password]@account_identifier/dbname/schemaname[?param1=value&…​¶mN=valueN]` | | `trino` | [`http[s]://user[:pass]@host[:port][?parameters]`](https://github.com/trinodb/trino-go-client#dsn-data-source-name) | | `gocosmos` | [`AccountEndpoint=;AccountKey=[;TimeoutMs=][;Version=][;DefaultDb/Db=][;AutoId=][;InsecureSkipVerify=]`](https://pkg.go.dev/github.com/microsoft/gocosmos#readme-example-usage) | | `spanner` | projects/\[PROJECT\]/instances/\[INSTANCE\]/databases/\[DATABASE\] | | `databricks` | `token:@:/` | | `hana` | `hdb://[user[:password]@]host[:port][?param1=value1&…​]` | Please note that the `postgres` and `pgx` drivers enforce SSL by default, you can override this with the parameter `sslmode=disable` if required. The `pgx` driver is an alternative to the standard `postgres` (pq) driver and comes with extra functionality such as support for array insertion. The `snowflake` driver supports multiple DSN formats. Please consult [the docs](https://pkg.go.dev/github.com/snowflakedb/gosnowflake/v2#hdr-Connection_String) for more details. For [key pair authentication](https://docs.snowflake.com/en/user-guide/key-pair-auth.html#configuring-key-pair-authentication), the DSN has the following format: `@//?warehouse=&role=&authenticator=snowflake_jwt&privateKey=`, where the value for the `privateKey` parameter can be constructed from an unencrypted RSA private key file `rsa_key.p8` using `openssl enc -d -base64 -in rsa_key.p8 | basenc --base64url -w0` (you can use `gbasenc` instead of `basenc` on OSX if you install `coreutils` via Homebrew). If you have a password-encrypted private key, you can decrypt it using `openssl pkcs8 -in rsa_key_encrypted.p8 -out rsa_key.p8`. Also, make sure fields such as the username are URL-encoded. The [`gocosmos`](https://pkg.go.dev/github.com/microsoft/gocosmos) driver is still experimental, but it has support for [hierarchical partition keys](https://learn.microsoft.com/en-us/azure/cosmos-db/hierarchical-partition-keys) as well as [cross-partition queries](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-query-container#cross-partition-query). Please refer to the [SQL notes](https://github.com/microsoft/gocosmos/blob/main/SQL.md) for details. **Type**: `string` ```yaml # Examples: dsn: clickhouse://username:password@host1:9000,host2:9000/database?dial_timeout=200ms&max_execution_time=60 # --- dsn: foouser:foopassword@tcp(localhost:3306)/foodb # --- dsn: postgres://foouser:foopass@localhost:5432/foodb?sslmode=disable # --- dsn: oracle://foouser:foopass@localhost:1521/service_name # --- dsn: token:dapi1234567890ab@dbc-a1b2345c-d6e7.cloud.databricks.com:443/sql/1.0/warehouses/abc123def456 ``` ### `exec_only` Whether to discard the `query` result. Set to `true` to leave the message contents unchanged, which is useful when you are executing inserts, updates, and so on. By default, this is `false` for the last query and `true` for all previous queries, so only the last query’s result replaces the message contents. If you set this to `false` for a query other than the last, its result replaces the message contents and the `args_mapping` of each subsequent query runs against that result. **Type**: `bool` ### `init_files[]` An optional list of file paths containing SQL statements to execute immediately upon the first connection to the target database. This is a useful way to initialise tables before processing data. Glob patterns are supported, including super globs (double star). Care should be taken to ensure that the statements are idempotent, and therefore would not cause issues when run multiple times after service restarts. If both `init_statement` and `init_files` are specified the `init_statement` is executed _after_ the `init_files`. If a statement fails for any reason a warning log will be emitted but the operation of this component will not be stopped. **Type**: `array` ```yaml # Examples: init_files: - ./init/*.sql # --- init_files: - ./foo.sql - ./bar.sql ``` ### `init_statement` An optional SQL statement to execute immediately upon the first connection to the target database. This is a useful way to initialise tables before processing data. Care should be taken to ensure that the statement is idempotent, and therefore would not cause issues when run multiple times after service restarts. If both `init_statement` and `init_files` are specified the `init_statement` is executed _after_ the `init_files`. If the statement fails for any reason a warning log will be emitted but the operation of this component will not be stopped. **Type**: `string` ```yaml # Examples: init_statement: | CREATE TABLE IF NOT EXISTS some_table ( foo varchar(50) not null, bar integer, baz varchar(50), primary key (foo) ) WITHOUT ROWID; ``` ### `queries[]` A list of database statements to run in addition to your main `query`. If you specify multiple statements, they are executed within a single transaction. The output of the processor is always the result of the last query that runs, unless `exec_only` is used. **Type**: `array` ### `queries[].args_mapping` An optional [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that includes the same number of values in an array as the placeholder arguments in the `query` field. **Type**: `string` ```yaml # Examples: args_mapping: root = [ this.cat.meow, this.doc.woofs[0] ] # --- args_mapping: root = [ meta("user.id") ] ``` ### `queries[].exec_only` Whether to discard the `query` result. Set to `true` to leave the message contents unchanged, which is useful when you are executing inserts, updates, and so on. By default, this is `false` for the last query and `true` for all previous queries, so only the last query’s result replaces the message contents. If you set this to `false` for a query other than the last, its result replaces the message contents and the `args_mapping` of each subsequent query runs against that result. **Type**: `bool` ### `queries[].query` The query to execute. You must include the correct placeholders for the specified database driver. Some drivers use question marks (`?`), whereas others expect incrementing dollar signs (`$1`, `$2`, and so on) or colons (`:1`, `:2`, and so on). The following table shows the placeholder style for each driver: | Driver | Placeholder style | | --- | --- | | `clickhouse` | Dollar sign (`$`) | | `gocosmos` | Colon (`:`) | | `hana` | Question mark (`?`) | | `mssql` | Question mark (`?`) | | `mysql` | Question mark (`?`) | | `oracle` | Colon (`:`) | | `pgx` | Dollar sign (`$`) | | `postgres` | Dollar sign (`$`) | | `snowflake` | Question mark (`?`) | | `spanner` | Question mark (`?`) | | `sqlite` | Question mark (`?`) | | `trino` | Question mark (`?`) | **Type**: `string` ### `query` The query to execute. You must include the correct placeholders for the specified database driver. Some drivers use question marks (`?`), whereas others expect incrementing dollar signs (`$1`, `$2`, and so on) or colons (`:1`, `:2`, and so on). The following table shows the placeholder style for each driver: | Driver | Placeholder style | | --- | --- | | `clickhouse` | Dollar sign (`$`) | | `gocosmos` | Colon (`:`) | | `hana` | Question mark (`?`) | | `mssql` | Question mark (`?`) | | `mysql` | Question mark (`?`) | | `oracle` | Colon (`:`) | | `pgx` | Dollar sign (`$`) | | `postgres` | Dollar sign (`$`) | | `snowflake` | Question mark (`?`) | | `spanner` | Question mark (`?`) | | `sqlite` | Question mark (`?`) | | `trino` | Question mark (`?`) | **Type**: `string` ```yaml # Examples: query: INSERT INTO footable (foo, bar, baz) VALUES (?, ?, ?); # --- query: SELECT * FROM footable WHERE user_id = $1; ``` ### `unsafe_dynamic_query` Whether to enable [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries) in the query. Make sure your queries are defended against injection attacks. **Type**: `bool` **Default**: `false` ## Examples ### Table Insert (MySQL) The following example inserts rows into the table footable with the columns foo, bar and baz populated with values extracted from messages. ```yaml pipeline: processors: - sql_raw: driver: mysql dsn: foouser:foopassword@tcp(localhost:3306)/foodb query: "INSERT INTO footable (foo, bar, baz) VALUES (?, ?, ?);" args_mapping: '[ document.foo, document.bar, meta("kafka_topic") ]' exec_only: true ``` ### Table Query (PostgreSQL) Here we query a database for columns of footable that share a `user_id` with the message field `user.id`. A [`branch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/) is used in order to insert the resulting array into the original message at the path `foo_rows`. ```yaml pipeline: processors: - branch: processors: - sql_raw: driver: postgres dsn: postgres://foouser:foopass@localhost:5432/testdb?sslmode=disable query: "SELECT * FROM footable WHERE user_id = $1;" args_mapping: '[ this.user.id ]' result_map: 'root.foo_rows = this' ``` ### Dynamically Creating Tables (PostgreSQL) Here we query a database for columns of footable that share a `user_id` with the message field `user.id`. A [`branch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/) is used in order to insert the resulting array into the original message at the path `foo_rows`. ```yaml pipeline: processors: - mapping: | root = this # Prevent SQL injection when using unsafe_dynamic_query meta table_name = "\"" + metadata("table_name").replace_all("\"", "\"\"") + "\"" - sql_raw: driver: postgres dsn: postgres://localhost/postgres unsafe_dynamic_query: true queries: - query: | CREATE TABLE IF NOT EXISTS ${!metadata("table_name")} (id varchar primary key, document jsonb); - query: | INSERT INTO ${!metadata("table_name")} (id, document) VALUES ($1, $2) ON CONFLICT (id) DO UPDATE SET document = EXCLUDED.document; args_mapping: | root = [ this.id, this.document.string() ] ``` --- # Page 245: sql_select **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/sql_select.md --- # sql_select Runs an SQL select query against a database and returns the result as an array of objects, one for each row returned, containing a key for each column queried and its value. If the query fails to execute, the message remains unchanged and the error can be caught using [error handling methods](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). #### Common ```yml processor: label: "" sql_select: driver: mysql # No default (required) dsn: "" # No default (required) table: "" # No default (required) columns: [] # No default (required) where: "" # No default (optional) args_mapping: "" # No default (optional) ``` #### Advanced ```yml processor: label: "" sql_select: driver: mysql # No default (required) dsn: "" # No default (required) table: "" # No default (required) columns: [] # No default (required) where: "" # No default (optional) args_mapping: "" # No default (optional) prefix: "" # No default (optional) suffix: "" # No default (optional) init_files: [] # No default (optional) init_statement: "" # No default (optional) conn_max_idle_time: "" # No default (optional) conn_max_life_time: "" # No default (optional) conn_max_idle: 2 conn_max_open: 0 # No default (optional) ``` If the query fails to execute then the message will remain unchanged and the error can be caught using [error handling methods](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). ## Examples ### Table Query (PostgreSQL) Here we query a database for columns of footable that share a `user_id` with the message `user.id`. A [`branch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/) is used in order to insert the resulting array into the original message at the path `foo_rows`: ```yaml pipeline: processors: - branch: processors: - sql_select: driver: postgres dsn: postgres://foouser:foopass@localhost:5432/testdb?sslmode=disable table: footable columns: [ '*' ] where: user_id = ? args_mapping: '[ this.user.id ]' result_map: 'root.foo_rows = this' ``` ## Fields ### `args_mapping` An optional [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that evaluates to an array of values, one for each placeholder in the `where` field, in order. The values are passed to the driver as query arguments. **Type**: `string` ```yaml # Examples: args_mapping: root = [ this.cat.meow, this.doc.woofs[0] ] # --- args_mapping: root = [ meta("user.id") ] ``` ### `columns[]` A list of columns to query. **Type**: `array` ```yaml # Examples: columns: - "*" # --- columns: - foo - bar - baz ``` ### `conn_max_idle` An optional maximum number of connections in the idle connection pool. If conn_max_open is greater than 0 but less than the new conn_max_idle, then the new conn_max_idle will be reduced to match the conn_max_open limit. If `value ⇐ 0`, no idle connections are retained. The default max idle connections is currently 2. This may change in a future release. **Type**: `int` **Default**: `2` ### `conn_max_idle_time` An optional maximum amount of time a connection may be idle. Expired connections may be closed lazily before reuse. If `value ⇐ 0`, connections are not closed due to a connections idle time. **Type**: `string` ### `conn_max_life_time` An optional maximum amount of time a connection may be reused. Expired connections may be closed lazily before reuse. If `value ⇐ 0`, connections are not closed due to a connections age. **Type**: `string` ### `conn_max_open` An optional maximum number of open connections to the database. If conn_max_idle is greater than 0 and the new conn_max_open is less than conn_max_idle, then conn_max_idle will be reduced to match the new conn_max_open limit. If `value ⇐ 0`, then there is no limit on the number of open connections. The default is 0 (unlimited). **Type**: `int` ### `driver` The database driver to use. **Type**: `string` **Options**: `mysql`, `postgres`, `pgx`, `clickhouse`, `mssql`, `sqlite`, `oracle`, `snowflake`, `trino`, `gocosmos`, `spanner`, `databricks`, `hana` ### `dsn` A Data Source Name to identify the target database. #### Drivers The following table lists the supported drivers and their DSN formats: | Driver | Data Source Name Format | | --- | --- | | `clickhouse` | [`clickhouse://[username[:password]@][netloc][:port]/dbname[?param1=value1&…​¶mN=valueN]`](https://github.com/ClickHouse/clickhouse-go#dsn) | | `mysql` | `[username[:password]@][protocol[(address)]]/dbname[?param1=value1&…​¶mN=valueN]` | | `postgres` and `pgx` | `postgres://[user[:password]@][netloc][:port][/dbname][?param1=value1&…​]` | | `mssql` | `sqlserver://[user[:password]@][netloc][:port][?database=dbname¶m1=value1&…​]` | | `sqlite` | `file:/path/to/filename.db[?param&=value1&…​]` | | `oracle` | `oracle://[username[:password]@][netloc][:port]/service_name?server=server2&server=server3` | | `snowflake` | `username[:password]@account_identifier/dbname/schemaname[?param1=value&…​¶mN=valueN]` | | `trino` | [`http[s]://user[:pass]@host[:port][?parameters]`](https://github.com/trinodb/trino-go-client#dsn-data-source-name) | | `gocosmos` | [`AccountEndpoint=;AccountKey=[;TimeoutMs=][;Version=][;DefaultDb/Db=][;AutoId=][;InsecureSkipVerify=]`](https://pkg.go.dev/github.com/microsoft/gocosmos#readme-example-usage) | | `spanner` | projects/\[PROJECT\]/instances/\[INSTANCE\]/databases/\[DATABASE\] | | `databricks` | `token:@:/` | | `hana` | `hdb://[user[:password]@]host[:port][?param1=value1&…​]` | Please note that the `postgres` and `pgx` drivers enforce SSL by default, you can override this with the parameter `sslmode=disable` if required. The `pgx` driver is an alternative to the standard `postgres` (pq) driver and comes with extra functionality such as support for array insertion. The `snowflake` driver supports multiple DSN formats. Please consult [the docs](https://pkg.go.dev/github.com/snowflakedb/gosnowflake/v2#hdr-Connection_String) for more details. For [key pair authentication](https://docs.snowflake.com/en/user-guide/key-pair-auth.html#configuring-key-pair-authentication), the DSN has the following format: `@//?warehouse=&role=&authenticator=snowflake_jwt&privateKey=`, where the value for the `privateKey` parameter can be constructed from an unencrypted RSA private key file `rsa_key.p8` using `openssl enc -d -base64 -in rsa_key.p8 | basenc --base64url -w0` (you can use `gbasenc` instead of `basenc` on OSX if you install `coreutils` via Homebrew). If you have a password-encrypted private key, you can decrypt it using `openssl pkcs8 -in rsa_key_encrypted.p8 -out rsa_key.p8`. Also, make sure fields such as the username are URL-encoded. The [`gocosmos`](https://pkg.go.dev/github.com/microsoft/gocosmos) driver is still experimental, but it has support for [hierarchical partition keys](https://learn.microsoft.com/en-us/azure/cosmos-db/hierarchical-partition-keys) as well as [cross-partition queries](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-query-container#cross-partition-query). Please refer to the [SQL notes](https://github.com/microsoft/gocosmos/blob/main/SQL.md) for details. **Type**: `string` ```yaml # Examples: dsn: clickhouse://username:password@host1:9000,host2:9000/database?dial_timeout=200ms&max_execution_time=60 # --- dsn: foouser:foopassword@tcp(localhost:3306)/foodb # --- dsn: postgres://foouser:foopass@localhost:5432/foodb?sslmode=disable # --- dsn: oracle://foouser:foopass@localhost:1521/service_name # --- dsn: token:dapi1234567890ab@dbc-a1b2345c-d6e7.cloud.databricks.com:443/sql/1.0/warehouses/abc123def456 ``` ### `init_files[]` An optional list of file paths containing SQL statements to execute immediately upon the first connection to the target database. This is a useful way to initialise tables before processing data. Glob patterns are supported, including super globs (double star). Care should be taken to ensure that the statements are idempotent, and therefore would not cause issues when run multiple times after service restarts. If both `init_statement` and `init_files` are specified the `init_statement` is executed _after_ the `init_files`. If a statement fails for any reason a warning log will be emitted but the operation of this component will not be stopped. **Type**: `array` ```yaml # Examples: init_files: - ./init/*.sql # --- init_files: - ./foo.sql - ./bar.sql ``` ### `init_statement` An optional SQL statement to execute immediately upon the first connection to the target database. This is a useful way to initialise tables before processing data. Care should be taken to ensure that the statement is idempotent, and therefore would not cause issues when run multiple times after service restarts. If both `init_statement` and `init_files` are specified the `init_statement` is executed _after_ the `init_files`. If the statement fails for any reason a warning log will be emitted but the operation of this component will not be stopped. **Type**: `string` ```yaml # Examples: init_statement: | CREATE TABLE IF NOT EXISTS some_table ( foo varchar(50) not null, bar integer, baz varchar(50), primary key (foo) ) WITHOUT ROWID; ``` ### `prefix` Optional SQL text to add before the `SELECT` keyword, such as a `WITH` clause. **Type**: `string` ### `suffix` Optional SQL text to append after the generated `SELECT` statement, such as an `ORDER BY`, `LIMIT`, or locking clause. **Type**: `string` ### `table` The table to query. **Type**: `string` ```yaml # Examples: table: foo ``` ### `where` An optional where clause to add. Placeholder arguments are populated with the `args_mapping` field. Always use question marks for placeholders. They are converted to dollar syntax (`$1`) when the `postgres`, `pgx`, or `clickhouse` driver is used, and to colon syntax (`:1`) when the `oracle` or `gocosmos` driver is used. **Type**: `string` ```yaml # Examples: where: meow = ? and woof = ? # --- where: user_id = ? ``` --- # Page 246: string_split **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/string_split.md --- # string_split Splits a string by a delimiter into an array. Generally, using bloblang’s `split` method is preferred. In some high performance use cases this processor can be faster than the equivalent bloblang if there is no additional logic. #### Common ```yml processor: label: "" string_split: delimiter: |+ empty_as_null: false ``` #### Advanced ```yml processor: label: "" string_split: delimiter: |+ emit_bytes: false empty_as_null: false ``` ## Fields ### `delimiter` The delimiter to split the string by. **Type**: `string` **Default**: `"\n"` ### `emit_bytes` When true, the output will be bloblang bytes instead of strings. **Type**: `bool` **Default**: `false` ### `empty_as_null` When true, empty strings resulting from the split are converted to null. **Type**: `bool` **Default**: `false` --- # Page 247: switch **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/switch.md --- # switch Conditionally processes messages based on their contents. For each switch case a [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) is checked and, if the result is true (or the check is empty) the child processors are executed on the message. ### Common ```yml processor: label: "" switch: - check: "" processors: [] ``` ### Advanced ```yml processor: label: "" switch: - check: "" processors: [] fallthrough: false continue: false ``` ## Fields ### `check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that should return a boolean value indicating whether a message should have the processors of this case executed on it. If left empty the case always passes. If the check mapping throws an error the message will be flagged [as having failed](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/) and will not be tested against any other cases. **Type**: `string` **Default**: `""` ```yaml # Examples: check: this.type == "foo" # --- check: this.contents.urls.contains("https://benthos.dev/") ``` ### `continue` Indicates whether, if this case passes for a message, the next case should also be tested. Unlike `fallthrough`, which skips the next case’s check, `continue` will evaluate the next case’s condition before executing. **Type**: `bool` **Default**: `false` ### `fallthrough` Indicates whether, if this case passes for a message, the next case should also be executed without checking its condition. **Type**: `bool` **Default**: `false` ### `processors[]` A list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to execute on a message. **Type**: `array` **Default**: `[]` ## Examples ### Ignore George We have a system where we’re counting a metric for all messages that pass through our system. However, occasionally we get messages from George that we don’t care about. For George’s messages we want to instead emit a metric that gauges how angry he is about being ignored and then we drop it. ```yaml pipeline: processors: - switch: - check: this.user.name.first != "George" processors: - metric: type: counter name: MessagesWeCareAbout - processors: - metric: type: gauge name: GeorgesAnger value: ${! json("user.anger") } - mapping: root = deleted() ``` ## Batching When a switch processor executes on a [batch of messages](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/) they are checked individually and can be matched independently against cases. During processing the messages matched against a case are processed as a batch, although the ordering of messages during case processing cannot be guaranteed to match the order as received. At the end of switch processing the resulting batch will follow the same ordering as the batch was received. If any child processors have split or otherwise grouped messages this grouping will be lost as the result of a switch is always a single batch. In order to perform conditional grouping and/or splitting use the [`group_by` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/group_by/). --- # Page 248: sync_response **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/sync_response.md --- # sync_response Adds the payload in its current state as a synchronous response to the input source, where it is dealt with according to that specific input type. For most inputs this mechanism is ignored entirely, in which case the sync response is dropped without penalty. It is therefore safe to use this processor even when combining input types that might not have support for sync responses. An example of an input able to utilize this is the `http_server`. For more information please read [synchronous responses](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/sync_responses/). ## Common ```yml processor: label: "" sync_response: {} ``` ## Advanced ```yml processor: label: "" sync_response: {} ``` --- # Page 249: text_chunker **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/text_chunker.md --- # text_chunker Breaks text-based message content into chunks using a configurable strategy, typically to create vector embeddings of large documents. A processor allowing splitting text into chunks based on several different strategies. #### Common ```yml processor: label: "" text_chunker: strategy: markdown # No default (required) chunk_size: 512 chunk_overlap: 100 separators: - "\n\n" - "\n" - " " - "" length_measure: runes include_code_blocks: false keep_reference_links: false ``` #### Advanced ```yml processor: label: "" text_chunker: strategy: markdown # No default (required) chunk_size: 512 chunk_overlap: 100 separators: - "\n\n" - "\n" - " " - "" length_measure: runes token_encoding: "" # No default (optional) allowed_special: [] disallowed_special: - "all" include_code_blocks: false keep_reference_links: false ``` ## Fields ### `allowed_special[]` A list of special tokens to include in the output from this processor. **Type**: `array` **Default**: `[]` ### `chunk_overlap` The number of characters duplicated in adjacent chunks of text. **Type**: `int` **Default**: `100` ### `chunk_size` The maximum size of each chunk, using the selected `length_measure`. **Type**: `int` **Default**: `512` ### `disallowed_special[]` A list of special tokens to exclude from the output of this processor. **Type**: `array` **Default**: ```yaml - "all" ``` ### `include_code_blocks` When set to `true`, this processor includes code blocks in the output. **Type**: `bool` **Default**: `false` ### `keep_reference_links` When set to `true`, this processor includes reference links in the output. **Type**: `bool` **Default**: `false` ### `length_measure` Choose a method to measure the length of a string. **Type**: `string` **Default**: `runes` | Option | Summary | | --- | --- | | `graphemes` | Use unicode graphemes to determine the length of a string. | | `runes` | Use the number of codepoints to determine the length of a string. | | `token` | Use the number of tokens (using the `token_encoding` tokenizer) to determine the length of a string. | | `utf8` | Determine the length of text using the number of utf8 bytes. | ### `separators[]` A list of strings to use as separators between chunks when the `strategy` field is set to `recursive_character`. By default, the following separators are tried in turn: double newlines (`\n\n`), single newlines (`\n`), spaces (`" “), and the empty string (”"`). **Type**: `array` **Default**: ```yaml - "\n\n" - "\n" - " " - "" ``` ### `strategy` Choose a strategy for breaking content down into chunks. **Type**: `string` | Option | Summary | | --- | --- | | `markdown` | Split text by markdown headers. | | `recursive_character` | Split text recursively by characters (defined in `separators`). | | `token` | Split text by tokens. | ### `token_encoding` The type of encoding to use for tokenization. **Type**: `string` ```yaml # Examples: token_encoding: cl100k_base # --- token_encoding: r50k_base ``` --- # Page 250: try_catch **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/try_catch.md --- # try_catch > ⚠️ **CAUTION** > > This component is in beta. Its behavior might change in a future release. Executes a list of child `processors` on each message and, if any of them fail, executes a separate list of `catch` processors to recover from or react to the error. This processor combines the behaviour of the [`try`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/try/) and [`catch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/catch/) processors into a single block with an explicit recovery path. Because it contains both the fallible step and its recovery within a single processor, it is the recommended way to handle expected errors when strict error handling (`error_handling.strict`) is enabled. Each message of a batch is processed individually. The `processors` field is executed with "try" semantics: as soon as a processor fails for a given message the remaining `processors` are skipped for that message. Any message that failed is then routed to the `catch` processors. Before they run, the failure is moved off the message: it is stored as a structured object in a metadata field (see `error_metadata`, `error` by default) and the message’s failure flag is **cleared**. The error is therefore available to recovery logic as an ordinary variable rather than as a message property. The object contains: - `what`: the error message. - `name`: the name of the component that failed (when known). - `label`: the label of the component that failed (when set). - `path`: the dot-path of the component that failed (when known). So a recovery mapping reads the failure with, for example, `@error.what` (equivalent to `meta("error").what`). Because the flag is cleared, the `catch` processors run under the normal error semantics, including strict mode, so a _new_ failure raised while recovering is treated as a fresh error and is not silently tolerated. Note that because the failure flag is cleared before the `catch` processors run, the [`error`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/#error) and `error_source_*` functions do not report the original failure within the `catch` block; use the metadata object instead. An empty or omitted `catch` simply records the error in metadata and clears the flag (the failure is swallowed). ```yaml pipeline: processors: - try_catch: processors: - resource: foo - resource: bar catch: - mutation: 'root = "failed to process: " + @error.what' ``` In the example above, if either `foo` or `bar` fails for a message then the `mutation` is applied to that message, replacing its contents with a description of the error (read from the metadata object), and the message continues downstream without a failure flag. More information about error handling can be found in [Error handling](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). #### Common ```yml processor: label: "" try_catch: processors: [] catch: [] error_metadata: error ``` #### Advanced ```yml processor: label: "" try_catch: processors: [] catch: [] error_metadata: error ``` ## Fields ### `catch[]` A list of processors to execute on each message that failed one of the `processors` above. The message is no longer flagged as failed when these run; the error is available as an object in the metadata field named by `error_metadata` (for example, `@error.what`). When omitted or empty the error is recorded in metadata and the flag is cleared (the failure is swallowed). **Type**: `array` **Default**: `[]` ### `error_metadata` The metadata key under which the caught error is stored, as an object with a `what` field (the error message) plus `name`, `label` and `path` fields describing the component that failed, before the `catch` processors are executed. **Type**: `string` **Default**: `error` ### `processors[]` A list of processors to execute on each message. If a processor fails for a given message the remaining processors in this list are skipped for that message, and the message is routed to the `catch` processors. **Type**: `array` **Default**: `[]` --- # Page 251: try **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/try.md --- # try Executes a list of child processors on messages only if no prior processors have failed (or the errors have been cleared). This processor behaves similarly to the [`for_each`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/for_each/) processor, where a list of child processors are applied to individual messages of a batch. However, if a message has failed any prior processor (before or during the try block) then that message will skip all following processors. For example, with the following config: ```yaml pipeline: processors: - resource: foo - try: - resource: bar - resource: baz - resource: buz ``` If the processor `bar` fails for a particular message, that message will skip the processors `baz` and `buz`. Similarly, if `bar` succeeds but `baz` does not then `buz` will be skipped. If the processor `foo` fails for a message then none of `bar`, `baz` or `buz` are executed on that message. This processor is useful for when child processors depend on the successful output of previous processors. This processor can be followed with a [catch](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/catch/) processor for defining child processors to be applied only to failed messages. More information about error handling can be found in [Error handling](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). ## Nest within a catch block In some cases it might be useful to nest a try block within a catch block, since the [`catch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/catch/) only clears errors _after_ executing its child processors this means a nested try processor will not execute unless the errors are explicitly cleared beforehand. This can be done by inserting an empty catch block before the try block like as follows: ```yaml pipeline: processors: - resource: foo - catch: - log: level: ERROR message: "Foo failed due to: ${! error() }" - catch: [] # Clear prior error - try: - resource: bar - resource: baz ``` ### Common ```yml processor: label: "" try: [] ``` ### Advanced ```yml processor: label: "" try: [] ``` --- # Page 252: unarchive **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/unarchive.md --- # unarchive Unarchives messages according to the selected archive format into multiple messages within a [batch](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). When a message is unarchived the new messages replace the original message in the batch. Messages that are selected but fail to unarchive (invalid format) will remain unchanged in the message batch but will be flagged as having failed, allowing you to [error handle them](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). Unarchived messages are kept in the same batch. To process each unarchived message individually, follow this processor with a [`split` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/split/). ## Metadata The metadata found on the messages handled by this processor will be copied into the resulting messages. For the unarchive formats that contain file information (tar, zip), a metadata field is also added to each message called `archive_filename` with the extracted filename. ### Common ```yml processor: label: "" unarchive: format: binary # No default (required) ``` ### Advanced ```yml processor: label: "" unarchive: format: binary # No default (required) ``` ## Fields ### `format` The unarchiving format to apply. **Type**: `string` | Option | Summary | | --- | --- | | `binary` | Extract messages from a [binary blob format](https://github.com/redpanda-data/benthos/blob/main/internal/message/message.go#L96). | | `csv` | Attempt to parse the message as a csv file (header required) and for each row in the file expands its contents into a json object in a new message. | | `csv:x` | Attempt to parse the message as a csv file (header required) and for each row in the file expands its contents into a json object in a new message using a custom delimiter. The custom delimiter must be a single character. For example, the format "csv:\\t" would consume a tab delimited file. | | `json_array` | Attempt to parse a message as a JSON array, and extract each element into its own message. | | `json_documents` | Attempt to parse a message as a stream of concatenated JSON documents. Each parsed document is expanded into a new message. | | `json_map` | Attempt to parse the message as a JSON map and for each element of the map expands its contents into a new message. A metadata field is added to each message called `archive_key` with the relevant key from the top-level map. | | `lines` | Extract the lines of a message each into their own message. | | `tar` | Extract messages from a unix standard tape archive. | | `zip` | Extract messages from a zip file. | --- # Page 253: while **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/while.md --- # while A processor that checks a [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) against each batch of messages and executes child processors on them for as long as the query resolves to true. The field `at_least_once`, if true, ensures that the child processors are always executed at least one time (like a do .. while loop.) The field `max_loops`, if greater than zero, caps the number of loops for a message batch to this value. If following a loop execution the number of messages in a batch is reduced to zero the loop is exited regardless of the condition result. If following a loop execution there are more than 1 message batches the query is checked against the first batch only. The conditions of this processor are applied across entire message batches. You can find out more about batching [in this doc](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/). #### Common ```yml processor: label: "" while: at_least_once: false check: "" processors: [] # No default (required) ``` #### Advanced ```yml processor: label: "" while: at_least_once: false max_loops: 0 check: "" processors: [] # No default (required) ``` ## Fields ### `at_least_once` Whether to always run the child processors at least one time. **Type**: `bool` **Default**: `false` ### `check` A [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that should return a boolean value indicating whether the while loop should execute again. **Type**: `string` **Default**: `""` ```yaml # Examples: check: errored() # --- check: this.urls.unprocessed.length() > 0 ``` ### `max_loops` An optional maximum number of loops to execute. Helps protect against accidentally creating infinite loops. **Type**: `int` **Default**: `0` ### `processors[]` A list of child processors to execute on each loop. **Type**: `array` --- # Page 254: workflow **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/workflow.md --- # workflow Executes a topology of [`branch` processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/), performing them in parallel where possible. ## Why use a workflow ### Performance Most of the time the best way to compose processors is also the simplest, just configure them in series. This is because processors are often CPU bound, low-latency, and you can gain vertical scaling by increasing the number of processor pipeline threads, allowing Redpanda Connect to process [multiple messages in parallel](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/processing_pipelines/). However, some processors such as [`http`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/http/), [`aws_lambda`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/aws_lambda/) or [`cache`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/cache/) interact with external services and therefore spend most of their time waiting for a response. These processors tend to be high-latency and low CPU activity, which causes messages to process slowly. When a processing pipeline contains multiple network processors that aren’t dependent on each other we can benefit from performing these processors in parallel for each individual message, reducing the overall message processing latency. ### Simplifying processor topology A workflow is often expressed as a [DAG](https://en.wikipedia.org/wiki/Directed_acyclic_graph) of processing stages, where each stage can result in N possible next stages, until finally the flow ends at an exit node. For example, if we had processing stages A, B, C and D, where stage A could result in either stage B or C being next, always followed by D, it might look something like this: ```text /--> B --\ A --| |--> D \--> C --/ ``` This flow would be easy to express in a standard Redpanda Connect config, we could simply use a [`switch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/switch/) to route to either B or C depending on a condition on the result of A. However, this method of flow control quickly becomes unfeasible as the DAG gets more complicated, imagine expressing this flow using switch processors: ```text /--> B -------------|--> D / / A --| /--> E --| \--> C --| \ \----------|--> F ``` And imagine doing so knowing that the diagram is subject to change over time. Yikes! Instead, with a workflow we can either trust it to automatically resolve the DAG or express it manually as simply as `order: [ [ A ], [ B, C ], [ E ], [ D, F ] ]`, and the conditional logic for determining if a stage is executed is defined as part of the branch itself. #### Common ```yml processor: label: "" workflow: meta_path: meta.workflow order: [] branches: : request_map: "" processors: [] # No default (required) result_map: "" ``` #### Advanced ```yml processor: label: "" workflow: meta_path: meta.workflow order: [] branch_resources: [] branches: : request_map: "" processors: [] # No default (required) result_map: "" ``` ## Examples ### Automatic Ordering When the field `order` is omitted a best attempt is made to determine a dependency tree between branches based on their request and result mappings. In the following example the branches foo and bar will be executed first in parallel, and afterwards the branch baz will be executed. ```yaml pipeline: processors: - workflow: meta_path: meta.workflow branches: foo: request_map: 'root = ""' processors: - http: url: TODO result_map: 'root.foo = this' bar: request_map: 'root = this.body' processors: - aws_lambda: function: TODO result_map: 'root.bar = this' baz: request_map: | root.fooid = this.foo.id root.barstuff = this.bar.content processors: - cache: resource: TODO operator: set key: ${! json("fooid") } value: ${! json("barstuff") } ``` ### Conditional Branches Branches of a workflow are skipped when the `request_map` assigns `deleted()` to the root. In this example the branch A is executed when the document type is "foo", and branch B otherwise. Branch C is executed afterwards and is skipped unless either A or B successfully provided a result at `tmp.result`. ```yaml pipeline: processors: - workflow: branches: A: request_map: | root = if this.document.type != "foo" { deleted() } processors: - http: url: TODO result_map: 'root.tmp.result = this' B: request_map: | root = if this.document.type == "foo" { deleted() } processors: - aws_lambda: function: TODO result_map: 'root.tmp.result = this' C: request_map: | root = if this.tmp.result != null { deleted() } processors: - http: url: TODO_SOMEWHERE_ELSE result_map: 'root.tmp.result = this' ``` ### Resources The `order` field can be used in order to refer to [branch processor resources](#resources), this can sometimes make your pipeline configuration cleaner, as well as allowing you to reuse branch configurations in order places. It’s also possible to mix and match branches configured within the workflow and configured as resources. ```yaml pipeline: processors: - workflow: order: [ [ foo, bar ], [ baz ] ] branches: bar: request_map: 'root = this.body' processors: - aws_lambda: function: TODO result_map: 'root.bar = this' processor_resources: - label: foo branch: request_map: 'root = ""' processors: - http: url: TODO result_map: 'root.foo = this' - label: baz branch: request_map: | root.fooid = this.foo.id root.barstuff = this.bar.content processors: - cache: resource: TODO operator: set key: ${! json("fooid") } value: ${! json("barstuff") } ``` ## Fields ### `branch_resources[]` An optional list of [`branch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/) names that are configured as [Resources](#resources). These resources will be included in the workflow with any branches configured inline within the [`branches`](#branches) field. The order and parallelism in which branches are executed is automatically resolved based on the mappings of each branch. When using resources with an explicit order it is not necessary to list resources in this field. **Type**: `array` **Default**: `[]` ### `branches` An object of named [`branch` processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/) that make up the workflow. The order and parallelism in which branches are executed can either be made explicit with the field `order`, or if omitted an attempt is made to automatically resolve an ordering based on the mappings of each branch. **Type**: `object` **Default**: `{}` ### `branches.processors[]` A list of processors to apply to mapped requests. When processing message batches the resulting batch must match the size and ordering of the input batch, therefore filtering, grouping should not be performed within these processors. **Type**: `array` ### `branches.request_map` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that describes how to create a request payload suitable for the child processors of this branch. If left empty then the branch will begin with an exact copy of the origin message (including metadata). **Type**: `string` **Default**: `""` ```yaml # Examples: request_map: |- root = { "id": this.doc.id, "content": this.doc.body.text } # --- request_map: |- root = if this.type == "foo" { this.foo.request } else { deleted() } ``` ### `branches.result_map` A [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) that describes how the resulting messages from branched processing should be mapped back into the original payload. If left empty the origin message will remain unchanged (including metadata). **Type**: `string` **Default**: `""` ```yaml # Examples: result_map: |- meta foo_code = metadata("code") root.foo_result = this # --- result_map: |- meta = metadata() root.bar.body = this.body root.bar.id = this.user.id # --- result_map: root.raw_result = content().string() # --- result_map: |- root.enrichments.foo = if metadata("request_failed") != null { throw(metadata("request_failed")) } else { this } # --- result_map: |- # Retain only the updated metadata fields which were present in the origin message meta = metadata().filter(v -> @.get(v.key) != null) ``` ### `meta_path` A [dot path](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/field_paths/) indicating where to store and reference [structured metadata](#structured-metadata) about the workflow execution. **Type**: `string` **Default**: `meta.workflow` ### `order[][]` An explicit declaration of branch ordered tiers, which describes the order in which parallel tiers of branches should be executed. Branches should be identified by the name as they are configured in the field `branches`. It’s also possible to specify branch processors configured [as a resource](#resources). **Type**: `array>` **Default**: `[]` ```yaml # Examples: order: - - foo - bar - - baz # --- order: - - foo - - bar - - baz ``` ## Structured metadata When the field `meta_path` is non-empty the workflow processor creates an object describing which workflows were successful, skipped or failed for each message and stores the object within the message at the end. The object is of the following form: ```json { "succeeded": [ "foo" ], "skipped": [ "bar" ], "failed": { "baz": "the error message from the branch" } } ``` If a message already has a meta object at the given path when it is processed then the object is used in order to determine which branches have already been performed on the message (or skipped) and can therefore be skipped on this run. This is a useful pattern when replaying messages that have failed some branches previously. For example, given the above example object the branches foo and bar would automatically be skipped, and baz would be reattempted. The previous meta object will also be preserved in the field `.previous` when the new meta object is written, preserving a full record of all workflow executions. If a field `.apply` exists in the meta object for a message and is an array then it will be used as an explicit list of stages to apply, all other stages will be skipped. ## Resources It’s common to configure processors (and other components) [as resources](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/resources/) in order to keep the pipeline configuration cleaner. With the workflow processor you can include branch processors configured as resources within your workflow either by specifying them by name in the field `order`, if Redpanda Connect doesn’t find a branch within the workflow configuration of that name it’ll refer to the resources. Alternatively, if you do not wish to have an explicit ordering, you can add resource names to the field `branch_resources` and they will be included in the workflow with automatic DAG resolution along with any branches configured in the `branches` field. ### Resource error conditions There are two error conditions that could potentially occur when resources included in your workflow are mutated, and if you are planning to mutate resources in your workflow it is important that you understand them. The first error case is that a resource in the workflow is removed and not replaced, when this happens the workflow will still be executed but the individual branch will fail. This should only happen if you explicitly delete a branch resource, as any mutation operation will create the new resource before removing the old one. The second error case is when automatic DAG resolution is being used and a resource in the workflow is changed in a way that breaks the DAG (circular dependencies, etc). When this happens it is impossible to execute the workflow and therefore the processor will fail, which is possible to capture and handle using [standard error handling patterns](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). ## Error handling The recommended approach to handle failures within a workflow is to query against the [structured metadata](#structured-metadata) it provides, as it provides granular information about exactly which branches failed and which ones succeeded and therefore aren’t necessary to perform again. For example, if our meta object is stored at the path `meta.workflow` and we wanted to check whether a message has failed for any branch we can do that using a [Bloblang query](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) like `this.meta.workflow.failed.length() | 0 > 0`, or to check whether a specific branch failed we can use `this.exists("meta.workflow.failed.foo")`. However, if structured metadata is disabled by setting the field `meta_path` to empty then the workflow processor instead adds a general error flag to messages when any executed branch fails. In this case it’s possible to handle failures using [standard error handling patterns](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). --- # Page 255: xml **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/xml.md --- # xml Parses messages as an XML document, performs a mutation on the data, and then overwrites the previous contents with the new value. ## Operators ### `to_json` Converts an XML document into a JSON structure, where elements appear as keys of an object according to the following rules: - If an element contains attributes they are parsed by prefixing a hyphen, `-`, to the attribute label. - If the element is a simple element and has attributes, the element value is given the key `#text`. - XML comments, directives, and process instructions are ignored. - Namespace prefixes are stripped from element and attribute names. Namespace declarations are kept as attributes: `xmlns` becomes `-xmlns`, and a prefixed declaration such as `xmlns:a` becomes `-a`. - When elements are repeated the resulting JSON value is an array. For example, given the following XML: ```xml This is a title This is a description foo1 foo2 foo3 ``` The resulting JSON structure would look like this: ```json { "root":{ "title":"This is a title", "description":{ "#text":"This is a description", "-tone":"boring" }, "elements":[ {"#text":"foo1","-id":"1"}, {"#text":"foo2","-id":"2"}, "foo3" ] } } ``` With cast set to true, the resulting JSON structure would look like this: ```json { "root":{ "title":"This is a title", "description":{ "#text":"This is a description", "-tone":"boring" }, "elements":[ {"#text":"foo1","-id":1}, {"#text":"foo2","-id":2}, "foo3" ] } } ``` #### Common ```yml processor: label: "" xml: operator: "" cast: false ``` #### Advanced ```yml processor: label: "" xml: operator: "" cast: false ``` ## Fields ### `cast` Whether to try to cast values that are numbers and booleans to the right type. Default: all values are strings. **Type**: `bool` **Default**: `false` ### `operator` An XML [operation](#operators) to apply to messages. **Type**: `string` **Default**: `""` **Options**: `to_json` --- # Page 256: Rate Limits **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/about.md --- # Rate Limits A rate limit is a strategy for limiting the usage of a shared resource across parallel components in a Redpanda Connect instance, or potentially across multiple instances. They are configured as a resource: ```yaml rate_limit_resources: - label: foobar local: count: 500 interval: 1s ``` And most components that hit external services have a field `rate_limit` for specifying a rate limit resource to use, identified by the `label` field. For example, if we wanted to use our `foobar` rate limit with a `http_client` input it would look like this: ```yaml input: http_client: url: TODO verb: GET rate_limit: foobar ``` By using a rate limit in this way we can guarantee that our input will only poll our HTTP source at the rate of 500 requests per second. Some components don’t have a `rate_limit` field but we might still wish to throttle them by a rate limit, in which case we can use the [`rate_limit` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/rate_limit/) that applies back pressure to a processing pipeline when the limit is reached. --- # Page 257: local **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/local.md --- # local A simple X every Y rate limit that can be shared across any number of components within a pipeline. It does not support distributed rate limiting across instances. #### Common ```yml rate_limit: label: "" local: count: 1000 interval: 1s ``` #### Advanced ```yml rate_limit: label: "" local: count: 1000 interval: 1s ``` ## Fields ### `count` The maximum number of requests to allow for a given period of time. **Type**: `int` **Default**: `1000` ### `interval` The time window to limit requests by. **Type**: `string` **Default**: `1s` --- # Page 258: redis **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/rate_limits/redis.md --- # redis A fixed-window rate limit backed by Redis, shared by every Redpanda Connect instance that uses the same Redis instance and key. This rate limit counts requests in Redis under `key` and allows up to `count` of them in each `interval`. The window starts with its first request and resets when `interval` has passed. Every Redpanda Connect instance that uses the same Redis instance and `key` shares the limit, so they must all set the same `count` and `interval`. #### Common ```yml rate_limit: label: "" redis: url: "" # No default (required) count: 1000 interval: 1s key: "" # No default (required) ``` #### Advanced ```yml rate_limit: label: "" redis: url: "" # No default (required) kind: simple master: "" client_name: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] count: 1000 interval: 1s key: "" # No default (required) ``` ## Fields ### `client_name` Set the client name for the Redis connection. **Type**: `string` **Default**: `redpanda-connect` ### `count` The maximum number of requests allowed in each `interval`. Requests are counted in Redis under `key`, so every Redpanda Connect instance that uses the same Redis instance and the same `key` shares this limit. The value must be greater than zero. **Type**: `int` **Default**: `1000` ### `interval` The time window to limit requests by. **Type**: `string` **Default**: `1s` ### `key` The key to use for the rate limit. **Type**: `string` ### `kind` Specifies a simple, cluster-aware, or failover-aware redis client. **Type**: `string` **Default**: `simple` **Options**: `simple`, `cluster`, `failover` ### `master` Name of the redis master when `kind` is `failover` **Type**: `string` **Default**: `""` ```yaml # Examples: master: mymaster ``` ### `tls` Custom TLS settings can be used to override system defaults. **Troubleshooting** Some cloud hosted instances of Redis (such as Azure Cache) might need some hand holding in order to establish stable connections. Unfortunately, it is often the case that TLS issues will manifest as generic error messages such as "i/o timeout". If you’re using TLS and are seeing connectivity problems consider setting `enable_renegotiation` to `true`, and ensuring that the server supports at least TLS version 1.2. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `url` The URL of the target Redis server. Database is optional and is supplied as the URL path. **Type**: `string` ```yaml # Examples: url: redis://:6379 # --- url: redis://localhost:6379 # --- url: redis://foousername:foopassword@redisplace:6379 # --- url: redis://:foopassword@redisplace:6379 # --- url: redis://localhost:6379/1 # --- url: redis://localhost:6379/1,redis://localhost:6380/1 ``` --- # Page 259: redpanda **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/redpanda/about.md --- # redpanda The Redpanda Connect configuration service allows you to: - Configure Redpanda cluster credentials in a single configuration block, which is referenced by multiple components in data pipeline. For more information, see the [Pipeline example](#pipeline-example). - Send logs and status updates to topics on a Redpanda cluster, in addition to the [default logger](https://docs.redpanda.com/connect/components/logger/about/). The `redpanda` namespace contains the configuration of this service. #### Common ```yml redpanda: seed_brokers: [] # No default (required) pipeline_id: "" logs_topic: "" logs_level: info status_topic: "" ``` #### Advanced ```yml redpanda: seed_brokers: [] # No default (required) client_id: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] sasl: [] # No default (optional) metadata_max_age: 1m request_timeout_overhead: 10s conn_idle_timeout: 20s tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s pipeline_id: "" logs_topic: "" logs_level: info status_topic: "" partitioner: "" # No default (optional) idempotent_write: true acks: all compression: snappy allow_auto_topic_creation: true timeout: 10s max_message_bytes: 1MiB broker_write_max_bytes: 100MiB max_buffered_records: 10000 max_buffered_bytes: "0" max_in_flight_requests: 1 record_retries: 0 record_delivery_timeout: 0s ``` ## Pipeline example This data pipeline reads data from `topic_A` and `topic_B` on a Redpanda cluster, and then writes the data to `topic_C` on the same cluster. The cluster details are configured within the `redpanda` configuration block, so you only need to configure them once. This is a useful feature when you have multiple inputs and outputs in the same data pipeline that need to connect to the same cluster. ```none input: redpanda: topics: [ topic_A, topic_B ] consumer_group: my_group output: redpanda: topic: topic_C key: ${! @id } redpanda: seed_brokers: [ "127.0.0.1:9092" ] tls: enabled: true sasl: - mechanism: SCRAM-SHA-512 password: bar username: foo ``` ## Status events When you set `status_topic`, Redpanda Connect emits status events to that topic as pipelines start, run, and stop. For monitoring and troubleshooting guidance, see [Monitor Pipeline Status](https://docs.redpanda.com/connect/guides/monitor-pipeline-status/). ### Status event types Status events are emitted during the pipeline lifecycle. All events include `pipeline_id`, `instance_id`, and `timestamp` fields. **TYPE_INITIALIZING** (value: 1) Emitted when a pipeline instance has successfully parsed its configuration and is attempting to start. This is the first event sent after pipeline startup. Example: ```json { "type": "TYPE_INITIALIZING", "pipeline_id": "my-pipeline", "instance_id": "abc123xyz", "timestamp": 1717890000 } ``` **TYPE_CONNECTION_HEALTHY** (value: 2) Emitted every 30 seconds (heartbeat) when all pipeline connections (inputs and outputs) are active and functioning normally. Example: ```json { "type": "TYPE_CONNECTION_HEALTHY", "pipeline_id": "my-pipeline", "instance_id": "abc123xyz", "timestamp": 1717890030 } ``` **TYPE_CONNECTION_ERROR** (value: 3) Emitted every 30 seconds (during the same heartbeat cycle) when one or more connections are inactive or experiencing errors. The event includes detailed error information for each failing connection: - `path`: The configuration path of the connector (see [field paths](https://docs.redpanda.com/connect/configuration/field_paths/)) - `label`: Optional label assigned to the connector - `message`: The error message describing the connection failure Example: ```json { "type": "TYPE_CONNECTION_ERROR", "pipeline_id": "my-pipeline", "instance_id": "abc123xyz", "timestamp": 1717890060, "connection_errors": [ { "path": "input.kafka_franz", "label": "primary-input", "message": "kafka: connection refused" } ] } ``` **TYPE_EXITING** (value: 4) Emitted when a pipeline instance is shutting down, either gracefully or due to an error. If shutdown was caused by an error, the event includes an `exit_error` object with the error message. Example (graceful shutdown): ```json { "type": "TYPE_EXITING", "pipeline_id": "my-pipeline", "instance_id": "abc123xyz", "timestamp": 1717890090 } ``` Example (error shutdown): ```json { "type": "TYPE_EXITING", "pipeline_id": "my-pipeline", "instance_id": "abc123xyz", "timestamp": 1717890090, "exit_error": { "message": "failed to process message: invalid format" } } ``` ### Message format Status events are written to the configured topic as Protocol Buffer JSON messages: - **Topic**: The value specified in `status_topic` - **Key**: The `pipeline_id` value (enables tracking all events for a specific pipeline) - **Value**: JSON-encoded status event - **Encoding**: Protocol Buffer JSON (protojson) For the full protobuf schema specification, see the [status.proto definition](https://github.com/redpanda-data/connect/blob/main/proto/redpanda/api/connect/v1alpha1/status.proto). ## Fields ### `acks` The number of acknowledgements the leader broker must receive from ISR brokers before responding to the produce request. When `idempotent_write` is enabled this must be set to `all`. **Type**: `string` **Default**: `all` | Option | Summary | | --- | --- | | `all` | Wait for all in-sync replicas to acknowledge (acks=-1). Required when idempotent_write is enabled. | | `leader` | Wait for the leader broker to acknowledge (acks=1). Messages are lost if the leader fails before replication. | | `none` | Do not wait for any acknowledgement (acks=0). Highest throughput but messages may be lost. | ### `allow_auto_topic_creation` Enables topics to be auto created if they do not exist when fetching their metadata. If set to `false`, the topic must already exist. **Type**: `bool` **Default**: `true` ### `broker_write_max_bytes` The maximum number of bytes this output can write to a broker connection in a single write. This field corresponds to Kafka’s `socket.request.max.bytes`. **Type**: `string` **Default**: `100MiB` ```yaml # Examples: broker_write_max_bytes: 128MB # --- broker_write_max_bytes: 50mib ``` ### `client_id` An identifier for the client connection. This identifier appears in broker logs and metrics, which helps you identify the Redpanda Connect instance that is connecting. **Type**: `string` **Default**: `redpanda-connect` ### `compression` The compression codec for produced record batches. A batch that compression does not make smaller is sent uncompressed, whichever codec you choose. **Type**: `string` **Default**: `snappy` **Options**: `lz4`, `snappy`, `gzip`, `none`, `zstd` ### `conn_idle_timeout` The approximate amount of time that connections can remain idle before they are closed. In the worst case, a connection can stay idle for up to twice this value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `20s` ### `idempotent_write` Enable the idempotent write producer option. When enabled, the producer initializes a producer ID and uses it to guarantee exactly-once semantics per partition, so retries do not produce duplicates. This option requires the `IDEMPOTENT_WRITE` permission on the `CLUSTER` resource. Disable this option if the `IDEMPOTENT_WRITE` permission is unavailable, for example in some managed Kafka services or Redpanda clusters with strict ACLs. Disabling this option only affects retry behavior: duplicates may occur on producer retries, but the pipeline continues to function normally. **Type**: `bool` **Default**: `true` ### `logs_level` The lowest level of the process logs sent to `logs_topic`. **Type**: `string` **Default**: `info` **Options**: `debug`, `info`, `warn`, `error` ### `logs_topic` A topic to send process logs to. **Type**: `string` **Default**: `""` ```yaml # Examples: logs_topic: __redpanda.connect.logs ``` ### `max_buffered_bytes` The maximum number of bytes the client will buffer in memory before blocking. When this limit is reached, `Produce()` calls will block until buffered records are delivered. Set to `0` to disable the byte-level limit (only `max_buffered_records` applies). This limit is checked after `max_buffered_records`. **Type**: `string` **Default**: `0` ```yaml # Examples: max_buffered_bytes: 256MB # --- max_buffered_bytes: 50mib ``` ### `max_buffered_records` The maximum number of records the client will buffer in memory before blocking. When this limit is reached, `Produce()` calls will block until buffered records are delivered and space frees up. Increase this value for high-throughput pipelines to avoid back-pressure stalls. **Type**: `int` **Default**: `10000` ### `max_in_flight_requests` The maximum number of produce requests in flight per broker connection. While `idempotent_write` is enabled (the default) this must be `1`, as the client relies on a single in-flight request per broker to guarantee ordering. To use higher values you must set `idempotent_write` to `false`, which allows requests to be pipelined for throughput but may cause duplicate and out-of-order delivery on retries. Note that this is distinct from the output’s `max_in_flight` field, which counts message batches being written in parallel rather than produce requests on the wire. A value of `1` is not a throughput ceiling: records from concurrent writes are coalesced into fewer, larger produce requests. **Type**: `int` **Default**: `1` ### `max_message_bytes` The maximum size of a produced record batch in bytes. A `MESSAGE_TOO_LARGE` error is returned if a batch exceeds this limit. This field maps to the `max.message.bytes` Kafka property. Ensure the Redpanda broker’s [`kafka_batch_max_bytes`](https://docs.redpanda.com/streaming/current/reference/properties/cluster-properties/#kafka_batch_max_bytes) property is at least as large as this value. **Type**: `string` **Default**: `1MiB` ```yaml # Examples: max_message_bytes: 100MB # --- max_message_bytes: 50mib ``` ### `metadata_max_age` The maximum period of time after which metadata is refreshed. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Lower values provide more responsive topic and partition discovery but may increase broker load. Higher values reduce broker queries but can delay detection of topology changes. This interval also controls how frequently regex topic patterns are re-evaluated to discover new matching topics. **Type**: `string` **Default**: `1m` ### `partitioner` Override the default murmur2 hashing partitioner. **Type**: `string` | Option | Summary | | --- | --- | | `least_backup` | Chooses the least backed up partition (the partition with the fewest amount of buffered records). Partitions are selected per batch. | | `manual` | Manually select a partition for each message, requires the field `partition` to be specified. | | `murmur2_hash` | Kafka’s default hash algorithm that uses a 32-bit murmur2 hash of the key to compute which partition the record will be on. | | `round_robin` | Round-robin’s messages through all available partitions. This algorithm has lower throughput and causes higher CPU load on brokers, but can be useful if you want to ensure an even distribution of records to partitions. | ### `pipeline_id` An optional identifier for the pipeline, this will be present in logs and status updates sent to topics. **Type**: `string` **Default**: `""` ### `record_delivery_timeout` The maximum time a record can sit in the producer buffer before it is failed, roughly equivalent to Kafka’s `delivery.timeout.ms`. This is evaluated before writing a request or after a produce response. When a record times out, all records in the same partition are also failed. Set to `0s` for no timeout (the default). With `idempotent_write` enabled, timeouts are only enforced when safe to do so without creating invalid sequence numbers. **Type**: `string` **Default**: `0s` ### `record_retries` The maximum number of times a record produce is retried on failure before the record is failed. When a record fails, all records buffered in the same partition are also failed to preserve gapless ordering. Set to `0` for unlimited retries (the default). With `idempotent_write` enabled, retries are only enforced when safe to do so without creating invalid sequence numbers. **Type**: `int` **Default**: `0` ### `request_timeout_overhead` Additional time to apply as overhead when calculating request deadlines. For most requests, the deadline is this overhead alone. For requests that define their own timeout field, the overhead is added on top of that timeout, which helps prevent premature timeouts. This field is roughly equivalent to Apache Kafka’s `request.timeout.ms` parameter, but grants extra time to requests that have timeout fields. **Type**: `string` **Default**: `10s` ### `sasl[]` Specify one or more methods or mechanisms of SASL authentication. They are tried in order. If the broker supports the first SASL mechanism, all connections use it. If the first mechanism fails, the client picks the first supported mechanism. If the broker does not support any client mechanisms, all connections fail. **Type**: `array` ```yaml # Examples: sasl: - mechanism: SCRAM-SHA-512 password: bar username: foo ``` ### `sasl[].aws` Contains AWS-specific fields for when `sasl.mechanism` is set to `AWS_MSK_IAM`. **Type**: `object` ### `sasl[].aws.credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `sasl[].aws.credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `sasl[].aws.credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `sasl[].aws.credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `sasl[].aws.credentials.role` The ARN of the role to assume. **Type**: `string` ### `sasl[].aws.credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `sasl[].aws.credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `sasl[].aws.credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `sasl[].aws.endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `sasl[].aws.region` The AWS region in which your resources are hosted. **Type**: `string` ### `sasl[].aws.tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `sasl[].aws.tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].aws.tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `sasl[].aws.tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `sasl[].aws.tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].extensions` Key/value pairs to add to OAUTHBEARER authentication requests. **Type**: `object` ### `sasl[].mechanism` The SASL mechanism to use for authentication. **Type**: `string` | Option | Summary | | --- | --- | | `AWS_MSK_IAM` | AWS IAM based authentication as specified by the 'aws-msk-iam-auth' java library. | | `OAUTHBEARER` | OAuth Bearer based authentication. | | `PLAIN` | Plain text authentication. | | `REDPANDA_CLOUD_SERVICE_ACCOUNT` | Redpanda Cloud Service Account authentication when running in Redpanda Cloud. | | `SCRAM-SHA-256` | SCRAM based authentication as specified in RFC5802. | | `SCRAM-SHA-512` | SCRAM based authentication as specified in RFC5802. | | `none` | Disable sasl authentication | ### `sasl[].password` The password to use for PLAIN or SCRAM-* authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `sasl[].token` The token to use for a single session’s OAUTHBEARER authentication. **Type**: `string` **Default**: `""` ### `sasl[].username` The username to use for PLAIN or SCRAM-* authentication. **Type**: `string` **Default**: `""` ### `seed_brokers[]` A list of broker addresses used to establish connections. If an item of the list contains commas, it is expanded into multiple addresses. **Type**: `array` ```yaml # Examples: seed_brokers: - "localhost:9092" # --- seed_brokers: - "foo:9092" - "bar:9092" # --- seed_brokers: - "foo:9092,bar:9092" ``` ### `status_topic` A topic to send status updates to. **Type**: `string` **Default**: `""` ```yaml # Examples: status_topic: __redpanda.connect.status ``` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `timeout` The maximum period of time to wait for message sends before abandoning the request and retrying. **Type**: `string` **Default**: `10s` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` --- # Page 260: Scanners **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/about.md --- # Scanners For such inputs it’s necessary to define a mechanism by which the stream of source bytes can be chopped into smaller logical messages, processed and outputted as a continuous process whilst the stream is being read, as this dramatically reduces the memory usage of Redpanda Connect as a whole and results in a more fluid flow of data. The way in which we define this chopping mechanism is through scanners, configured as a field on each input that requires one. For example, if we wished to consume files line-by-line, which each individual line being processed as a discrete message, we could use the [`lines` scanner](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/lines/) with our `file` input: ## Common ```yaml input: file: paths: [ "./*.txt" ] scanner: lines: {} ``` ## Advanced ```yaml # Instead of newlines, use a custom delimiter: input: file: paths: [ "./*.txt" ] scanner: lines: custom_delimiter: "---END---" max_buffer_size: 100_000_000 # 100MB line buffer ``` A scanner is a plugin similar to any other core Redpanda Connect component (inputs, processors, outputs, etc), which means it’s possible to define your own scanners that can be utilized by inputs that need them. --- # Page 261: avro **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/avro.md --- # avro Consume a stream of Avro OCF datum. ## Avro JSON format This scanner yields documents formatted as [Avro JSON](https://avro.apache.org/docs/current/specification/#json-encoding) when decoding with Avro schemas. In this format the value of a union is encoded in JSON as follows: - if its type is `null`, then it is encoded as a JSON `null`; - otherwise it is encoded as a JSON object with one name/value pair whose name is the type’s name and whose value is the recursively encoded value. For Avro’s named types (record, fixed or enum) the user-specified name is used, for other types the type name is used. For example, the union schema `["null","string","Foo"]`, where `Foo` is a record name, would encode: - `null` as `null`; - the string `"a"` as `{"string": "a"}`; and - a `Foo` instance as `{"Foo": {…​}}`, where `{…​}` indicates the JSON encoding of a `Foo` instance. However, it is possible to instead create documents in standard/raw JSON format by setting the field [`raw_json`](#raw_json) to `true`. ## Metadata This scanner adds the following metadata fields to each message: - `avro_schema`: The Parsing Canonical Form of the Avro schema in the OCF file header. - `avro_schema_fingerprint`: The CRC-64-AVRO (Rabin) fingerprint of the schema’s canonical form, as an unsigned 64-bit integer. ### Common ```yml scanner: avro: {} ``` ### Advanced ```yml scanner: avro: raw_json: false max_decompressed_block_bytes: 16777216 ``` ## Fields ### `max_decompressed_block_bytes` The maximum size, in bytes, that a single compressed Avro OCF block is allowed to expand to when decompressed. This guards against decompression-amplification ("deflate bomb") inputs, where a tiny compressed block would otherwise expand into a very large allocation. A block that exceeds this limit causes the scan to fail rather than be materialized. There is deliberately no way to disable this cap: pipelines with legitimately larger blocks should set an explicit higher value. Set to `0` to use the default (equivalent to omitting the field). **Type**: `int` **Default**: `16777216` ### `raw_json` Whether to decode messages into normal JSON rather than [Avro JSON](https://avro.apache.org/docs/1.12.0/specification/#json-encoding). When true, this unwraps union values (bare values instead of {"type": value} wrappers). **Type**: `bool` **Default**: `false` --- # Page 262: chunker **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/chunker.md --- # chunker Split an input stream into chunks of a given number of bytes. #### Common ```yml scanner: chunker: size: 0 # No default (required) ``` #### Advanced ```yml scanner: chunker: size: 0 # No default (required) ``` ## Fields ### `size` The size of each chunk in bytes. **Type**: `int` --- # Page 263: csv **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/csv.md --- # csv Consume comma-separated values row by row, including support for custom delimiters. ## Metadata This scanner adds the following metadata to each message: - `csv_row` The index of each row, beginning at 0. ### Common ```yml scanner: csv: custom_delimiter: "" # No default (optional) parse_header_row: true lazy_quotes: false continue_on_error: false ``` ### Advanced ```yml scanner: csv: custom_delimiter: "" # No default (optional) parse_header_row: true lazy_quotes: false continue_on_error: false ``` ## Fields ### `continue_on_error` If a row fails to parse due to any error emit an empty message marked with the error and then continue consuming subsequent rows when possible. This can sometimes be useful in situations where input data contains individual rows which are malformed. However, when a row encounters a parsing error it is impossible to guarantee that following rows are valid, as this indicates that the input data is unreliable and could potentially emit misaligned rows. **Type**: `bool` **Default**: `false` ### `custom_delimiter` Use a provided custom delimiter instead of the default comma. **Type**: `string` ### `lazy_quotes` If set to `true`, a quote may appear in an unquoted field and a non-doubled quote may appear in a quoted field. **Type**: `bool` **Default**: `false` ### `parse_header_row` Whether to reference the first row as a header row. If set to true the output structure for messages will be an object where field keys are determined by the header row. Otherwise, each message will consist of an array of values from the corresponding CSV row. **Type**: `bool` **Default**: `true` --- # Page 264: decompress **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/decompress.md --- # decompress Decompress the stream of bytes according to an algorithm, before feeding it into a child scanner. #### Common ```yml scanner: decompress: algorithm: "" # No default (required) into: to_the_end: {} ``` #### Advanced ```yml scanner: decompress: algorithm: "" # No default (required) into: to_the_end: {} ``` ## Fields ### `algorithm` One of `gzip`, `pgzip`, `zlib`, `bzip2`, `flate`, `snappy`, `lz4`, `zstd`. **Type**: `string` ### `into` The child scanner to feed the decompressed stream into. **Type**: `scanner` **Default**: ```yaml to_the_end: {} ``` --- # Page 265: json_array **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/json_array.md --- # json_array Consumes a stream of one or more JSON elements within a top level array. Use this scanner to read exports whose top-level JSON structure is an array, such as logs or bulk exports, or to break a large file of many objects into one message per element. The scanner decodes elements one at a time, so it doesn’t load the whole array into memory. The input must be one JSON array, or several arrays one after another, such as `[1,2][3]`. The scanner fails with an error if the input doesn’t start with `[`, or if anything other than another array follows a closing `]`. Each element can be any JSON value, and becomes one message that contains the element’s JSON. Suppose you have a file `events.json`: `events.json` ```json [ {"event": "login", "user": "alice"}, {"event": "logout", "user": "bob"}, {"event": "purchase", "user": "carol", "amount": 42} ] ``` The configuration to process this file is: ```yaml input: file: paths: [ "./events.json" ] scanner: json_array: {} ``` Result: Each event in the array is processed as a separate message. ## Fields The `json_array` scanner has no required fields. You declare it as `{}` in your config. ```yaml json_array: {} ``` --- # Page 266: json_documents **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/json_documents.md --- # json_documents Consumes a stream of one or more JSON documents. ## Common ```yml scanner: json_documents: {} ``` ## Advanced ```yml scanner: json_documents: {} ``` --- # Page 267: lines **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/lines.md --- # lines Split an input stream into a message per line of data. #### Common ```yml scanner: lines: custom_delimiter: "" # No default (optional) max_buffer_size: 65536 omit_empty: false ``` #### Advanced ```yml scanner: lines: custom_delimiter: "" # No default (optional) max_buffer_size: 65536 omit_empty: false ``` ## Fields ### `custom_delimiter` Use a provided custom delimiter for detecting the end of a line rather than a single line break. **Type**: `string` ### `max_buffer_size` Set the maximum buffer size for storing line data, this limits the maximum size that a line can be without causing an error. **Type**: `int` **Default**: `65536` ### `omit_empty` Omit empty lines. **Type**: `bool` **Default**: `false` --- # Page 268: re_match **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/re_match.md --- # re_match Split an input stream into segments matching against a regular expression. #### Common ```yml scanner: re_match: pattern: "" # No default (required) max_buffer_size: 65536 ``` #### Advanced ```yml scanner: re_match: pattern: "" # No default (required) max_buffer_size: 65536 ``` ## Fields ### `max_buffer_size` Set the maximum buffer size for storing line data, this limits the maximum size that a message can be without causing an error. **Type**: `int` **Default**: `65536` ### `pattern` The pattern to match against. **Type**: `string` ```yaml # Examples: pattern: (?m)^\d\d:\d\d:\d\d ``` --- # Page 269: skip_bom **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/skip_bom.md --- # skip_bom Skip one or more byte order marks for each opened child scanner. #### Common ```yml scanner: skip_bom: into: to_the_end: {} ``` #### Advanced ```yml scanner: skip_bom: into: to_the_end: {} ``` ## Fields ### `into` The child scanner to feed the resulting stream into. **Type**: `scanner` **Default**: ```yaml to_the_end: {} ``` --- # Page 270: switch **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/switch.md --- # switch Select a child scanner dynamically for source data based on factors such as the filename. This scanner outlines a list of potential child scanner candidates to be chosen, and for each source of data the first candidate to pass will be selected. A candidate without any conditions acts as a catch-all and will pass for every source, it is recommended to always have a catch-all scanner at the end of your list. If a given source of data does not pass a candidate an error is returned and the data is rejected. #### Common ```yml scanner: switch: - re_match_name: "" # No default (optional) scanner: {} # No default (required) ``` #### Advanced ```yml scanner: switch: - re_match_name: "" # No default (optional) scanner: {} # No default (required) ``` ## Fields ### `re_match_name` A regular expression to test against the name of each source of data fed into the scanner (filename or equivalent). If this pattern matches the child scanner is selected. **Type**: `string` ### `scanner` The scanner to activate if this candidate passes. **Type**: `scanner` ## Examples ### Switch based on file name In this example a file input chooses a scanner based on the extension of each file ```yaml input: file: paths: [ ./data/* ] scanner: switch: - re_match_name: '\.avro$' scanner: { avro: {} } - re_match_name: '\.csv$' scanner: { csv: {} } - re_match_name: '\.csv.gz$' scanner: decompress: algorithm: gzip into: csv: {} - re_match_name: '\.tar$' scanner: { tar: {} } - re_match_name: '\.tar.gz$' scanner: decompress: algorithm: gzip into: tar: {} - scanner: { to_the_end: {} } ``` --- # Page 271: tar **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/tar.md --- # tar Consume a tar archive file by file. ## Metadata This scanner adds the following metadata to each message: - `tar_name` ### Common ```yml scanner: tar: {} ``` ### Advanced ```yml scanner: tar: {} ``` --- # Page 272: to_the_end **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/scanners/to_the_end.md --- # to_the_end Read the input stream all the way until the end and deliver it as a single message. > ⚠️ **CAUTION** > > Some sources of data may not have a logical end, therefore caution should be made to exclusively use this scanner when the end of an input stream is clearly defined (and well within memory). ## Common ```yml scanner: to_the_end: {} ``` ## Advanced ```yml scanner: to_the_end: {} ``` --- # Page 273: Tracers **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/tracers/about.md --- # Tracers When a tracer is configured all messages will be allocated a root span during ingestion that represents their journey through a Redpanda Connect pipeline. Many Redpanda Connect processors create spans, and so tracing is a great way to analyse the pathways of individual messages as they progress through a Redpanda Connect instance. Some inputs, such as `http_server` and `http_client`, are capable of extracting a root span from the source of the message (HTTP headers). This is a work in progress and should eventually expand so that all inputs have a way of doing so. Other inputs, such as `kafka` can be configured to extract a root span by using the `extract_tracing_map` field. A tracer config section looks like this: ```yaml tracer: jaeger: agent_address: localhost:6831 sampler_type: const sampler_param: 1 ``` > ⚠️ **CAUTION** > > Although the configuration spec of this component is stable the format of spans, tags and logs created by Redpanda Connect is subject to change as it is tuned for improvement. --- # Page 274: gcp_cloudtrace **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/tracers/gcp_cloudtrace.md --- # gcp_cloudtrace Send tracing events to a [Google Cloud Trace](https://cloud.google.com/trace). #### Common ```yml tracer: gcp_cloudtrace: project: "" # No default (required) sampling_ratio: 1 flush_interval: "" # No default (optional) ``` #### Advanced ```yml tracer: gcp_cloudtrace: project: "" # No default (required) sampling_ratio: 1 tags: {} flush_interval: "" # No default (optional) ``` ## Fields ### `flush_interval` The maximum time to wait before exporting a batch of tracing spans. When unset, the `OTEL_BSP_SCHEDULE_DELAY` environment variable is used if set, otherwise the OpenTelemetry SDK default of `5s`. **Type**: `string` ### `project` The google project with Cloud Trace API enabled. If this is omitted then the Google Cloud SDK will attempt auto-detect it from the environment. **Type**: `string` ### `sampling_ratio` Sets the ratio of traces to sample. Tuning the sampling ratio is recommended for high-volume production workloads. **Type**: `float` **Default**: `1` ```yaml # Examples: sampling_ratio: 1 ``` ### `tags` A map of tags to add to tracing spans. **Type**: `object` **Default**: `{}` --- # Page 275: none **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/tracers/none.md --- # none Do not send tracing events anywhere. ## Common ```yml tracer: none: {} ``` ## Advanced ```yml tracer: none: {} ``` --- # Page 276: open_telemetry_collector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/tracers/open_telemetry_collector.md --- # open_telemetry_collector Sends tracing events to one or more OpenTelemetry Collector endpoints. Exports tracing events to one or more [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) endpoints over HTTP or gRPC. #### Common ```yml tracer: open_telemetry_collector: service: benthos http: [] # No default (required) grpc: [] # No default (required) sampling: enabled: false ratio: 0 # No default (optional) ``` #### Advanced ```yml tracer: open_telemetry_collector: service: benthos http: [] # No default (required) grpc: [] # No default (required) tags: {} sampling: enabled: false ratio: 0 # No default (optional) ``` ## Fields ### `grpc[]` A list of grpc collectors. **Type**: `array` ### `grpc[].address` The endpoint of a collector to send events to. **Type**: `string` ```yaml # Examples: address: localhost:4317 ``` ### `grpc[].secure` Connect to the collector with client transport security **Type**: `bool` **Default**: `false` ### `http[]` A list of http collectors. **Type**: `array` ### `http[].address` The endpoint of a collector to send events to. **Type**: `string` ```yaml # Examples: address: localhost:4318 ``` ### `http[].secure` Connect to the collector over HTTPS **Type**: `bool` **Default**: `false` ### `sampling` Settings for trace sampling. Sampling is recommended for high-volume production workloads. **Type**: `object` ### `sampling.enabled` Whether to enable sampling. **Type**: `bool` **Default**: `false` ### `sampling.ratio` Sets the ratio of traces to sample. **Type**: `float` ```yaml # Examples: ratio: 0.85 # --- ratio: 0.5 ``` ### `service` The name of the service in traces. **Type**: `string` **Default**: `benthos` ### `tags` A map of tags to add to all exported spans and metrics. **Type**: `object` **Default**: `{}` --- # Page 277: redpanda **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/tracers/redpanda.md --- # redpanda Sends tracing events to a Redpanda topic in OpenTelemetry format for distributed tracing and observability. The Redpanda tracer exports distributed tracing data to a Redpanda topic, enabling you to monitor and debug your Redpanda Connect pipelines. Traces are exported in OpenTelemetry format, as JSON by default, allowing integration with observability platforms like Jaeger, Grafana Tempo, or custom trace consumers. Use the `format` field to emit spans as protobuf, or to publish schemas to a Schema Registry alongside the data. This tracer automatically captures trace spans as messages flow through your pipeline, recording timing information, component metadata, and error details. Use this tracer to: - **Track message flow** through complex pipelines with multiple processors - **Identify performance bottlenecks** by analyzing span durations - **Debug failures** by examining trace context and error details - **Monitor pipeline health** across distributed Redpanda Connect instances - **Correlate activity** across multiple services using trace IDs The tracer writes to a dedicated Redpanda topic (default: `otel-traces`) that trace analysis tools can consume. Configure sampling to control trace volume in high-throughput environments. #### Common ```yml tracer: redpanda: seed_brokers: [] # No default (required) topic: otel-traces format: json schema_registry: url: "" # No default (optional) service: redpanda-connect sampling: enabled: false ratio: 0 # No default (optional) ``` #### Advanced ```yml tracer: redpanda: seed_brokers: [] # No default (required) client_id: redpanda-connect tls: enabled: false skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] sasl: [] # No default (optional) metadata_max_age: 1m request_timeout_overhead: 10s conn_idle_timeout: 20s tcp: connect_timeout: 0s keep_alive: idle: 15s interval: 15s count: 9 tcp_user_timeout: 0s partitioner: "" # No default (optional) idempotent_write: true acks: all compression: snappy allow_auto_topic_creation: true timeout: 10s max_message_bytes: 1MiB broker_write_max_bytes: 100MiB max_buffered_records: 10000 max_buffered_bytes: "0" max_in_flight_requests: 1 record_retries: 0 record_delivery_timeout: 0s topic: otel-traces format: json schema_registry: url: "" # No default (optional) tls: skip_cert_verify: false enable_renegotiation: false root_cas: "" root_cas_file: "" client_certs: [] oauth2: enabled: false client_key: "" client_secret: "" token_url: "" scopes: [] endpoint_params: {} oauth: enabled: false consumer_key: "" consumer_secret: "" access_token: "" access_token_secret: "" basic_auth: enabled: false username: "" password: "" jwt: enabled: false private_key_file: "" signing_method: "" claims: {} headers: {} service: redpanda-connect tags: {} sampling: enabled: false ratio: 0 # No default (optional) ``` ## Fields ### `acks` The number of acknowledgements the leader broker must receive from ISR brokers before responding to the produce request. When `idempotent_write` is enabled this must be set to `all`. **Type**: `string` **Default**: `all` | Option | Summary | | --- | --- | | `all` | Wait for all in-sync replicas to acknowledge (acks=-1). Required when idempotent_write is enabled. | | `leader` | Wait for the leader broker to acknowledge (acks=1). Messages are lost if the leader fails before replication. | | `none` | Do not wait for any acknowledgement (acks=0). Highest throughput but messages may be lost. | ### `allow_auto_topic_creation` Enables topics to be auto created if they do not exist when fetching their metadata. If set to `false`, the topic must already exist. **Type**: `bool` **Default**: `true` ### `broker_write_max_bytes` The maximum number of bytes this output can write to a broker connection in a single write. This field corresponds to Kafka’s `socket.request.max.bytes`. **Type**: `string` **Default**: `100MiB` ```yaml # Examples: broker_write_max_bytes: 128MB # --- broker_write_max_bytes: 50mib ``` ### `client_id` An identifier for the client connection. This identifier appears in broker logs and metrics, which helps you identify the Redpanda Connect instance that is connecting. **Type**: `string` **Default**: `redpanda-connect` ### `compression` The compression codec for produced record batches. A batch that compression does not make smaller is sent uncompressed, whichever codec you choose. **Type**: `string` **Default**: `snappy` **Options**: `lz4`, `snappy`, `gzip`, `none`, `zstd` ### `conn_idle_timeout` The approximate amount of time that connections can remain idle before they are closed. In the worst case, a connection can stay idle for up to twice this value. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. **Type**: `string` **Default**: `20s` ### `format` The serialization format for individual spans in the topic. **Type**: `string` **Default**: `json` | Option | Summary | | --- | --- | | `json` | Emit in JSON Format | | `protobuf` | Emit in Protobuf Format | | `schema-registry-json` | Emit in JSON Format with Schema Registry encoding | | `schema-registry-protobuf` | Emit in Protobuf Format with Schema Registry encoding | ### `idempotent_write` Enable the idempotent write producer option. When enabled, the producer initializes a producer ID and uses it to guarantee exactly-once semantics per partition, so retries do not produce duplicates. This option requires the `IDEMPOTENT_WRITE` permission on the `CLUSTER` resource. Disable this option if the `IDEMPOTENT_WRITE` permission is unavailable, for example in some managed Kafka services or Redpanda clusters with strict ACLs. Disabling this option only affects retry behavior: duplicates may occur on producer retries, but the pipeline continues to function normally. **Type**: `bool` **Default**: `true` ### `max_buffered_bytes` The maximum number of bytes the client will buffer in memory before blocking. When this limit is reached, `Produce()` calls will block until buffered records are delivered. Set to `0` to disable the byte-level limit (only `max_buffered_records` applies). This limit is checked after `max_buffered_records`. **Type**: `string` **Default**: `0` ```yaml # Examples: max_buffered_bytes: 256MB # --- max_buffered_bytes: 50mib ``` ### `max_buffered_records` The maximum number of records the client will buffer in memory before blocking. When this limit is reached, `Produce()` calls will block until buffered records are delivered and space frees up. Increase this value for high-throughput pipelines to avoid back-pressure stalls. **Type**: `int` **Default**: `10000` ### `max_in_flight_requests` The maximum number of produce requests in flight per broker connection. While `idempotent_write` is enabled (the default) this must be `1`, as the client relies on a single in-flight request per broker to guarantee ordering. To use higher values you must set `idempotent_write` to `false`, which allows requests to be pipelined for throughput but may cause duplicate and out-of-order delivery on retries. Note that this is distinct from the output’s `max_in_flight` field, which counts message batches being written in parallel rather than produce requests on the wire. A value of `1` is not a throughput ceiling: records from concurrent writes are coalesced into fewer, larger produce requests. **Type**: `int` **Default**: `1` ### `max_message_bytes` The maximum size of a produced record batch in bytes. A `MESSAGE_TOO_LARGE` error is returned if a batch exceeds this limit. This field maps to the `max.message.bytes` Kafka property. Ensure the Redpanda broker’s [`kafka_batch_max_bytes`](https://docs.redpanda.com/streaming/current/reference/properties/cluster-properties/#kafka_batch_max_bytes) property is at least as large as this value. **Type**: `string` **Default**: `1MiB` ```yaml # Examples: max_message_bytes: 100MB # --- max_message_bytes: 50mib ``` ### `metadata_max_age` The maximum period of time after which metadata is refreshed. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`. Lower values provide more responsive topic and partition discovery but may increase broker load. Higher values reduce broker queries but can delay detection of topology changes. This interval also controls how frequently regex topic patterns are re-evaluated to discover new matching topics. **Type**: `string` **Default**: `1m` ### `partitioner` Override the default murmur2 hashing partitioner. **Type**: `string` | Option | Summary | | --- | --- | | `least_backup` | Chooses the least backed up partition (the partition with the fewest amount of buffered records). Partitions are selected per batch. | | `manual` | Manually select a partition for each message, requires the field `partition` to be specified. | | `murmur2_hash` | Kafka’s default hash algorithm that uses a 32-bit murmur2 hash of the key to compute which partition the record will be on. | | `round_robin` | Round-robin’s messages through all available partitions. This algorithm has lower throughput and causes higher CPU load on brokers, but can be useful if you want to ensure an even distribution of records to partitions. | ### `record_delivery_timeout` The maximum time a record can sit in the producer buffer before it is failed, roughly equivalent to Kafka’s `delivery.timeout.ms`. This is evaluated before writing a request or after a produce response. When a record times out, all records in the same partition are also failed. Set to `0s` for no timeout (the default). With `idempotent_write` enabled, timeouts are only enforced when safe to do so without creating invalid sequence numbers. **Type**: `string` **Default**: `0s` ### `record_retries` The maximum number of times a record produce is retried on failure before the record is failed. When a record fails, all records buffered in the same partition are also failed to preserve gapless ordering. Set to `0` for unlimited retries (the default). With `idempotent_write` enabled, retries are only enforced when safe to do so without creating invalid sequence numbers. **Type**: `int` **Default**: `0` ### `request_timeout_overhead` Additional time to apply as overhead when calculating request deadlines. For most requests, the deadline is this overhead alone. For requests that define their own timeout field, the overhead is added on top of that timeout, which helps prevent premature timeouts. This field is roughly equivalent to Apache Kafka’s `request.timeout.ms` parameter, but grants extra time to requests that have timeout fields. **Type**: `string` **Default**: `10s` ### `sampling` Configure trace sampling to control the volume of trace data. Sampling is recommended for high-volume production workloads to prevent trace data from overwhelming your observability infrastructure. **Type**: `object` ### `sampling.enabled` Whether to enable trace sampling. When disabled, all traces are exported. When enabled, traces are sampled according to the configured ratio. **Type**: `bool` **Default**: `false` ### `sampling.ratio` The sampling ratio as a decimal between 0 and 1. For example, `0.1` samples 10% of traces, `0.01` samples 1%. Lower ratios reduce trace volume and overhead. For high-throughput production systems, start with 0.01-0.1 and adjust based on your needs. **Type**: `float` ```yaml # Examples: ratio: 0.05 # --- ratio: 0.85 # --- ratio: 0.5 ``` ### `sasl[]` Specify one or more methods or mechanisms of SASL authentication. They are tried in order. If the broker supports the first SASL mechanism, all connections use it. If the first mechanism fails, the client picks the first supported mechanism. If the broker does not support any client mechanisms, all connections fail. **Type**: `array` ```yaml # Examples: sasl: - mechanism: SCRAM-SHA-512 password: bar username: foo ``` ### `sasl[].aws` Contains AWS-specific fields for when `sasl.mechanism` is set to `AWS_MSK_IAM`. **Type**: `object` ### `sasl[].aws.credentials` Manually configure the AWS credentials to use (optional). For more information, see the [Amazon Web Services guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/). **Type**: `object` ### `sasl[].aws.credentials.from_ec2_role` Use the credentials of a host EC2 machine configured to assume [an IAM role associated with the instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). **Type**: `bool` ### `sasl[].aws.credentials.id` The ID of the AWS credentials to use. **Type**: `string` ### `sasl[].aws.credentials.profile` The profile from `~/.aws/credentials` to use. **Type**: `string` ### `sasl[].aws.credentials.role` The ARN of the role to assume. **Type**: `string` ### `sasl[].aws.credentials.role_external_id` An external ID to use when assuming a role. **Type**: `string` ### `sasl[].aws.credentials.secret` The secret for the AWS credentials in use. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` ### `sasl[].aws.credentials.token` The token for the AWS credentials in use. Required only when using short-term credentials. **Type**: `string` ### `sasl[].aws.endpoint` A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints. **Type**: `string` ### `sasl[].aws.region` The AWS region in which your resources are hosted. **Type**: `string` ### `sasl[].aws.tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `sasl[].aws.tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].aws.tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `sasl[].aws.tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `sasl[].aws.tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `sasl[].aws.tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `sasl[].extensions` Key/value pairs to add to OAUTHBEARER authentication requests. **Type**: `object` ### `sasl[].mechanism` The SASL mechanism to use for authentication. **Type**: `string` | Option | Summary | | --- | --- | | `AWS_MSK_IAM` | AWS IAM based authentication as specified by the 'aws-msk-iam-auth' java library. | | `OAUTHBEARER` | OAuth Bearer based authentication. | | `PLAIN` | Plain text authentication. | | `REDPANDA_CLOUD_SERVICE_ACCOUNT` | Redpanda Cloud Service Account authentication when running in Redpanda Cloud. | | `SCRAM-SHA-256` | SCRAM based authentication as specified in RFC5802. | | `SCRAM-SHA-512` | SCRAM based authentication as specified in RFC5802. | | `none` | Disable sasl authentication | ### `sasl[].password` The password to use for PLAIN or SCRAM-* authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `sasl[].token` The token to use for a single session’s OAUTHBEARER authentication. **Type**: `string` **Default**: `""` ### `sasl[].username` The username to use for PLAIN or SCRAM-* authentication. **Type**: `string` **Default**: `""` ### `schema_registry` Schema registry information to publish schemas for tracing data along with the data. **Type**: `object` ### `schema_registry.basic_auth` Configure basic authentication for requests from this component. **Type**: `object` ### `schema_registry.basic_auth.enabled` Whether to use basic authentication in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.basic_auth.password` The password to use for authentication. Used together with `username` for basic authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.basic_auth.username` The username of the account credentials to authenticate as. Used together with `password` for basic authentication. **Type**: `string` **Default**: `""` ### `schema_registry.jwt` (beta) Configure JSON Web Token (JWT) authentication. This feature is in beta and may change in future releases. JWTs provide secure, stateless authentication between services. **Type**: `object` ### `schema_registry.jwt.claims` A map of claims to include in the JWT. Claims pass the identity of the authenticated entity to the service provider. **Type**: `object` **Default**: `{}` ### `schema_registry.jwt.enabled` Whether to use JWT authentication in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.jwt.headers` Additional key-value pairs to include in the JWT header (optional). These headers provide extra metadata for JWT processing. **Type**: `object` **Default**: `{}` ### `schema_registry.jwt.private_key_file` Path to a file containing the PEM-encoded private key using PKCS#1 or PKCS#8 format. The private key must be compatible with the algorithm specified in the `signing_method` field. **Type**: `string` **Default**: `""` ### `schema_registry.jwt.signing_method` The cryptographic algorithm used to sign the JWT. Supported algorithms are RS256, RS384, RS512, and EdDSA. This algorithm must be compatible with the private key specified in the `private_key_file` field. **Type**: `string` **Default**: `""` ### `schema_registry.oauth` Configure OAuth version 1.0 authentication for secure API access. **Type**: `object` ### `schema_registry.oauth.access_token` The value used to gain access to the protected resources on behalf of the user. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.access_token_secret` The secret that establishes ownership of the `access_token` in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.consumer_key` The value used to identify this component or client to the service provider. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.consumer_secret` The secret that establishes ownership of the consumer key in OAuth 1.0 authentication. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth.enabled` Whether to enable OAuth version 1.0 authentication for requests. **Type**: `bool` **Default**: `false` ### `schema_registry.oauth2` Configures authentication with OAuth version 2 using the client credentials token flow. To exchange a refresh token instead, add a `grant_type` parameter with the value `refresh_token` and a `refresh_token` parameter with the token to `endpoint_params`. **Type**: `object` ### `schema_registry.oauth2.client_key` A value used to identify the client to the token provider. **Type**: `string` **Default**: `""` ### `schema_registry.oauth2.client_secret` The secret used to establish ownership of the client key. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.oauth2.enabled` Whether to use OAuth version 2 in requests. **Type**: `bool` **Default**: `false` ### `schema_registry.oauth2.endpoint_params` A map of optional parameters to send to the token provider with client credentials token requests. Each value must be an array of strings. **Type**: `object` **Default**: `{}` ```yaml # Examples: endpoint_params: audience: - https://example.com resource: - https://api.example.com ``` ### `schema_registry.oauth2.scopes[]` A list of requested permissions (optional). **Type**: `array` **Default**: `[]` ### `schema_registry.oauth2.token_url` The URL of the token provider. **Type**: `string` **Default**: `""` ### `schema_registry.tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `schema_registry.tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `schema_registry.tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `schema_registry.tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `schema_registry.tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `schema_registry.tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `schema_registry.tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `schema_registry.tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `schema_registry.url` The base URL of the schema registry service. **Type**: `string` ### `seed_brokers[]` A list of broker addresses used to establish connections. If an item of the list contains commas, it is expanded into multiple addresses. **Type**: `array` ```yaml # Examples: seed_brokers: - "localhost:9092" # --- seed_brokers: - "foo:9092" - "bar:9092" # --- seed_brokers: - "foo:9092,bar:9092" ``` ### `service` The service name to identify this Redpanda Connect instance in traces. This appears in trace visualizations and helps correlate traces across distributed systems. Use descriptive names like `order-processor` or `analytics-pipeline`. **Type**: `string` **Default**: `redpanda-connect` ### `tags` Custom key-value tags to attach to all traces from this instance. Use tags to add metadata like environment (`production`, `staging`), region, version, or instance identifiers. Tags appear as resource attributes in OpenTelemetry traces. **Type**: `object` **Default**: `{}` ### `tcp` Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for: - **Unresponsive hosts**: Set `connect_timeout` to limit how long a connection attempt can take (the default `0s` sets no limit) - **Long-lived connections**: Configure `keep_alive` settings to detect and recover from stale connections - **Unstable networks**: Tune keep-alive probes to balance between quick failure detection and avoiding false positives - **Linux systems with specific requirements**: Use `tcp_user_timeout` (Linux 2.6.37+) to control data acknowledgment timeouts Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements. **Type**: `object` ### `tcp.connect_timeout` Maximum amount of time a dial will wait for a connect to complete. Zero disables. **Type**: `string` **Default**: `0s` ### `tcp.keep_alive` TCP keep-alive probe configuration. **Type**: `object` ### `tcp.keep_alive.count` Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9. **Type**: `int` **Default**: `9` ### `tcp.keep_alive.idle` Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes. **Type**: `string` **Default**: `15s` ### `tcp.keep_alive.interval` Duration between keep-alive probes. Zero defaults to 15s. **Type**: `string` **Default**: `15s` ### `tcp.tcp_user_timeout` Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables. **Type**: `string` **Default**: `0s` ### `timeout` The maximum period of time to wait for message sends before abandoning the request and retrying. **Type**: `string` **Default**: `10s` ### `tls` Configure Transport Layer Security (TLS) settings to secure network connections. This includes options for standard TLS as well as mutual TLS (mTLS) authentication where both client and server authenticate each other using certificates. Key configuration options include `enabled` to enable TLS, `client_certs` for mTLS authentication, `root_cas`/`root_cas_file` for custom certificate authorities, and `skip_cert_verify` for development environments. **Type**: `object` ### `tls.client_certs[]` A list of client certificates for mutual TLS (mTLS) authentication. Configure this field to enable mTLS, authenticating the client to the server with these certificates. You must set `tls.enabled: true` for the client certificates to take effect. **Certificate pairing rules**: For each certificate item, provide either: - Inline PEM data using both `cert` **and** `key` or - File paths using both `cert_file` **and** `key_file`. Mixing inline and file-based values within the same item is not supported. **Type**: `array` **Default**: `[]` ```yaml # Examples: client_certs: - cert: foo key: bar # --- client_certs: - cert_file: ./example.pem key_file: ./example.key ``` ### `tls.client_certs[].cert` The plaintext certificate to use for TLS authentication. Must be paired with the corresponding private key in the `key` field when using inline PEM data for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].cert_file` The path to a file containing the certificate to use for TLS authentication. Must be paired with the corresponding private key file in the `key_file` field when using file-based configuration for mTLS client certificates. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key` Private key for mTLS client certificate as inline PEM data. Must correspond to the client certificate specified in the `cert` field. Use this field together with `cert` when providing certificate data inline rather than through files. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ### `tls.client_certs[].key_file` Path to private key file for mTLS client certificate in PEM format. Must correspond to the client certificate specified in the `cert_file` field. Use this field together with `cert_file` when loading certificate data from files. **Type**: `string` **Default**: `""` ### `tls.client_certs[].password` The password to use for the private key (specified in the `key` or `key_file` fields), if it is password-protected. The PKCS#1 and PKCS#8 formats are supported. Supports environment variable interpolation for secure password management. The `pbeWithMD5AndDES-CBC` algorithm is obsolete and not supported for the PKCS#8 format. This algorithm does not authenticate the ciphertext, making it vulnerable to padding oracle attacks that can let an attacker recover the plaintext. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: password: foo # --- password: ${KEY_PASSWORD} ``` ### `tls.enable_renegotiation` Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message `local error: tls: no renegotiation`. **Type**: `bool` **Default**: `false` ### `tls.enabled` Whether to enable TLS for secure connections. Set to `true` to enable TLS encryption. Required to be `true` for other TLS options (like `client_certs`, `root_cas`, etc.) to take effect. **Type**: `bool` **Default**: `false` ### `tls.root_cas` Specify a root certificate authority to use (optional). This is a string that represents a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for inline certificate data or `root_cas_file` for file-based certificate loading. > ⚠️ **CAUTION** > > This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ``` ### `tls.root_cas_file` Specify the path to a root certificate authority file (optional). This is a file, often with a `.pem` extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate. Use either this field for file-based certificate loading or `root_cas` for inline certificate data. **Type**: `string` **Default**: `""` ```yaml # Examples: root_cas_file: ./root_cas.pem ``` ### `tls.skip_cert_verify` Whether to skip server-side certificate verification. Set to `true` only for testing environments as this reduces security by disabling certificate validation. When using self-signed certificates or in development, this may be necessary, but should never be used in production. Consider using `root_cas` or `root_cas_file` to specify trusted certificates instead of disabling verification entirely. **Type**: `bool` **Default**: `false` ### `topic` The Redpanda topic where trace data is written. This topic should be dedicated to traces and configured with appropriate retention policies. Default: `otel-traces` **Type**: `string` **Default**: `otel-traces` ## Examples ### Basic tracing setup Enable tracing for a pipeline, sending all trace data to a local Redpanda cluster. ```yaml input: redpanda: seed_brokers: [ "localhost:9092" ] topics: [ "orders" ] consumer_group: order-processor pipeline: processors: - mapping: | root = this root.processed_at = now() output: redpanda: seed_brokers: [ "localhost:9092" ] topic: processed_orders tracer: redpanda: seed_brokers: [ "localhost:9092" ] topic: otel-traces service: order-processor ``` ### Production tracing with sampling Configure tracing for a production environment with sampling to reduce trace volume, and with TLS and SASL authentication. ```yaml input: redpanda: seed_brokers: [ "redpanda-prod:9092" ] topics: [ "events" ] consumer_group: event-processor pipeline: processors: - branch: request_map: 'root = this' processors: - mapping: 'root.enriched = true' output: redpanda: seed_brokers: [ "redpanda-prod:9092" ] topic: processed_events tracer: redpanda: seed_brokers: [ "redpanda-prod:9092" ] topic: otel-traces service: event-processor-prod sampling: enabled: true ratio: 0.1 # Sample 10% of traces tls: enabled: true sasl: - mechanism: SCRAM-SHA-512 username: tracer-user password: ${TRACER_PASSWORD} ``` ### Multi-instance tracing Configure tracing for multiple Redpanda Connect instances with unique service names for correlation. Each instance writes to the same topic and sets its own `service` name and `instance` tag. This configuration is for an ingestion service. A processing service uses the same configuration with `service: processing-service` and `instance: processing-01`. ```yaml tracer: redpanda: seed_brokers: [ "redpanda:9092" ] topic: otel-traces service: ingestion-service tags: environment: production region: us-west-2 instance: ingestion-01 ``` --- # Page 278: Configuration **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/about.md --- # Configuration Redpanda Connect pipelines are configured in a YAML file that consists of a number of root sections, arranged like so: #### Common ```yaml input: kafka: addresses: [ TODO ] topics: [ foo, bar ] consumer_group: foogroup pipeline: processors: - mapping: | root.message = this root.meta.link_count = this.links.length() output: aws_s3: bucket: TODO path: '${! meta("kafka_topic") }/${! json("message.id") }.json' ``` #### Full ```yaml http: address: 0.0.0.0:4195 debug_endpoints: false input: kafka: addresses: [ TODO ] topics: [ foo, bar ] consumer_group: foogroup buffer: none: {} pipeline: processors: - mapping: | root.message = this root.meta.link_count = this.links.length() output: aws_s3: bucket: TODO path: '${! meta("kafka_topic") }/${! json("message.id") }.json' input_resources: [] cache_resources: [] processor_resources: [] rate_limit_resources: [] output_resources: [] logger: level: INFO static_fields: '@service': benthos metrics: prometheus: {} tracer: none: {} shutdown_timeout: 20s shutdown_delay: "" ``` Most sections represent a component type, which you can read about in more detail in [this document](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/about/). These types are hierarchical. For example, an `input` can have a list of child `processor` types attached to it, which in turn can have their own `processor` children. This is powerful but can potentially lead to large and cumbersome configuration files. This document outlines tooling provided by Redpanda Connect to help with writing and managing these more complex configuration files. ## Testing For guidance on how to write and run unit tests for your configuration files read [this guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/unit_testing/). ## Customizing your configuration Sometimes it’s useful to write a configuration where certain fields can be defined during deployment. For this purpose Redpanda Connect supports [environment variable interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/), allowing you to set fields in your config with environment variables like so: ```yaml input: kafka: addresses: - ${KAFKA_BROKER:localhost:9092} topics: - ${KAFKA_TOPIC:default-topic} ``` This is very useful for sharing configuration files across different deployment environments. ## Labels Labels are unique, user-defined identifiers used throughout Redpanda Connect configurations. They serve two purposes: - **Reference:** Allow different parts of your pipeline to refer to specific components or resources. - **Readability:** Make your configuration more understandable for humans, especially in complex deployments. You can assign labels to most pipeline components, including resources, inputs, outputs, processors, and entire pipelines. Using clear, descriptive labels improves both maintainability and clarity. Labels are commonly applied to the following components: ### Resources Labels identify [reusable resources](#reuse) such as processors, caches, and rate limiters, making them easy to reference elsewhere in your pipeline. ```yaml processor_resources: - label: my-transformer # Processor resource label mapping: 'root = content().uppercase()' cache_resources: - label: user-cache # Cache resource label memory: default_ttl: 300s rate_limit_resources: - label: api-limiter # Rate limiter resource label local: count: 100 interval: 1m ``` ### Component labeling for clarity You can also use labels on inputs, outputs, processors, and other components to improve the human-readability of your configuration and make troubleshooting easier. For example: ```yaml input: label: ingest_api http_server: {} pipeline: label: user_data_ingest processors: - label: sanitize_fields mapping: 'root = this.trim()' - resource: my-transformer ``` ## Label naming requirements Labels must meet the following criteria: - **Length**: 3-128 characters - **Allowed characters**: Alphanumeric, hyphens, and underscores (`A-Za-z0-9-_`) - **Case sensitivity**: Labels are case-sensitive Example valid labels ``` my-processor data_transformer_01 UserAnalytics-v2 ``` Example invalid labels ``` ab // Too short (less than 3 characters) my.processor // Invalid character: period my processor // Invalid character: space ``` ## Reusing configuration snippets Sometimes it’s necessary to use a rather large component multiple times. Instead of copy/pasting the configuration or using YAML anchors you can define your component as a resource. In the following example we want to make an HTTP request with our payloads. Occasionally the payload might get rejected due to garbage within its contents, and so we catch these rejected requests, attempt to "cleanse" the contents and try to make the same HTTP request again. Since the HTTP request component is quite large (and likely to change over time) we make sure to avoid duplicating it by defining it as a resource `get_foo`: ```yaml pipeline: processors: - resource: get_foo - catch: - mapping: | root = this root.content = this.content.strip_html() - resource: get_foo processor_resources: - label: get_foo http: url: http://example.com/foo verb: POST headers: SomeThing: "set-to-this" SomeThingElse: "set-to-something-else" ``` ## Shutting down Under normal operating conditions, the Redpanda Connect process will shut down when there are no more messages produced by inputs and the final message has been processed. The shutdown procedure can also be initiated by sending the process a interrupt (`SIGINT`) or termination (`SIGTERM`) signal. There are two top-level configuration options that control the shutdown behavior: `shutdown_timeout` and `shutdown_delay`. ### Shutdown delay The `shutdown_delay` option can be used to delay the start of the shutdown procedure. This is useful for pipelines that need a short grace period to have their metrics and traces scraped. While the shutdown delay is in effect, the HTTP metrics endpoint continues to be available for scraping and any active tracers are free to flush remaining traces. The shutdown delay can be interrupted by sending the Redpanda Connect process a second OS interrupt or termination signal. ### Shutdown timeout The `shutdown_timeout` option sets a hard deadline for Redpanda Connect process to gracefully terminate. If this duration is exceeded then the process is forcefully terminated and any messages that were in-flight will be dropped. This option takes effect after the `shutdown_delay` duration has passed if that is enabled. --- # Page 279: Message Batching **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching.md --- # Message Batching Redpanda Connect is able to join sources and sinks with sometimes conflicting batching behaviors without sacrificing its strong delivery guarantees. It’s also able to perform powerful [processing functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/windowed_processing/) across batches of messages such as grouping, archiving and reduction. Therefore, batching within Redpanda Connect is a mechanism that serves multiple purposes: 1. [Performance (throughput)](#performance) 2. [Grouped message processing](#grouped-message-processing) 3. [Compatibility (mixing multi and single part message protocols)](#compatibility) ## Performance For most users the only benefit of batching messages is improving throughput over your output protocol. For some protocols this can happen in the background and requires no configuration from you. However, if an output has a `batching` configuration block this means it benefits from batching and requires you to specify how you’d like your batches to be formed by configuring a [batching policy](#batch-policy): ```yaml output: kafka: addresses: [ todo:9092 ] topic: benthos_stream # Either send batches when they reach 10 messages or when 100ms has passed # since the last batch. batching: count: 10 period: 100ms ``` However, a small number of inputs such as [`kafka`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/kafka/) must be consumed sequentially (in this case by partition) and therefore benefit from specifying your batch policy at the input level instead: ```yaml input: kafka: addresses: [ todo:9092 ] topics: [ benthos_input_stream ] batching: count: 10 period: 100ms output: kafka: addresses: [ todo:9092 ] topic: benthos_stream ``` Inputs that behave this way are documented as such and have a `batching` configuration block. Sometimes you may prefer to create your batches before processing in order to benefit from [batch wide processing](#grouped-message-processing), in which case if your input doesn’t already support [a batch policy](#batch-policy) you can instead use a [`broker`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/broker/), which also allows you to combine inputs with a single batch policy: ```yaml input: broker: inputs: - resource: foo - resource: bar batching: count: 50 period: 500ms ``` This also works the same with [output brokers](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/broker/). ## Grouped message processing And some processors such as [`while`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/while/) are executed once across a whole batch, you can avoid this behavior with the [`for_each` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/for_each/): ```yaml pipeline: processors: - for_each: - while: at_least_once: true max_loops: 0 check: errored() processors: - catch: [] # Wipe any previous error - resource: foo # Attempt this processor until success ``` There’s a vast number of processors that specialise in operations across batches such as [grouping](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/group_by/) and [archiving](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/archive/). For example, the following processors group a batch of messages according to a metadata field and compresses them into separate `.tar.gz` archives: ```yaml pipeline: processors: - group_by_value: value: ${! meta("kafka_partition") } - archive: format: tar - compress: algorithm: gzip output: aws_s3: bucket: TODO path: docs/${! meta("kafka_partition") }/${! count("files") }-${! timestamp_unix_nano() }.tar.gz ``` For more examples of batched (or windowed) processing check out [this document](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/windowed_processing/). ## Compatibility Redpanda Connect is able to read and write over protocols that support multiple part messages, and all payloads travelling through Redpanda Connect are represented as a multiple part message. Therefore, all components within Redpanda Connect are able to work with multiple parts in a message as standard. When messages reach an output that _doesn’t_ support multiple parts the message is broken down into an individual message per part, and then one of two behaviors happen depending on the output. If the output supports batch sending messages then the collection of messages are sent as a single batch. Otherwise, Redpanda Connect falls back to sending the messages sequentially in multiple, individual requests. This behavior means that not only can multiple part message protocols be easily matched with single part protocols, but also the concept of multiple part messages and message batches are interchangeable within Redpanda Connect. ### Shrinking batches A message batch (or multiple part message) can be broken down into smaller batches using the [`split`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/split/) processor: ```yaml input: # Consume messages that arrive in three parts. resource: foo processors: # Drop the third part - select_parts: parts: [ 0, 1 ] # Then break our message parts into individual messages - split: size: 1 ``` This is also useful when your input source creates batches that are too large for your output protocol: ```yaml input: aws_s3: bucket: todo pipeline: processors: - decompress: algorithm: gzip - unarchive: format: tar # Limit batch sizes to 5MB - split: byte_size: 5_000_000 ``` ## Batch policy When an input or output component has a config field `batching` that means it supports a batch policy. This is a mechanism that allows you to configure exactly how your batching should work on messages before they are routed to the input or output it’s associated with. Batches are considered complete and will be flushed downstream when either of the following conditions are met: - The `byte_size` field is non-zero and the total size of the batch in bytes matches or exceeds it (disregarding metadata.) - The `count` field is non-zero and the total number of messages in the batch matches or exceeds it. - A message added to the batch causes the [`check`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) to return to `true`. - The `period` field is non-empty and the time since the last batch exceeds its value. This allows you to combine conditions: ```yaml output: kafka: addresses: [ todo:9092 ] topic: benthos_stream # Either send batches when they reach 10 messages or when 100ms has passed # since the last batch. batching: count: 10 period: 100ms ``` > ⚠️ **CAUTION** > > A batch policy has the capability to _create_ batches, but not to break them down. If your configured pipeline is processing messages that are batched _before_ they reach the batch policy then they may circumvent the conditions you’ve specified here, resulting in sizes you aren’t expecting. If you are affected by this limitation then consider breaking the batches down with a [`split` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/split/) before they reach the batch policy. ### Post-batch processing A batch policy also has a field `processors` which allows you to define an optional list of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) to apply to each batch before it is flushed. This is a good place to aggregate or archive the batch into a compatible format for an output: ```yaml output: http_client: url: http://localhost:4195/post batching: count: 10 processors: - archive: format: lines ``` The above config will batch up messages and then merge them into a line delimited format before sending it over HTTP. This is an easier format to parse than the default which would have been [rfc1342](https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html). During shutdown any remaining messages waiting for a batch to complete will be flushed down the pipeline. --- # Page 280: Contextual Variables **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/contextual-variables.md --- # Contextual Variables Learn about the advantages of using contextual variables, and how to add them to your data pipelines. ## Understanding contextual variables Contextual variables provide an easy way to access information about the environment in which a data pipeline is running and the pipeline itself. You can add any of the following contextual variables to your pipeline configurations: | Contextual variable name | Description | | --- | --- | | `${REDPANDA_BROKERS}` | The bootstrap server address of the cluster on which the data pipeline is running. | | `${REDPANDA_ID}` | The ID of the cluster on which the data pipeline is running. | | `${REDPANDA_REGION}` | The cloud region where the data pipeline is deployed. | | `${REDPANDA_PIPELINE_ID}` | The ID of the data pipeline that is currently running. | | `${REDPANDA_PIPELINE_NAME}` | The display name of the data pipeline that is currently running. | | `${REDPANDA_SCHEMA_REGISTRY_URL}` | The URL of the Schema Registry associated with the cluster on which the data pipeline is running. | Contextual variables are automatically set at runtime, which means that you can reuse them across multiple pipelines and development environments. For example, if you add the contextual variable `${REDPANDA_ID}` to a pipeline configuration, it’s always set to the ID of the cluster on which the data pipeline is running, whether the pipeline is in your development, user acceptance testing, or production environment. This increases the portability of pipeline configurations and reduces maintenance overheads. You can also use contextual variables to improve data traceability. See the [Example pipeline configuration](#example-pipeline-configuration) for full details. ## Add contextual variable to a data pipeline Add a contextual variable to any pipeline configuration using the notation `${CONTEXTUAL_VARIABLE_NAME}`, for example: ```yaml output: kafka_franz: seed_brokers: - ${REDPANDA_BROKERS} ``` ### Example pipeline configuration For improved data traceability, the following pipeline configuration adds the data pipeline display name (`${REDPANDA_PIPELINE_NAME}`) and ID (`${REDPANDA_PIPELINE_ID}`) to all messages that are processed. The configuration also uses the `$REDPANDA_BROKERS` contextual variable to automatically populate the bootstrap server address of the cluster on which the pipeline is run, which allows Redpanda Connect to write updated messages to the `data` topic defined in the `kafka_franz` output. ```yaml input: generate: mapping: | root.data = "test message" interval: 10s pipeline: processors: - bloblang: | root = this root.source = "${REDPANDA_PIPELINE_NAME}" root.source_id = "${REDPANDA_PIPELINE_ID}" output: kafka_franz: seed_brokers: - ${REDPANDA_BROKERS} topic: data tls: enabled: true sasl: - mechanism: SCRAM-SHA-256 username: cluster-username password: cluster-password ``` ## Suggested reading - Learn how to [add secrets to your pipeline](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/). - Try one of our [Redpanda Connect cookbooks](https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/). - Choose [connectors for your use case](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/about/). --- # Page 281: Error Handling **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling.md --- # Error Handling Redpanda Connect supports a range of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/), such as `http` and `aws_lambda`, that may fail when retry attempts are exhausted. By default, when a processor fails, the message data continues through the pipeline mostly unchanged, except for the addition of a metadata flag, which you can use for handling errors. To make processing errors terminal instead, see [Strict error handling](#strict-error-handling). This topic explains some common error-handling patterns, including dropping messages, recovering them with more processing, and routing them to a dead-letter queue. It also shows how to combine these approaches, where appropriate. ## Strict error handling To make processing errors terminal instead of relying on error flags, enable strict error handling with the top-level `error_handling` configuration block: ```yaml error_handling: strict: true ``` When `error_handling.strict` is enabled: - A processing error is terminal for the affected message. The message skips the remaining processors in its pipeline. - The failed message is rejected (nacked) at the output rather than written. - A standalone `catch` processor does not recover failed messages, because a failed message short-circuits past it. To recover from an expected error under strict mode, wrap the fallible step and its recovery logic in a [`try_catch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/try_catch/). To retry transient failures until they succeed, use a [`retry` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/retry/). > 📝 **NOTE** > > Strict error handling will become the default and only behavior in the next major version of Redpanda Connect. The rest of this topic describes error-handling patterns for the default behavior. ## Abandon on failure You can use the [`try` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/try/) to define a list of processors that are executed in sequence. If a processor fails for a particular message, that message skips the remaining processors. For example: - If `processor_1` fails to process a message, that message skips `processor_2` and `processor_3`. - If a message is processed by `processor_1`, but `processor_2` fails, that message skips `processor_3`, and so on. ```yaml pipeline: processors: - try: - resource: processor_1 - resource: processor_2 # Skip if processor_1 fails - resource: processor_3 # Skip if processor_1 or processor_2 fails ``` ## Recover failed messages You can also route failed messages through defined processing steps using a [`catch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/catch/). For example, if `processor_1` fails to process a message, it is rerouted to `processor_2`. ```yaml pipeline: processors: - resource: processor_1 # Processor that might fail - catch: - resource: processor_2 # Processes rerouted messages ``` After messages complete all processing steps defined in the `catch` block, failure flags are removed and they are treated like regular messages. To keep failure flags in messages, you can simulate a `catch` block using a [`switch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/switch/): ```yaml pipeline: processors: - resource: processor_1 # Processor that might fail - switch: - check: errored() processors: - resource: processor_2 # Processes rerouted messages ``` ## Logging errors When an error occurs, there may be useful information stored in the error flag. You can use [`error`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/#error) Bloblang function interpolations to write this information to logs. You can also add the following Bloblang functions to expose additional details about the processor that triggered the error. - [`error_source_label`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/#error_source_label) - [`error_source_name`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/#error_source_name) - [`error_source_path`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/#error_source_path) For example, this configuration catches processor failures and writes the following information to logs: - The label of the processor (`${!error_source_label()}`) that failed - The cause of the failure (`${!error()}`) ```yaml pipeline: processors: - try: - resource: processor_1 # Processor that might fail - resource: processor_2 # Processor that might fail - resource: processor_3 # Processor that might fail - catch: - log: message: "Processor ${!error_source_label()} failed due to: ${!error()}" ``` You could also add an error message to the message payload: ```yaml pipeline: processors: - resource: processor_1 # Processor that might fail - resource: processor_2 # Processor that might fail - resource: processor_3 # Processor that might fail - catch: - mapping: | root = this root.meta.error = error() ``` ## Attempt until success To process a particular message until it is successful, try using a [`retry`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/retry/) processor: ```yaml pipeline: processors: - retry: backoff: initial_interval: 1s max_interval: 5s max_elapsed_time: 30s processors: # Retries this processor until the message is processed, or the maximum elapsed time is reached. - resource: processor_1 ``` ## Drop failed messages To filter out any failed messages from your pipeline, you can use a [`mapping` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mapping/): ```yaml pipeline: processors: - mapping: root = if errored() { deleted() } ``` The mapping uses the error flag to identify any failed messages in a batch and drops the messages, which propagates acknowledgements (also known as "acks") upstream to the pipeline’s input. ## Reject messages Some inputs, such as `nats`, `gcp_pubsub`, and `amqp_1`, support nacking (rejecting) messages. Rather than delivering unprocessed messages to your output, you can use the [`reject_errored` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/reject_errored/) to perform a nack (or rejection) on them: ```yaml output: reject_errored: resource: processor_1 # Only non-errored messages go here ``` ## Route to a dead-letter queue You can also route failed messages to a different output by nesting the [`reject_errored` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/reject_errored/) within a [`fallback` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/fallback/) ```yaml output: fallback: - reject_errored: resource: processor_1 # Only non-errored messages go here - resource: processor_2 # Only errored messages, or delivery failures to processor_1, go here ``` If you want to route data differently based on the type of error message, you can use a [`switch` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/switch/): ```yaml output: switch: cases: # Capture specifically cat-related errors - check: errored() && error().contains("meow") output: resource: processor_1 # Capture all other errors - check: errored() output: resource: processor_2 # Finally, route all successfully processed messages here - output: resource: processor_3 ``` Finally, you can attach additional metadata when routing messages to the dead-letter queue, such as the error message. This can be done by running a series of [processors](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/about/) before sending the data to the final [output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/about/). ```yaml output: fallback: - reject_errored: resource: processor_1 # Only non-errored messages go here - processors: - mutation: | root.error = @fallback_error # Adds the error message before sending the message to the dead-letter queue output resource: processor_2 # Only errored messages, or delivery failures to processor_1, go here ``` --- # Page 282: Field Paths **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/field_paths.md --- # Field Paths Many components within Redpanda Connect allow you to target certain fields using a JSON dot path. The syntax of a path within Redpanda Connect is similar to [JSON Pointers](https://tools.ietf.org/html/rfc6901), except with dot separators instead of slashes (and no leading dot.) When a path is used to set a value any path segment that does not yet exist in the structure is created as an object. For example, if we had the following JSON structure: ```json { "foo": { "bar": 21 } } ``` The query path `foo.bar` would return `21`. The characters `~` (%x7E) and `.` (%x2E) have special meaning in Redpanda Connect paths. Therefore `~` needs to be encoded as `~0` and `.` needs to be encoded as `~1` when these characters appear within a key. For example, if we had the following JSON structure: ```json { "foo.foo": { "bar~bo": { "": { "baz": 22 } } } } ``` The query path `foo~1foo.bar~0bo..baz` would return `22`. ## Arrays When Redpanda Connect encounters an array while traversing a JSON structure it requires the next path segment to be either an integer of an existing index or, depending on whether the path is used to query or set the target value, the character `*` or `-` respectively. For example, if we had the following JSON structure: ```json { "foo": [ 0, 1, { "bar": 23 } ] } ``` The query path `foo.2.bar` would return `23`. ### Querying When a query reaches an array the character `*` indicates that the query should return the value of the remaining path from each array element (within an array.) ### Setting When an array is reached the character `-` indicates that a new element should be appended to the end of the existing elements, if this character is not the final segment of the path then an object is created. --- # Page 283: Interpolation **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation.md --- # Interpolation > 📝 **NOTE** > > Environment variables are not currently supported in Redpanda Connect in Redpanda Cloud, but you can use [contextual variables](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/contextual-variables/) to access information about the environment in which a data pipeline is running, and the pipeline itself. Redpanda Connect allows you to dynamically set config fields with environment variables anywhere within a config file using the syntax `${}` (or `${:}` in order to specify a default value). This is useful for setting environment specific fields such as addresses: ```yaml input: kafka: addresses: [ "${BROKERS}" ] consumer_group: redpanda_connect_consumer topics: [ "haha_business" ] ``` ```sh BROKERS="foo:9092,bar:9092" rpk connect run ./config.yaml ``` If a literal string is required that matches this pattern (`${foo}`) you can escape it with double brackets. For example, the string `${{foo}}` is read as the literal `${foo}`. ## Undefined variables When an environment variable interpolation is found within a config, does not have a default value specified, and the environment variable is not defined a linting error will be reported. In order to avoid this it is possible to specify environment variable interpolations with an explicit empty default value by adding the colon without a following value, i.e. `${FOO:}` would be equivalent to `${FOO}` and would not trigger a linting error should `FOO` not be defined. ## YAML tags By default, Redpanda Connect interpolates environment variables as strings. You can use [YAML tags](https://yaml.org/spec/1.2.2/#24-tags) to interpret values as another scalar type, such as integers. ```yaml output: redpanda: # ... batching: count: !!int ${BATCHING_COUNT:500} period: "${BATCHING_PERIOD:1s}" ``` Redpanda Connect supports the [core schema tags](https://yaml.org/spec/1.2.2/#103-core-schema) for scalar types: - `null` - `bool` - `int` - `float` - `str` (default) ## Bloblang queries Some Redpanda Connect fields also support [Bloblang](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) function interpolations, which are much more powerful expressions that allow you to query the contents of messages and perform arithmetic. The syntax of a function interpolation is `${!}`, where the contents are a bloblang query (the right-hand-side of a bloblang map) including a range of [functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/#functions). For example, with the following config: ```yaml output: kafka: addresses: [ "TODO:6379" ] topic: 'dope-${! json("topic") }' ``` A message with the contents `{"topic":"foo","message":"hello world"}` would be routed to the Kafka topic `dope-foo`. If a literal string is required that matches this pattern (`${!foo}`) then, similar to environment variables, you can escape it with double brackets. For example, the string `${{!foo}}` would be read as the literal `${!foo}`. Bloblang supports arithmetic, boolean operators, coalesce and mapping expressions. For more in-depth details about the language [check out the docs](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/). ## Examples ### Reference metadata A common usecase for interpolated functions is dynamic routing at the output level using metadata: ```yaml output: kafka: addresses: [ TODO ] topic: ${! meta("output_topic") } key: ${! meta("key") } ``` ### Coalesce and mapping Bloblang supports coalesce and mapping, which makes it easy to extract values from slightly varying data structures: ```yaml pipeline: processors: - cache: resource: foocache operator: set key: '${! json().message.(foo | bar).id }' value: '${! content() }' ``` Here’s a map of inputs to resulting values: ``` {"foo":{"a":{"baz":"from_a"},"c":{"baz":"from_c"}}} -> from_a {"foo":{"b":{"baz":"from_b"},"c":{"baz":"from_c"}}} -> from_b {"foo":{"b":null,"c":{"baz":"from_c"}}} -> from_c ``` ### Delayed processing We have a stream of JSON documents each with a unix timestamp field `doc.received_at` which is set when our platform receives it. We wish to only process messages an hour _after_ they were received. We can achieve this by running the `sleep` processor using an interpolation function to calculate the seconds needed to wait for: ```yaml pipeline: processors: - sleep: duration: '${! 3600 - ( timestamp_unix() - json("doc.created_at").number() ) }s' ``` If the calculated result is less than or equal to zero the processor does not sleep at all. If the value of `doc.created_at` is a string then our method `.number()` will attempt to parse it into a number. --- # Page 284: Metadata **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/metadata.md --- # Metadata In Redpanda Connect each message has raw contents and metadata, which is a map of key/value pairs representing an arbitrary amount of complementary data. When an input protocol supports attributes or metadata they will automatically be added to your messages, refer to the respective input documentation for a list of metadata keys. When an output supports attributes or metadata any metadata key/value pairs in a message will be sent (subject to service limits). ## Editing metadata Redpanda Connect allows you to add and remove metadata using the [`mapping` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mapping/). For example, you can do something like this in your pipeline: ```yaml pipeline: processors: - mapping: | # Remove all existing metadata from messages meta = deleted() # Add a new metadata field `time` from the contents of a JSON # field `event.timestamp` meta time = event.timestamp ``` You can also use [Bloblang](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) to delete individual metadata keys with: ```bloblang meta foo = deleted() ``` Or do more interesting things like remove all metadata keys with a certain prefix: ```bloblang meta = @.filter(kv -> !kv.key.has_prefix("kafka_")) ``` ## Using metadata Metadata values can be referenced in any field that supports [interpolation functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/). For example, you can route messages to Kafka topics using interpolation of metadata keys: ```yaml output: kafka: addresses: [ TODO ] topic: ${! meta("target_topic") } ``` Redpanda Connect also allows you to conditionally process messages based on their metadata with the [`switch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/switch/): ```yaml pipeline: processors: - switch: - check: '@doc_type == "nested"' processors: - sql_insert: driver: mysql dsn: foouser:foopassword@tcp(localhost:3306)/foodb table: footable columns: [ foo, bar, baz ] args_mapping: | root = [ this.document.foo, this.document.bar, @kafka_topic, ] # In: {"document":{"foo":"value1","bar":"value2"}} ``` ## Restricting metadata Outputs that support metadata, headers or some other variant of enriched fields on messages will attempt to send all metadata key/value pairs by default. However, sometimes it’s useful to refer to metadata fields at the output level even though we do not wish to send them with our data. In this case it’s possible to restrict the metadata keys that are sent with the field `metadata.exclude_prefixes` within the respective output config. For example, if we were sending messages to kafka using a metadata key `target_topic` to determine the topic but we wished to prevent that metadata key from being sent as a header we could use the following configuration: ```yaml output: kafka: addresses: [ TODO ] topic: ${! meta("target_topic") } metadata: exclude_prefixes: - target_topic ``` And when the list of metadata keys that we do _not_ want to send is large it can be helpful to use a [Bloblang mapping](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) in order to give all of these "private" keys a common prefix: ```yaml pipeline: processors: # Has an explicit list of public metadata keys, and everything else is given # an underscore prefix. - mapping: | let allowed_meta = [ "foo", "bar", "baz", ] meta = @.map_each_key(key -> if !$allowed_meta.contains(key) { "_" + key }) output: kafka: addresses: [ TODO ] topic: ${! meta("_target_topic") } metadata: exclude_prefixes: [ "_" ] ``` --- # Page 285: Monitor Data Pipelines on BYOC and Dedicated Clusters **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/monitor-connect.md --- # Monitor Data Pipelines on BYOC and Dedicated Clusters You can configure monitoring on BYOC and Dedicated clusters to understand the behavior, health, and performance of your data pipelines. Redpanda Connect automatically exports [detailed metrics for each component of your data pipeline](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/about/) to a Prometheus endpoint, along with metrics for all other cluster services. You don’t need to update the configuration of your pipeline. ## Configure Prometheus To monitor a BYOC cluster in [Prometheus](https://prometheus.io/): 1. On the Redpanda Cloud **Overview** page for your cluster, under **How to connect**, click the **Prometheus** tab. 2. Click the copy icon next to **Prometheus YAML** to copy the contents to your clipboard. The YAML contains the Prometheus scrape target configuration, as well as authentication, for the cluster. ```yaml - job_name: redpandaCloud-sample static_configs: - targets: - console-..fmc.cloud.redpanda.com metrics_path: /api/cloud/prometheus/public_metrics basic_auth: username: prometheus password: "" scheme: https ``` 3. Save the YAML configuration to Prometheus replacing the following placeholders: - `.`: ID and identifier from the **HTTPS endpoint**. - ``: Copy and paste the onscreen Prometheus password. Metrics from Redpanda endpoints are scraped into Prometheus. The metrics for each data pipeline are labelled by pipeline ID. ## Use Redpanda monitoring examples For hands-on learning, Redpanda provides a repository with examples of monitoring Redpanda with Prometheus and Grafana: [redpanda-data/observability](https://github.com/redpanda-data/observability/tree/main/cloud). ![Example Redpanda Connect Dashboard^](https://docs.redpanda.com/cloud-data-platform/shared/_images/redpanda_connect_dashboard.png) It includes [an example Grafana dashboard for Redpanda Connect](https://github.com/redpanda-data/observability/blob/main/grafana-dashboards/Redpanda-Connect-Dashboard.json) and a [sandbox environment](https://github.com/redpanda-data/observability#sandbox-environment) in which you launch a Dockerized Redpanda cluster and create a custom workload to monitor with dashboards. --- # Page 286: Process Pipelines **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/processing_pipelines.md --- # Process Pipelines If you have processors that are heavy on CPU and aren’t specific to a certain input or output they are best suited for the pipeline section. It is advantageous to use the pipeline section as it allows you to set an explicit number of parallel threads of execution: ```yaml input: resource: foo pipeline: threads: 4 processors: - mapping: | root = this fans = fans.map_each(match { this.obsession > 0.5 => this _ => deleted() }) output: resource: bar ``` If the field `threads` is set to `-1` (the default) it will automatically match the number of logical CPUs available. By default almost all Redpanda Connect sources will utilize as many processing threads as have been configured, which makes horizontal scaling easy. --- # Page 287: Manage Pipeline Resources on Clusters **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/resource-management.md --- # Manage Pipeline Resources on Clusters Learn how to set an initial resource limit for a standard data pipeline (excluding Ollama AI components) and how to manually scale the pipeline’s resources to improve performance. ## Prerequisites - A running Redpanda Cloud cluster. - An estimate of the throughput of your data pipeline. You can get some basic statistics by running your data pipeline locally using the [`benchmark` processor](https://docs.redpanda.com/connect/components/processors/benchmark/). ### Understanding compute units A compute unit allocates a specific amount of server resources (CPU and memory) to a data pipeline to handle message throughput. By default, each pipeline is allocated one compute unit, which includes 0.1 CPU (100 milliCPU or `100m`) and 400 MB (`400M`) of memory. For sizing purposes, one compute unit supports an estimated message throughput of 1 MB/s. However, actual performance depends on the complexity of a pipeline, including the components it contains and the processing it does. You can allocate a maximum of 72 compute units per pipeline. You can add compute units in increments of one up to 15 compute units. Beyond this, scaling options increase to 33 and then to 72 compute units. This scaling strategy is based on the number of machine cores required to provision resources, which scale from two to four, and then to eight cores. Server resources are charged at an [hourly rate in compute unit hours (compute/hour)](https://docs.redpanda.com/cloud-data-platform/billing/billing/#redpanda-connect-pipeline-metrics). | Number of compute units | CPU | Memory | | --- | --- | --- | | 1 | 0.1 CPU (`100m`) | 400 MB (`400M`) | | 2 | 0.2 CPU (`200m`) | 800 MB (`800M`) | | 3 | 0.3 CPU (`300m`) | 1.2 GB (`1200M`) | | 4 | 0.4 CPU (`400m`) | 1.6 GB (`1600M`) | | 5 | 0.5 CPU (`500m`) | 2.0 GB (`2000M`) | | 6 | 0.6 CPU (`600m`) | 2.4 GB (`2400M`) | | 7 | 0.7 CPU (`700m`) | 2.8 GB (`2800M`) | | 8 | 0.8 CPU (`800m`) | 3.2 GB (`3200M`) | | 9 | 0.9 CPU (`900m`) | 3.6 GB (`3600M`) | | 10 | 1.0 CPU (`1000m`) | 4.0 GB (`4000M`) | | 11 | 1.1 CPU (`1100m`) | 4.4 GB (`4400M`) | | 12 | 1.2 CPU (`1200m`) | 4.8 GB (`4800M`) | | 13 | 1.3 CPU (`1300m`) | 5.2 GB (`5200M`) | | 14 | 1.4 CPU (`1400m`) | 5.6 GB (`5600M`) | | 15 | 1.5 CPU (`1500m`) | 6.0 GB (`6000M`) | | 33 | 3.3 CPU (`3300m`) | 13.2 GB (`13200M`) | | 72 | 7.2 CPU (`7200m`) | 28.8 GB (`28800M`) | > 📝 **NOTE** > > A GPU machine is automatically assigned to each pipeline that contains embedded Ollama AI components. By default, GPU-enabled pipelines are allocated eight compute units. For larger workloads, you can scale them up to a maximum of 30 compute units. ### Set an initial resource limit When you create a data pipeline, you can allocate a fixed amount of server resources to it using compute units. > 📝 **NOTE** > > If your pipeline reaches the CPU limit, it becomes throttled, which reduces the data processing rate. If it reaches the memory limit, the pipeline restarts. To set an initial resource limit: 1. Log in to [Redpanda Cloud](https://cloud.redpanda.com). 2. On the **Clusters** page, select the cluster where you want to add a pipeline. 3. Go to the **Connect** page. 4. Select the **Redpanda Connect** tab. 5. Click **Create pipeline**. 6. Enter details for your pipeline, including a short name and description. 7. For **Compute units**, leave the default **1** compute unit to experiment with pipelines that create low message volumes. For higher throughputs, you can allocate a maximum of 72 compute units. 8. For **Configuration**, paste your pipeline configuration and click **Create** to run it. ### Scale resources View the server resources allocated to a data pipeline, and manually scale those resources to improve performance or decrease resource consumption. To view resources already allocated to a data pipeline: #### Cloud UI 1. Log in to [Redpanda Cloud](https://cloud.redpanda.com). 2. Go to the cluster where the pipeline is set up. 3. On the **Connect** page, select your pipeline and look at the value for **Resources**. - CPU resources are displayed first, in milliCPU. For example, `1` compute unit is `100m` or 0.1 CPU. - Memory is displayed next in megabytes. For example, `1` compute unit is `400M` or 400 MB. #### Data Plane API 1. [Authenticate and get the base URL](https://docs.redpanda.com/api/doc/cloud-dataplane/topic/topic-quickstart) for the Data Plane API. 2. Make a request to [`GET /v1/redpanda-connect/pipelines`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-redpandaconnectservice_listpipelines), which lists details of all pipelines on your cluster by ID. - Memory (`memory_shares`) is displayed in megabytes. For example, `1` compute unit is `400M` or 400 MB. - CPU resources (`cpu_shares`) are displayed in milliCPU. For example, `1` compute unit is `100m` or 0.1 CPU. To scale the resources for a pipeline: #### Cloud UI 1. Log in to [Redpanda Cloud](https://cloud.redpanda.com). 2. Go to the cluster where the pipeline is set up. 3. On the **Connect** page, select your pipeline and click **Edit**. 4. For **Compute units**, update the number of compute units. You can allocate a maximum of 72 compute units per pipeline. 5. Click **Update** to apply your changes. The specified resources are available immediately. #### Data Plane API You can only update CPU resources using the Data Plane API. For every 0.1 CPU that you allocate, Redpanda Cloud automatically reserves 400 MB of memory for the exclusive use of the pipeline. 1. [Authenticate and get the base URL](https://docs.redpanda.com/api/doc/cloud-dataplane/topic/topic-quickstart) for the Data Plane API, if you haven’t already. 2. Make a request to [`GET /v1/redpanda-connect/pipelines/{id}`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-redpandaconnectservice_getpipeline), including the ID of the pipeline you want to update. You’ll use the returned values in the next step. 3. Now make a request to [`PUT /v1/redpanda-connect/pipelines/{id}`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-redpandaconnectservice_updatepipeline), to update the pipeline resources: - Reuse the values returned by your `GET` request to populate the request body. - Replace the `cpu_shares` value with the resources you want to allocate, and enter any valid value for `memory_shares`. This example allocates 0.2 CPU or 200 milliCPU to a data pipeline. For `cpu_shares`, `0.1` CPU is the minimum allocation. ```bash curl -X PUT "https:///v1/redpanda-connect/pipelines/xxx..." \ -H 'accept: application/json'\ -H 'authorization: Bearer xxx...' \ -H "content-type: application/json" \ -d '{ "config_yaml": "input:\n generate:\n interval: 1s\n mapping: |\n root.id = uuid_v4()\n root.user.name = fake(\"name\")\n root.user.email = fake(\"email\")\n root.content = fake(\"paragraph\")\n\npipeline:\n processors:\n - mutation: |\n root.title = \"PRIVATE AND CONFIDENTIAL\"\n\noutput:\n kafka_franz:\n seed_brokers:\n - seed-j888.byoc.prd.cloud.redpanda.com:9092\n sasl:\n mechanism: SCRAM-SHA-256\n password: password\n username: connect\n topic: processed-emails\n tls:\n enabled: true\n", "description": "Email processor", "display_name": "emailprocessor-pipeline", "resources": { "memory_shares": "800M", "cpu_shares": "200m" } }' ``` A successful response shows the updated resource allocations with the `cpu_shares` value returned in milliCPU. 4. Make a request to [`GET /v1/redpanda-connect/pipelines`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-redpandaconnectservice_listpipelines) to verify your pipeline resource updates. --- # Page 288: Resources **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/resources.md --- # Resources Resources are components within Redpanda Connect that are declared with a unique label and can be referenced any number of times within a configuration. Only one instance of each named resource is created, but it is safe to use it in multiple places as they can be shared without consequence. Some components such as caches and rate limits can _only_ be created as a resource. However, for components where it’s optional, there are reasons to declare them as resources, such as reusability. ```yaml input: resource: foo pipeline: processors: - resource: bar - cache: operator: set resource: baz key: ${! json("id") } value: ${! content() } output: resource: buz input_resources: - label: foo generate: interval: 1s mapping: 'root = { "id": uuid_v4(), "name": "Example" }' processor_resources: - label: bar mapping: 'root = content().lowercase()' cache_resources: - label: baz memory: default_ttl: 300s output_resources: - label: buz http_client: url: http://example.com/post verb: POST ``` ## Reusability Sometimes it’s necessary to use a rather large component multiple times. Instead of copy/pasting the configuration or using YAML anchors you can define your component as a resource. In the following example we want to make an HTTP request with our payloads. Occasionally the payload might get rejected due to garbage within its contents, and so we catch these rejected requests, attempt to "cleanse" the contents and try to make the same HTTP request again. Since the HTTP request component is quite large (and likely to change over time) we make sure to avoid duplicating it by defining it as a resource `get_foo`: ```yaml pipeline: processors: - resource: get_foo - catch: - mapping: | root = this root.content = this.content.strip_html() - resource: get_foo processor_resources: - label: get_foo http: url: http://example.com/foo verb: POST headers: SomeThing: "set-to-this" SomeThingElse: "set-to-something-else" ``` --- # Page 289: Manage Secrets **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management.md --- # Manage Secrets Learn how to manage secrets in Redpanda Connect, and how to add them to your data pipelines without exposing them. Secrets are stored in the secret management solution of your cloud provider and are retrieved when you run a pipeline configuration that references them. ## Manage secrets You can manage secrets from the Cloud UI or the Data Plane API. If you manage your Redpanda Cloud resources with Terraform, you can also create secrets with the `redpanda_secret` resource. See [Manage cluster secrets](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/#manage-cluster-secrets). ### Create a secret You can create a secret and reference it in multiple data pipelines on the same cluster. #### Cloud UI 1. Log in to [Redpanda Cloud](https://cloud.redpanda.com). 2. Go to the **Secrets Store** page. 3. Click **Create secret**. 4. For **ID**, enter a name for the secret. You cannot rename the secret once it is created. 5. For **Value**, enter the secret you need to add. 6. For **Scopes**, select Redpanda Connect. 7. Optionally, add labels to help organize your secrets. 8. Click **Create**. You can now [add the secret to your data pipeline](#add-a-secret-to-a-data-pipeline). #### Data Plane API You must use a Base64-encoded secret. 1. [Authenticate and get the base URL](https://docs.redpanda.com/api/doc/cloud-dataplane/topic/topic-quickstart) for the Data Plane API. 2. Make a request to [`POST /v1/secrets`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-secretservice_createsecret). ```bash curl -X POST "https:///v1/secrets" \ -H 'accept: application/json'\ -H 'authorization: Bearer '\ -H 'content-type: application/json' \ -d '{"id":"","scopes":["SCOPE_REDPANDA_CONNECT"],"secret_data":""}' ``` You must include the following values: - ``: The base URL for the Data Plane API. - ``: The API key you generated during authentication. - ``: The ID or name of the secret you want to add. Use only the following characters: `^[A-Z][A-Z0-9_]*$`. - ``: The Base64-encoded secret. - This scope: `"SCOPE_REDPANDA_CONNECT"`. The response returns the name of the secret and the scope `"SCOPE_REDPANDA_CONNECT"`. You can now [add the secret to your data pipeline](#add-a-secret-to-a-data-pipeline). ### Update a secret You can only update the secret value, not its name. > 📝 **NOTE** > > Changes to secret values do not take effect until a pipeline is restarted. #### Cloud UI 1. Log in to [Redpanda Cloud](https://cloud.redpanda.com). 2. Go to the **Secrets Store** page. 3. Find the secret you want to update, and click the edit icon. 4. Enter the new secret value or labels, and click **Update**. 5. Start and stop any pipelines that reference the secret. #### Data Plane API You must use a Base64-encoded secret. 1. [Authenticate and get the base URL](https://docs.redpanda.com/api/doc/cloud-dataplane/topic/topic-quickstart) for the Data Plane API. 2. Make a request to [`PUT /v1/secrets/{id}`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-secretservice_updatesecret). ```bash curl -X PUT "https:///v1/secrets/" \ -H 'accept: application/json'\ -H 'authorization: Bearer '\ -H 'content-type: application/json' \ -d '{"scopes":["SCOPE_REDPANDA_CONNECT"],"secret_data":""}' ``` You must include the following values: - ``: The base URL for the Data Plane API. - ``: The name of the secret you want to update. - ``: The API key you generated during authentication. - This scope: `"SCOPE_REDPANDA_CONNECT"`. - ``: Your new Base64-encoded secret. The response returns the name of the secret and the scope `"SCOPE_REDPANDA_CONNECT"`. ### Delete a secret Before you delete a secret, make sure that you remove references to it from your data pipelines. > 📝 **NOTE** > > Changes do not affect pipelines that are already running. #### Cloud UI 1. Log in to [Redpanda Cloud](https://cloud.redpanda.com). 2. Go to the **Secrets Store** page. 3. Find the secret you want to remove, and click the delete icon. 4. Confirm your deletion. #### Data Plane API 1. [Authenticate and get the base URL](https://docs.redpanda.com/api/doc/cloud-dataplane/topic/topic-quickstart) for the Data Plane API. 2. Make a request to [`DELETE /v1/secrets/{id}`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-secretservice_deletesecret). ```bash curl -X DELETE "https:///v1/secrets/" \ -H 'accept: application/json'\ -H 'authorization: Bearer '\ ``` You must include the following values: - ``: The base URL for the Data Plane API. - ``: The name of the secret you want to delete. - ``: The API key you generated during authentication. ## Add a secret to a data pipeline ### Cloud UI 1. Go to the **Connect** page, and create a pipeline (or open an existing pipeline to edit). 2. Click the **Secret** button to add a new or existing secret to the pipeline. ### Data Plane API You can add a secret to any pipeline in your cluster using the notation `${secrets.SECRET_NAME}`. For example: ```yml sasl: - mechanism: SCRAM-SHA-256 username: "user" password: "${secrets.PASSWORD}" ``` --- # Page 290: Unit Testing **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/unit_testing.md --- # Unit Testing The Redpanda Connect service offers a command `rpk connect test` for running unit tests on sections of a configuration file. This makes it easy to protect your config files from regressions over time. ## Writing a test Let’s imagine we have a configuration file `foo.yaml` containing some processors: ```yaml input: kafka: addresses: [ TODO ] topics: [ foo, bar ] consumer_group: foogroup pipeline: processors: - mapping: '"%vend".format(content().uppercase().string())' output: aws_s3: bucket: TODO path: '${! meta("kafka_topic") }/${! json("message.id") }.json' ``` One way to write our unit tests for this config is to accompany it with a file of the same name and extension but suffixed with `_benthos_test`, which in this case would be `foo_benthos_test.yaml`. ```yml tests: - name: example test target_processors: '/pipeline/processors' environment: {} input_batch: - content: 'example content' metadata: example_key: example metadata value output_batches: - - content_equals: EXAMPLE CONTENTend metadata_equals: example_key: example metadata value ``` Under `tests` we have a list of any number of unit tests to execute for the config file. Each test is run in complete isolation, including any resources defined by the config file. Tests should be allocated a unique `name` that identifies the feature being tested. The field `target_processors` is either the label of a processor to test, or a [JSON Pointer](https://tools.ietf.org/html/rfc6901) that identifies the position of a processor, or list of processors, within the file which should be executed by the test. For example a value of `foo` would target a processor with the label `foo`, and a value of `/input/processors` would target all processors within the input section of the config. The field `environment` allows you to define an object of key/value pairs that set environment variables to be evaluated during the parsing of the target config file. These are unique to each test, allowing you to test different environment variable interpolation combinations. The field `input_batch` lists one or more messages to be fed into the targeted processors as a batch. Each message of the batch may have its raw content defined as well as metadata key/value pairs. For the common case where the messages are in JSON format, you can use `json_content` instead of `content` to specify the message structurally rather than verbatim. The field `output_batches` lists any number of batches of messages which are expected to result from the target processors. Each batch lists any number of messages, each one defining [`conditions`](#output-conditions) to describe the expected contents of the message. If the number of batches defined does not match the resulting number of batches the test will fail. If the number of messages defined in each batch does not match the number in the resulting batches the test will fail. If any condition of a message fails then the test fails. ### Inline tests Sometimes it’s more convenient to define your tests within the config being tested. This is fine, simply add the `tests` field to the end of the config being tested. ### Bloblang tests Sometimes when working with large [Bloblang mappings](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) it’s preferred to have the full mapping in a separate file to your Redpanda Connect configuration. In this case it’s possible to write unit tests that target and execute the mapping directly with the field `target_mapping`, which when specified is interpreted as either an absolute path or a path relative to the test definition file that points to a file containing only a Bloblang mapping. For example, if we were to have a file `cities.blobl` containing a mapping: ```bloblang root.Cities = this.locations. filter(loc -> loc.state == "WA"). map_each(loc -> loc.name). sort().join(", ") ``` We can accompany it with a test file `cities_test.yaml` containing a regular test definition: ```yml tests: - name: test cities mapping target_mapping: './cities.blobl' environment: {} input_batch: - content: | { "locations": [ {"name": "Seattle", "state": "WA"}, {"name": "New York", "state": "NY"}, {"name": "Bellevue", "state": "WA"}, {"name": "Olympia", "state": "WA"} ] } output_batches: - - json_equals: {"Cities": "Bellevue, Olympia, Seattle"} ``` And execute this test the same way we execute other Redpanda Connect tests (`rpk connect test ./dir/cities_test.yaml`, `rpk connect test ./dir/…​`, etc). ### Fragmented tests Sometimes the number of tests you need to define in order to cover a config file is so vast that it’s necessary to split them across multiple test definition files. This is possible but Redpanda Connect still requires a way to detect the configuration file being targeted by these fragmented test definition files. In order to do this we must prefix our `target_processors` field with the path of the target relative to the definition file. The syntax of `target_processors` in this case is a full [JSON Pointer](https://tools.ietf.org/html/rfc6901) that should look something like `target.yaml#/pipeline/processors`. For example, if we saved our test definition above in an arbitrary location like `./tests/first.yaml` and wanted to target our original `foo.yaml` config file, we could do that with the following: ```yml tests: - name: example test target_processors: '../foo.yaml#/pipeline/processors' environment: {} input_batch: - content: 'example content' metadata: example_key: example metadata value output_batches: - - content_equals: EXAMPLE CONTENTend metadata_equals: example_key: example metadata value ``` ## Input Definitions ### `content` Sets the raw content of the message. ### `json_content` ```yml json_content: foo: foo value bar: [ element1, 10 ] ``` Sets the raw content of the message to a JSON document matching the structure of the value. ### `file_content` ```yml file_content: ./foo/bar.txt ``` Sets the raw content of the message by reading a file. The path of the file should be relative to the path of the test file. ### `metadata` A map of key/value pairs that sets the metadata values of the message. ## Output Conditions ### `bloblang` ```yml bloblang: 'this.age > 10 && @foo.length() > 0' ``` Executes a [Bloblang expression](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) on a message, if the result is anything other than a boolean equalling `true` the test fails. ### `content_equals` ```yml content_equals: example content ``` Checks the full raw contents of a message against a value. ### `content_matches` ```yml content_matches: "^foo [a-z]+ bar$" ``` Checks whether the full raw contents of a message matches a regular expression (re2). ### `metadata_equals` ```yml metadata_equals: example_key: example metadata value ``` Checks a map of metadata keys to values against the metadata stored in the message. If there is a value mismatch between a key of the condition versus the message metadata this condition will fail. ### `file_equals` ```yml file_equals: ./foo/bar.txt ``` Checks that the contents of a message matches the contents of a file. The path of the file should be relative to the path of the test file. ### `file_json_equals` ```yml file_json_equals: ./foo/bar.json ``` Checks that both the message and the file contents are valid JSON documents, and that they are structurally equivalent. Will ignore formatting and ordering differences. The path of the file should be relative to the path of the test file. ### `json_equals` ```yml json_equals: { "key": "value" } ``` Checks that both the message and the condition are valid JSON documents, and that they are structurally equivalent. Will ignore formatting and ordering differences. You can also structure the condition content as YAML and it will be converted to the equivalent JSON document for testing: ```yml json_equals: key: value ``` ### `json_contains` ```yml json_contains: { "key": "value" } ``` Checks that both the message and the condition are valid JSON documents, and that the message is a superset of the condition. ## Running tests Executing tests for a specific config can be done by pointing the subcommand `test` at either the config to be tested or its test definition, e.g. `rpk connect test ./config.yaml` and `rpk connect test ./config_benthos_test.yaml` are equivalent. The `test` subcommand also supports wildcard patterns e.g. `rpk connect test ./foo/*.yaml` will execute all tests within matching files. In order to walk a directory tree and execute all tests found you can use the shortcut `./…​`, e.g. `rpk connect test ./…​` will execute all tests found in the current directory, any child directories, and so on. If you want to allow components to write logs at a provided level to stdout when running the tests, you can use `rpk connect test --log `. Please consult the [logger docs](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/logger/about/) for further details. ## Mocking processors BETA: This feature is currently in a BETA phase, which means breaking changes could be made if a fundamental issue with the feature is found. Sometimes you’ll want to write tests for a series of processors, where one or more of them are networked (or otherwise stateful). Rather than creating and managing mocked services you can define mock versions of those processors in the test definition. For example, if we have a config with the following processors: ```yaml pipeline: processors: - mapping: 'root = "simon says: " + content()' - label: get_foobar_api http: url: http://example.com/foobar verb: GET - mapping: 'root = content().uppercase()' ``` Rather than create a fake service for the `http` processor to interact with we can define a mock in our test definition that replaces it with a [`mapping` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mapping/). Mocks are configured as a map of labels that identify a processor to replace and the config to replace it with: ```yaml tests: - name: mocks the http proc target_processors: '/pipeline/processors' mocks: get_foobar_api: mapping: 'root = content().string() + " this is some mock content"' input_batch: - content: "hello world" output_batches: - - content_equals: "SIMON SAYS: HELLO WORLD THIS IS SOME MOCK CONTENT" ``` With the above test definition the `http` processor will be swapped out for `mapping: 'root = content().string() + " this is some mock content"'`. For the purposes of mocking it is recommended that you use a [`mapping` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mapping/) that simply mutates the message in a way that you would expect the mocked processor to. > 📝 **NOTE** > > It’s not currently possible to mock components that are imported as separate resource files (using `--resource`/`-r`). It is recommended that you mock these by maintaining separate definitions for test purposes (`-r "./test/*.yaml"`). ### More granular mocking It is also possible to target specific fields within the test config by [JSON pointers](https://tools.ietf.org/html/rfc6901) as an alternative to labels. The following test definition would create the same mock as the previous: ```yaml tests: - name: mocks the http proc target_processors: '/pipeline/processors' mocks: /pipeline/processors/1: mapping: 'root = content().string() + " this is some mock content"' input_batch: - content: "hello world" output_batches: - - content_equals: "SIMON SAYS: HELLO WORLD THIS IS SOME MOCK CONTENT" ``` ## Fields The schema of a template file is as follows: ### `tests` A list of one or more unit tests to execute. **Type**: `array` ### `tests[].name` The name of the test, this should be unique and give a rough indication of what behavior is being tested. **Type**: `string` ### `tests[].environment` An optional map of environment variables to set for the duration of the test. **Type**: `object` ### `tests[].target_processors` A \[JSON Pointer\]\[json-pointer\] that identifies the specific processors which should be executed by the test. The target can either be a single processor or an array of processors. Alternatively a resource label can be used to identify a processor. It is also possible to target processors in a separate file by prefixing the target with a path relative to the test file followed by a # symbol. **Type**: `string` **Default**: `"/pipeline/processors"` ```yml # Examples target_processors: foo_processor target_processors: /pipeline/processors/0 target_processors: target.yaml#/pipeline/processors target_processors: target.yaml#/pipeline/processors ``` ### `tests[].target_mapping` A file path relative to the test definition path of a Bloblang file to execute as an alternative to testing processors with the `target_processors` field. This allows you to define unit tests for Bloblang mappings directly. **Type**: `string` **Default**: `""` ### `tests[].mocks` An optional map of processors to mock. Keys should contain either a label or a JSON pointer of a processor that should be mocked. Values should contain a processor definition, which will replace the mocked processor. Most of the time you’ll want to use a \[`mapping` processor\]\[processors.mapping\] here, and use it to create a result that emulates the target processor. **Type**: `object` ```yml # Examples mocks: get_foobar_api: mapping: root = content().string() + " this is some mock content" mocks: /pipeline/processors/1: mapping: root = content().string() + " this is some mock content" ``` ### `tests[].input_batch` Define a batch of messages to feed into your test, specify either an `input_batch` or a series of `input_batches`. **Type**: `array` ### `tests[].input_batch[].content` The raw content of the input message. **Type**: `string` ### `tests[].input_batch[].json_content` Sets the raw content of the message to a JSON document matching the structure of the value. **Type**: `object` ```yml # Examples json_content: bar: - element1 - 10 foo: foo value ``` ### `tests[].input_batch[].file_content` Sets the raw content of the message by reading a file. The path of the file should be relative to the path of the test file. **Type**: `string` ```yml # Examples file_content: ./foo/bar.txt ``` ### `tests[].input_batch[].metadata` A map of metadata key/values to add to the input message. **Type**: `object` ### `tests[].input_batches` Define a series of batches of messages to feed into your test, specify either an `input_batch` or a series of `input_batches`. **Type**: `two-dimensional array` ### `tests[].input_batches[][].content` The raw content of the input message. **Type**: `string` ### `tests[].input_batches[][].json_content` Sets the raw content of the message to a JSON document matching the structure of the value. **Type**: `object` ```yml # Examples json_content: bar: - element1 - 10 foo: foo value ``` ### `tests[].input_batches[][].file_content` Sets the raw content of the message by reading a file. The path of the file should be relative to the path of the test file. **Type**: `string` ```yml # Examples file_content: ./foo/bar.txt ``` ### `tests[].input_batches[][].metadata` A map of metadata key/values to add to the input message. **Type**: `object` ### `tests[].output_batches` List of output batches. **Type**: `two-dimensional array` ### `tests[].output_batches[][].bloblang` Executes a Bloblang mapping on the output message, if the result is anything other than a boolean equalling `true` the test fails. **Type**: `string` ```yml # Examples bloblang: this.age > 10 && @foo.length() > 0 ``` ### `tests[].output_batches[][].content_equals` Checks the full raw contents of a message against a value. **Type**: `string` ### `tests[].output_batches[][].content_matches` Checks whether the full raw contents of a message matches a regular expression (re2). **Type**: `string` ```yml # Examples content_matches: ^foo [a-z]+ bar$ ``` ### `tests[].output_batches[][].metadata_equals` Checks a map of metadata keys to values against the metadata stored in the message. If there is a value mismatch between a key of the condition versus the message metadata this condition will fail. **Type**: `object` ```yml # Examples metadata_equals: example_key: example metadata value ``` ### `tests[].output_batches[][].file_equals` Checks that the contents of a message matches the contents of a file. The path of the file should be relative to the path of the test file. **Type**: `string` ```yml # Examples file_equals: ./foo/bar.txt ``` ### `tests[].output_batches[][].file_json_equals` Checks that both the message and the file contents are valid JSON documents, and that they are structurally equivalent. Will ignore formatting and ordering differences. The path of the file should be relative to the path of the test file. **Type**: `string` ```yml # Examples file_json_equals: ./foo/bar.json ``` ### `tests[].output_batches[][].json_equals` Checks that both the message and the condition are valid JSON documents, and that they are structurally equivalent. Will ignore formatting and ordering differences. **Type**: `object` ```yml # Examples json_equals: key: value ``` ### `tests[].output_batches[][].json_contains` Checks that both the message and the condition are valid JSON documents, and that the message is a superset of the condition. **Type**: `object` ```yml # Examples json_contains: key: value ``` ### `tests[].output_batches[][].file_json_contains` Checks that both the message and the file contents are valid JSON documents, and that the message is a superset of the condition. Will ignore formatting and ordering differences. The path of the file should be relative to the path of the test file. **Type**: `string` ```yml # Examples file_json_contains: ./foo/bar.json ``` --- # Page 291: Windowed Processing **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/windowed_processing.md --- # Windowed Processing A window is a batch of messages made with respect to time, with which we are able to perform processing that can analyze or aggregate the messages of the window. This is useful in stream processing as the dataset is never "complete", and therefore in order to perform analysis against a collection of messages we must do so by creating a continuous feed of windows (collections), where our analysis is made against each window. For example, given a stream of messages relating to cars passing through various traffic lights: ```json { "traffic_light": "cbf2eafc-806e-4067-9211-97be7e42cee3", "created_at": "2021-08-07T09:49:35Z", "registration_plate": "AB1C DEF", "passengers": 3 } ``` Windowing allows us to produce a stream of messages representing the total traffic for each light every hour: ```json { "traffic_light": "cbf2eafc-806e-4067-9211-97be7e42cee3", "created_at": "2021-08-07T10:00:00Z", "unique_cars": 15, "passengers": 43 } ``` ## Creating windows The first step in processing windows is producing the windows themselves, this can be done by configuring a window producing buffer after your input: ### System A `system_window` buffer creates windows by following the system clock of the running machine. Windows will be created and emitted at predictable times, but this also means windows for historic data will not be emitted and therefore prevents backfills of traffic data: ```yaml input: kafka: addresses: [ TODO ] topics: [ traffic_data ] consumer_group: traffic_consumer checkpoint_limit: 1000 buffer: system_window: timestamp_mapping: root = this.created_at size: 1h allowed_lateness: 3m ``` For more information about this buffer refer to the `system_window` buffer docs. ## Grouping With a window buffer chosen our stream of messages will be emitted periodically as batches of all messages that fit within each window. Since we want to analyse the window separately for each traffic light we need to expand this single batch out into one for each traffic light identifier within the window. For that purpose we have two processor options: [`group_by`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/group_by/) and [`group_by_value`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/group_by_value/). In our case we want to group by the value of the field `traffic_light` of each message, which we can do with the following: ```yaml pipeline: processors: - group_by_value: value: ${! json("traffic_light") } ``` ## Aggregating Once our window has been grouped the next step is to calculate the aggregated passenger and unique cars counts. For this purpose the Redpanda Connect [mapping language Bloblang](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) comes in handy as the method [`from_all`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#from_all) executes the target function against the entire batch and returns an array of the values, allowing us to mutate the result with chained methods such as [`sum`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#sum): ```yaml pipeline: processors: - group_by_value: value: ${! json("traffic_light") } - mapping: | let is_first_message = batch_index() == 0 root.traffic_light = this.traffic_light root.created_at = @window_end_timestamp root.total_cars = if $is_first_message { json("registration_plate").from_all().unique().length() } root.passengers = if $is_first_message { json("passengers").from_all().sum() } # Only keep the first batch message containing the aggregated results. root = if ! $is_first_message { deleted() } ``` [Bloblang](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) is very powerful, and by using [`from`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#from) and [`from_all`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#from_all) it’s possible to perform a wide range of batch-wide processing. If you fancy a challenge try updating the above mapping to only count passengers from the first journey of each registration plate in the window (hint: the [`fold` method](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#fold) might come in handy). --- # Page 292: Redpanda Connect Quickstart **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/connect-quickstart.md --- # Redpanda Connect Quickstart In this quickstart, you build data pipelines to generate, transform, and handle streaming data end-to-end. You create two pipelines: one that generates dad jokes and writes them to a topic in your cluster, and another that reads those jokes and gives each one a random "cringe rating". After completing this quickstart, you will be able to: - Build a producer pipeline that generates and publishes data to a topic - Build a consumer pipeline that reads, transforms, and logs data from a topic ## Prerequisites You must have a Redpanda Cloud account with a Serverless, Dedicated, or standard BYOC cluster. If you don’t already have an account, [sign up for a free trial](https://redpanda.com/try-redpanda/cloud-trial). > 📝 **NOTE** > > Clusters can create up to 100 pipelines. For additional pipelines, contact [Redpanda support](https://support.redpanda.com/hc/en-us/requests/new). ## Quickstart pipelines This quickstart creates the following pipelines: - The first pipeline produces dad jokes and writes them to a topic in your cluster. - The second pipeline consumes those dad jokes and gives each one a random "cringe rating" from 1-10. The **producer pipeline** uses the following Redpanda Connect components: | Component type | Component | Purpose | | --- | --- | --- | | Input | [`generate`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/generate/) | Creates jokes | | Output | [`redpanda`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda/) | Writes messages to your topic | | Processor | [`log`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/log/) | Logs generated messages | | Processor | [`catch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/catch/) | Catches errors | The **consumer pipeline** uses the following Redpanda Connect components: | Component type | Component | Purpose | | --- | --- | --- | | Input | [`redpanda`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda/) | Reads messages from your topic | | Output | [`drop`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/drop/) | Drops the processed messages | | Processor | [`bloblang`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/bloblang/) | Processes ratings | | Processor | [`log`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/log/) | Logs processed messages | | Processor | [`catch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/catch/) | Catches errors | ## Explore the Visual editor When you create or edit a pipeline, the editor has two tabs: **YAML** and **Visual**. When you open an existing pipeline, a **Monitor** tab appears alongside them, and the **Visual** tab is read-only. Click **Edit pipeline** to make changes. - The **YAML** tab gives you an IDE-like experience: after you add a component, click its leaf icon in the left sidebar to open that component’s reference documentation, or use the slash command menu to insert secrets and other variables. - The **Visual** tab renders your pipeline as an interactive node diagram, so you can inspect and edit inputs, processors, outputs, and control-flow constructs (such as [`switch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/switch/), [`branch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/), and [`try`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/try/)/[`catch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/catch/)) without hand-writing YAML. Both tabs stay in sync, so you can switch between them at any time. A `switch` groups its cases into a single box, with each case labeled by its routing condition. A `try` groups the processors it protects into its own box, and a `catch` that follows it is connected with a dashed line labeled **ON ERROR**, so the error path is visually distinct from the main data flow: ![The Visual tab rendering a switch with two cases and a try/catch pair joined by a dashed ON ERROR line](https://docs.redpanda.com/cloud-data-platform/shared/_images/rpcn-visual-editor-control-flow.png) This quickstart uses the **YAML** tab, so click **YAML** if the editor opens on the **Visual** tab. ## Build a producer pipeline Every pipeline requires an input and an output in a configuration file. You can select components in the left sidebar and customize the YAML in the editor. To create the producer pipeline: 1. Go to the **Connect** page for your cluster and click **Create a pipeline**. 2. Enter this name for the pipeline: `joke-generator-producer`. 3. In the left sidebar, click **Add input** and search for and select the `generate` input connector. The YAML for this connector appears in the editor. 4. Click **Add output** and search for and select the `redpanda` output connector. The YAML for this connector also appears in the editor. 5. The `redpanda` connector requires a Redpanda topic and user: 1. In the left sidebar, click **Topics +**, then click **Create topic**. Enter `dad-jokes` for the topic name and click **Create**. 2. In the left sidebar, click **Users +**, then click **Create user**. Enter `connect` for the username and click **Create**. 6. Replace the generated YAML in the editor with the following. This configuration includes the `log` and `catch` processors and the `mapping` for joke generation. Bloblang is Redpanda Connect’s scripting language used to add logic. ```yaml input: generate: interval: 5s count: 0 mapping: | let jokes = [ "Why don't scientists trust atoms? Because they make up everything!", "I'm reading a book about anti-gravity. It's impossible to put down!", "Why did the scarecrow win an award? He was outstanding in his field!", "What do you call a fake noodle? An impasta!", "Why don't eggs tell jokes? They'd crack each other up!", "I used to play piano by ear, but now I use my hands.", "What do you call a bear with no teeth? A gummy bear!", "Why did the bicycle fall over? It was two tired!", "What do you call a fish wearing a crown? A king fish!", "Why don't skeletons fight each other? They don't have the guts!", "What do you call cheese that isn't yours? Nacho cheese!", "Why can't you hear a pterodactyl using the bathroom? Because the 'p' is silent!", "What did the ocean say to the beach? Nothing, it just waved!", "Why did the math book look sad? It had too many problems!", "What do you call a sleeping bull? A bulldozer!", "How do you organize a space party? You planet!", "What's orange and sounds like a parrot? A carrot!", "Why did the coffee file a police report? It got mugged!", "What do you call a can opener that doesn't work? A can't opener!", "Why don't oysters donate to charity? Because they're shellfish!" ] let joke_index = random_int() % $jokes.length() root.joke = $jokes.index($joke_index) root.id = uuid_v4() root.timestamp = now() root.source = "dad-joke-generator" root.joke_length = root.joke.length() pipeline: processors: - log: level: INFO message: "📝 Generating joke: ${! json(\"joke\") }" - catch: - log: level: ERROR message: "❌ Error generating joke: ${! error() }" output: redpanda: seed_brokers: # Required in Redpanda Cloud - ${REDPANDA_BROKERS} tls: enabled: true # Optional (default: false) client_certs: [] sasl: - mechanism: SCRAM-SHA-256 username: ${secrets.KAFKA_USER_CONNECT} password: ${secrets.KAFKA_PASSWORD_CONNECT} topic: dad-jokes # Optional ``` > 📝 **NOTE** > > - Notice the `${REDPANDA_BROKERS}` [contextual variable](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/contextual-variables/) in the configuration. This references your cluster’s bootstrap server address, so you can use it in any pipeline without hardcoding connection details. Use the slash command menu in the YAML editor or use the command palette to insert the Redpanda broker’s contextual variable. > > - Notice `${secrets.KAFKA_USER_CONNECT}` and `${secrets.KAFKA_PASSWORD_CONNECT}`. These reference secrets that you can create using the slash command menu in the YAML editor or on the **Security** page. > > - The Brave browser does not fully support code snippets. 7. Click the **Visual** tab (next to **YAML**) to see this pipeline as a diagram. ![The Visual tab rendering the producer pipeline as connected generate / log / catch / redpanda nodes](https://docs.redpanda.com/cloud-data-platform/shared/_images/rpcn-visual-editor-canvas.png) 8. Click **Save**. Your pipeline details display, and after a few seconds, the pipeline starts running. The pipeline generates jokes and writes the jokes to your Redpanda topic. ### Review the pipeline logs The page loads new log messages as they come in. When Live mode is disabled, you can filter logs, for example, by level, message content, or path. The log shows activity from the past five hours. Click through the log messages to see the startup sequence. For example, you’ll see when the output becomes active: ```json { "instance_id": "d73c39bp7l8c73d7lll0", "label": "", "level": "INFO", "message": "Output type redpanda is now active", "path": "root.output", "pipeline_id": "d73a55ptub9s73agpthg", "time": "2026-03-27T17:43:02.36416142Z" } ``` ### View the processed messages 1. Go to the **Topics** page for your cluster and select the `dad-jokes` topic. 2. Click any message to see the structure. For example: ```json { "id": "d242c355-4cee-4382-817a-190c7a115a19", "joke": "I used to play piano by ear, but now I use my hands.", "joke_length": 52, "source": "dad-joke-generator", "timestamp": "2026-03-27T15:30:38.963227997Z" } ``` ## Build a consumer pipeline This next pipeline rates the jokes that you generated in the first pipeline. To create the consumer pipeline: 1. Go back to the **Connect** page for your cluster, and click **Create a pipeline**. 2. Enter this name for the pipeline: `joke-generator-consumer`. 3. In the left sidebar, click **Add input**, and search for and select the `redpanda` input connector. 4. The `redpanda` connector requires a Redpanda topic and user: 1. In the left sidebar, click **Topics +** and select the existing topic `dad-jokes`. 2. In the left sidebar, click **Users +** and select the existing user `connect`. 3. Grant the `connect` user access to the `dad-joke-raters` consumer group: go to the **Security** page for your cluster, select the **Permissions** tab, and click **Create ACL**. Set **Principal** to `connect`, **Resource Type** to **Consumer Group**, and **Resource Name** to `dad-joke-raters`. Set **Operation** to **Read** and **Permission** to **Allow**, then click **Add ACL**. Repeat with **Operation** set to **Describe** to also grant that permission. 5. Click **Add output**, and search for and select the `drop` output connector. (For testing purposes, this output drops messages instead of forwarding them. In a real scenario you would replace the `drop` connector with your real destination.) 6. Replace the generated YAML in the editor with the following configuration, which includes the `bloblang`, `log`, and `catch` processors. > 📝 **NOTE** > > This example explicitly includes several optional configuration fields for the `redpanda` input. They’re shown here for demonstration purposes, so you can see a range of available settings. ```yaml input: redpanda: seed_brokers: # Required in Redpanda Cloud - ${REDPANDA_BROKERS} client_id: benthos # Optional (default: "benthos") tls: enabled: true # Optional (default: false) client_certs: [] sasl: - mechanism: SCRAM-SHA-256 username: ${secrets.KAFKA_USER_CONNECT} password: ${secrets.KAFKA_PASSWORD_CONNECT} metadata_max_age: 5m # Optional (default: "5m") request_timeout_overhead: 10s # Optional (default: "10s") conn_idle_timeout: 20s # Optional (default: "20s") topics: # Required (mutually exclusive with regexp_topics) - dad-jokes regexp_topics: false # Optional (default: false). Mutually exclusive with topics. rebalance_timeout: 45s # Optional (default: "45s") session_timeout: 1m # Optional (default: "1m") heartbeat_interval: 3s # Optional (default: "3s") start_from_oldest: true # Optional (default: true) start_offset: earliest # Optional (default: "earliest") fetch_max_bytes: 50MiB # Optional (default: "50MiB") fetch_max_wait: 5s # Optional (default: "5s") fetch_min_bytes: 1B # Optional (default: "1B") fetch_max_partition_bytes: 1MiB # Optional (default: "1MiB") transaction_isolation_level: read_uncommitted # Optional (default: "read_uncommitted") consumer_group: dad-joke-raters # Optional commit_period: 5s # Optional (default: "5s") partition_buffer_bytes: 1MB # Optional (default: "1MB") topic_lag_refresh_period: 5s # Optional (default: "5s") max_yield_batch_bytes: 32KB # Optional (default: "32KB") auto_replay_nacks: true # Optional (default: true) pipeline: processors: - bloblang: | root = this let rating = random_int(min: 1, max: 11) root.cringe_rating = $rating root.cringe_level = if $rating <= 3 { "Mild - Almost acceptable" } else if $rating <= 6 { "Medium - Classic dad joke territory" } else if $rating <= 8 { "High - Eye-roll inducing" } else { "EXTREME - Peak dad joke achievement" } root.processed_at = now() root.rating_emoji = match { $rating <= 3 => "😐", $rating <= 6 => "😬", $rating <= 8 => "🤦", _ => "💀" } let age_seconds = (timestamp_unix() - this.timestamp.ts_parse("2006-01-02T15:04:05Z07:00").ts_unix()) root.age_seconds = $age_seconds - log: level: INFO message: | 🎭 JOKE RATED! ${! json("rating_emoji") } Joke: "${! json("joke") }" Cringe Rating: ${! json("cringe_rating") }/10 - ${! json("cringe_level") } Age: ${! json("age_seconds") } seconds old Processed at: ${! json("processed_at") } - catch: - log: level: ERROR message: "❌ Failed to process joke: ${! error() }" output: drop: {} ``` 7. Click **Save** to start your pipeline. 8. Your pipeline details display, and after a few seconds, the pipeline starts running. Check the logs to see a rated joke. For example: ```json { "custom_source": "true", "instance_id": "d454dkn4u2is73ava480", "label": "", "level": "INFO", "message": "🎭 JOKE RATED! 💀\nJoke: \"I used to play piano by ear, but now I use my hands.\"\nCringe Rating: 9/10 - EXTREME - Peak dad joke achievement\nAge: 659 seconds old\nProcessed at: 2026-03-27T17:54:13.340229297Z\n", "path": "root.pipeline.processors.1", "pipeline_id": "d454djahlips73dmcll0", "time": "2026-03-27T17:54:13.341137527Z" } ``` ## Enable egress for pipelines on BYOC and Dedicated clusters The consumer pipeline in this quickstart drops messages instead of writing them to a real destination. When you replace the `drop` output with a connector that writes to your own systems, pipelines on BYOC and Dedicated clusters may need additional egress access. On BYOC and Dedicated clusters, pipelines run inside the Redpanda data plane VPC. By default, pipelines can connect to your Redpanda cluster and to publicly routable endpoints. Outbound connections to other destinations, such as a database with a private address in a peered VPC, are blocked. To allow pipelines to reach these destinations, add an egress allowlist to your cluster using the [Redpanda Terraform provider](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/) (version `>= 2.1.1`). The `redpanda_connect.allowed_destination_cidr_ports` attribute on the `redpanda_cluster` resource accepts up to 16 rules, each allowing egress to a destination CIDR block on a port or port range: ```hcl resource "redpanda_cluster" "example" { # ... other cluster arguments ... redpanda_connect = { allowed_destination_cidr_ports = [ { cidr = "10.62.0.0/16" # CIDR of the VPC that hosts your database port_start = 5432 # PostgreSQL } ] } } ``` The allowlist permits outbound traffic from pipelines, but it does not create a network path to the destination. For private destinations, you must also establish routing, for example by peering the Redpanda data plane VPC with the VPC that hosts your database. To set the allowlist with the Cloud API, and for the full rule reference and troubleshooting guidance, see [Configure Egress for Redpanda Connect Pipelines](https://docs.redpanda.com/cloud-data-platform/networking/connect-egress-allowlist/). For a pipeline example that writes to a private PostgreSQL database, see [Enable egress to custom destinations](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/#enable-egress-to-custom-destinations). ## Clean up When you’ve finished experimenting with your data pipeline, you can delete the pipelines and the topic you created for this quickstart. 1. On the **Connect** page, click the **…​** icon next to the `joke-generator-producer` pipeline and select **Delete**. Repeat for the `joke-generator-consumer` pipeline. 2. Confirm your deletion to remove the pipelines and associated logs. 3. On the **Topics** page, delete the `dad-jokes` topic. ## Next steps - Try one of the [Redpanda Connect cookbooks](https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/). - Choose [connectors for your use case](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/about/). - [Add secrets to your pipeline](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/). - [Monitor a data pipeline on a BYOC or Dedicated cluster](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/monitor-connect/). - [Manually scale resources for a pipeline](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/resource-management/). - [Configure, test, and run a data pipeline locally](https://docs.redpanda.com/connect/get-started/quickstarts/rpk/). --- # Page 293: Cookbooks **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks.md --- # Cookbooks - [DynamoDB CDC Patterns](https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/dynamodb_cdc/) Learn how to capture, filter, transform, and route DynamoDB change data capture (CDC) events with Redpanda Connect. - [Enrichment Workflows](https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/enrichments/) How to configure Redpanda Connect to process a workflow of enrichment services. - [Filtering and Sampling](https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/filtering/) Configure Redpanda Connect to conditionally drop messages. - [Ingest data into Snowflake](https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/snowflake_ingestion/) Configure Redpanda Connect to ingest data from a Redpanda topic into Snowflake using Snowpipe Streaming. - [Joining Streams](https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/joining_streams/) How to hydrate documents by joining multiple streams. - [Redpanda Migrator](https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/redpanda_migrator/) Move your workloads from any Kafka system to Redpanda Cloud using a single command. - [Retrieval-Augmented Generation (RAG)](https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/rag/) How to configure Redpanda Connect to create a RAG pipeline, using PostgreSQL and PGVector. - [Work with Jira Issues](https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/jira/) Learn how to query, filter, and create Jira issues using Redpanda Connect pipelines. --- # Page 294: DynamoDB CDC Patterns **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/dynamodb_cdc.md --- # DynamoDB CDC Patterns The DynamoDB CDC input enables capturing item-level changes from DynamoDB tables with streams enabled. This cookbook provides reusable patterns for filtering, transforming, and routing DynamoDB CDC events to Redpanda, S3, and other destinations. Use this cookbook to: - Apply reusable patterns for capturing DynamoDB CDC events - Adapt integration patterns to route CDC data to Redpanda and S3 - Identify patterns for filtering and transforming change events ## Prerequisites Before using these patterns, configure the following. ### Redpanda CLI Install the Redpanda CLI (`rpk`) to run Redpanda Connect. See [Install or Update rpk](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/) for installation instructions. ### DynamoDB Streams The source DynamoDB table must have [DynamoDB Streams](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html) enabled with an appropriate view type: - `KEYS_ONLY`: Only the key attributes of the modified item - `NEW_IMAGE`: The entire item as it appears after the modification - `OLD_IMAGE`: The entire item as it appeared before the modification - `NEW_AND_OLD_IMAGES`: Both the new and old item images (recommended for detecting changes) To enable streams on an existing table using the AWS CLI: ```bash aws dynamodb update-table \ --table-name orders \ --stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES ``` ### Environment variables The examples in this cookbook use environment variables for AWS configuration. Environment variables keep credentials out of your pipeline configuration files. ```bash export DYNAMODB_TABLE=orders (1) export AWS_REGION=us-east-1 (2) export REDPANDA_BROKERS=localhost:9092 (3) export S3_BUCKET=cdc-archive (4) ``` 1. The name of the DynamoDB table with streams enabled. 2. The AWS region where your DynamoDB table is located. 3. The Redpanda broker addresses (for Redpanda output examples). 4. The S3 bucket name (for S3 output examples). Redpanda Connect loads AWS credentials from the standard [credential chain](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (environment variables, `~/.aws/credentials`, or IAM roles). ## Capture CDC events The simplest pattern captures all change events from a DynamoDB table and outputs them with metadata: ```yaml input: aws_dynamodb_cdc: tables: ["${DYNAMODB_TABLE}"] region: ${AWS_REGION} checkpoint_table: redpanda_dynamodb_checkpoints start_from: trim_horizon pipeline: processors: # Extract the change event details - mapping: | root.event_type = this.eventName root.table = this.tableName root.event_id = this.eventID root.keys = this.dynamodb.keys root.new_image = this.dynamodb.newImage root.old_image = this.dynamodb.oldImage root.sequence_number = this.dynamodb.sequenceNumber root.timestamp = now() output: stdout: codec: lines ``` For details on the CDC event message structure and available fields for Bloblang mappings, see the [message structure](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_dynamodb_cdc/#message-structure) section in the connector reference. ## Filter CDC events Filter events to process only specific change types: ```yaml input: aws_dynamodb_cdc: tables: ["${DYNAMODB_TABLE}"] region: ${AWS_REGION} start_from: latest pipeline: processors: # Filter to only process INSERT and MODIFY events (ignore REMOVE) - mapping: | root = if this.eventName == "REMOVE" { deleted() } else { this } # Transform to a simplified format - mapping: | root.event_type = this.eventName root.keys = this.dynamodb.keys root.new_data = this.dynamodb.newImage root.old_data = this.dynamodb.oldImage output: stdout: codec: lines ``` This example: - Filters out `REMOVE` events using `deleted()` - Transforms the event to a simplified format ## Route to Redpanda Stream DynamoDB changes to Redpanda for real-time processing: ```yaml input: aws_dynamodb_cdc: tables: ["${DYNAMODB_TABLE}"] region: ${AWS_REGION} checkpoint_table: redpanda_dynamodb_checkpoints batch_size: 100 poll_interval: 500ms pipeline: processors: # Transform to a Kafka-friendly format with a composite key - mapping: | let keys = this.dynamodb.keys meta kafka_key = [$keys.pk, $keys.sk].filter(v -> v != null).join("#") root.event_type = this.eventName root.table = this.tableName root.timestamp = now() root.keys = this.dynamodb.keys root.new_image = this.dynamodb.newImage root.old_image = this.dynamodb.oldImage output: redpanda: seed_brokers: - ${REDPANDA_BROKERS} topic: dynamodb-cdc-events key: ${! @kafka_key } partitioner: murmur2_hash compression: snappy batching: count: 100 period: 1s ``` This example: - Creates a composite message key from the DynamoDB primary key - Transforms the DynamoDB format to plain JSON - Batches messages for efficient delivery ## Route to S3 Archive CDC events to S3 for long-term storage and analytics: ```yaml input: aws_dynamodb_cdc: tables: ["${DYNAMODB_TABLE}"] region: ${AWS_REGION} checkpoint_table: redpanda_dynamodb_checkpoints start_from: trim_horizon pipeline: processors: # Add partitioning metadata for S3 organization - mapping: | let event_time = now() meta s3_path = "year=%s/month=%s/day=%s/hour=%s".format( $event_time.ts_format("2006"), $event_time.ts_format("01"), $event_time.ts_format("02"), $event_time.ts_format("15") ) root.event_type = this.eventName root.table = this.tableName root.sequence_number = this.dynamodb.sequenceNumber root.event_time = $event_time root.keys = this.dynamodb.keys root.new_image = this.dynamodb.newImage root.old_image = this.dynamodb.oldImage output: aws_s3: bucket: ${S3_BUCKET} path: dynamodb-cdc/${DYNAMODB_TABLE}/${! @s3_path }/${! uuid_v4() }.json region: ${AWS_REGION} object_canned_acl: private batching: count: 1000 period: 1m processors: - archive: format: lines ``` This example: - Organizes files by time-based partitions (year/month/day/hour) - Batches events and archives them as newline-delimited JSON - Uses UUID file names to prevent collisions ## Route by event type Route different event types to different destinations: ```yaml input: aws_dynamodb_cdc: tables: ["${DYNAMODB_TABLE}"] region: ${AWS_REGION} pipeline: processors: # Transform to a common format - mapping: | root.event_type = this.eventName root.table = this.tableName root.timestamp = now() root.keys = this.dynamodb.keys root.data = if this.dynamodb.exists("newImage") { this.dynamodb.newImage } else { this.dynamodb.oldImage } output: switch: cases: # Route INSERT events to a topic for new records - check: this.event_type == "INSERT" output: redpanda: seed_brokers: - ${REDPANDA_BROKERS} topic: dynamodb-inserts # Route MODIFY events to a topic for updates - check: this.event_type == "MODIFY" output: redpanda: seed_brokers: - ${REDPANDA_BROKERS} topic: dynamodb-updates # Route REMOVE events to a topic for deletes - check: this.event_type == "REMOVE" output: redpanda: seed_brokers: - ${REDPANDA_BROKERS} topic: dynamodb-deletes # Fallback for any unexpected event types - output: drop: {} ``` This pattern: - Separates processing pipelines for inserts, updates, and deletes - Applies different retention policies per event type - Supports specialized downstream consumers ## Detect changed fields Compare old and new images to identify which fields changed: ```yaml input: aws_dynamodb_cdc: tables: ["${DYNAMODB_TABLE}"] region: ${AWS_REGION} pipeline: processors: # Only process MODIFY events - mapping: | root = if this.eventName != "MODIFY" { deleted() } else { this } # Compare old and new images to find changed fields - mapping: | let old_data = this.dynamodb.oldImage let new_data = this.dynamodb.newImage root.table = this.tableName root.keys = this.dynamodb.keys root.timestamp = now() # Find fields that changed by comparing key-value pairs root.changes = $new_data.key_values().filter(kv -> !$old_data.exists(kv.key) || $old_data.get(kv.key) != kv.value).map_each(kv -> {"field": kv.key, "old_value": if $old_data.exists(kv.key) { $old_data.get(kv.key) } else { null }, "new_value": kv.value}) # Find fields that were removed root.removed_fields = $old_data.keys().filter(k -> !$new_data.exists(k)) output: stdout: codec: lines ``` This pattern: - Filters to only MODIFY events - Compares old and new images to find differences - Outputs a list of changed fields with their old and new values > 📝 **NOTE** > > This pattern requires the `NEW_AND_OLD_IMAGES` stream view type. The `.key_values()` method converts an object to an array of key-value pairs that can be filtered and mapped. ## Checkpointing The DynamoDB CDC input automatically manages checkpoints in a separate DynamoDB table: ```yaml input: aws_dynamodb_cdc: tables: - orders checkpoint_table: cdc-checkpoints (1) checkpoint_limit: 500 (2) start_from: trim_horizon (3) ``` 1. Custom checkpoint table name (default: `redpanda_dynamodb_checkpoints`). 2. Checkpoint after every 500 messages (lower = better recovery, higher = fewer writes). 3. Start from the oldest available record when no checkpoint exists. If a checkpoint table doesn’t exist, it’s created automatically with the required schema. ## Performance tuning Optimize throughput and latency with these settings: ```yaml input: aws_dynamodb_cdc: tables: - orders batch_size: 1000 (1) poll_interval: 100ms (2) max_tracked_shards: 10000 (3) throttle_backoff: 50ms (4) ``` 1. Maximum records per shard per request (1-1000). 2. Time between polls when no records are available. 3. Maximum shards to track (for very large tables). 4. Backpressure delay when too many messages are in-flight. ### Throughput considerations - DynamoDB Streams allows 5 `GetRecords` calls per second per shard - Higher `batch_size` improves throughput but increases memory usage - Shorter `poll_interval` reduces latency but increases API calls ## Troubleshoot common issues ### No events received If you’re not receiving events: 1. Verify streams are enabled on the table: ```bash aws dynamodb describe-table --table-name orders \ --query 'Table.StreamSpecification' ``` 2. Check that changes are being made to the table 3. Verify `start_from` is set to `trim_horizon` to capture existing stream data ### Duplicate events Each stream record appears exactly once in DynamoDB Streams. However, if your pipeline fails before checkpointing, records may be re-read on restart, resulting in at-least-once processing semantics. To handle potential duplicates: - Use idempotent processing in downstream systems - Deduplicate using the `dynamodb_sequence_number` metadata - Lower `checkpoint_limit` to reduce the window of possible duplicates ### Stream retention DynamoDB Streams retains data for 24 hours. If your pipeline is offline longer than that: - Consider using [Kinesis Data Streams for DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/kds.html) with the [`aws_kinesis` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_kinesis/) instead (up to 1 year retention) - Implement a full-table scan fallback for disaster recovery ## Next steps - [DynamoDB CDC Input Reference](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_dynamodb_cdc/) - [AWS Configuration Guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/) - [Kinesis Input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_kinesis/) (for Kinesis Data Streams for DynamoDB) - [DynamoDB Streams Documentation](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html) --- # Page 295: Enrichment Workflows **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/enrichments.md --- # Enrichment Workflows This cookbook demonstrates how to enrich a stream of JSON documents with HTTP services. This method also works with [AWS Lambda functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/aws_lambda/). We will start off by configuring a single enrichment, then we will move onto a workflow of enrichments with a network of dependencies using the [`workflow` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/workflow/). Each enrichment will be performed in parallel across a [pre-batched](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/batching/) stream of documents. Workflow enrichments that do not depend on each other will also be performed in parallel, making this orchestration method very efficient. The imaginary problem we are going to solve is applying a set of NLP based enrichments to a feed of articles in order to detect fake news. We will be consuming and writing to Kafka, but the example works with any [input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/about/) and [output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/about/) combination. Articles are received over the topic `articles` and look like this: ```json { "type": "article", "article": { "id": "123foo", "title": "Dogs Stop Barking", "content": "The world was shocked this morning to find that all dogs have stopped barking." } } ``` ## Meet the enrichments ### Claims detector To start us off we will configure a single enrichment, which is an imaginary 'claims detector' service. This is an HTTP service that wraps a trained machine learning model to extract claims that are made within a body of text. The service expects a `POST` request with JSON payload of the form: ```json { "text": "The world was shocked this morning to find that all dogs have stopped barking." } ``` And returns a JSON payload of the form: ```json { "claims": [ { "entity": "world", "claim": "shocked" }, { "entity": "dogs", "claim": "NOT barking" } ] } ``` Since each request only applies to a single document we will make this enrichment scale by deploying multiple HTTP services and hitting those instances in parallel across our document batches. In order to send a mapped request and map the response back into the original document we will use the [`branch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/), with a child `http` processor. ```yaml input: kafka: addresses: [ TODO ] topics: [ articles ] consumer_group: benthos_articles_group batching: count: 20 # Tune this to set the size of our document batches. period: 1s pipeline: processors: - branch: request_map: 'root.text = this.article.content' processors: - http: url: http://localhost:4197/claims verb: POST result_map: 'root.tmp.claims = this.claims' output: kafka: addresses: [ TODO ] topic: comments_hydrated ``` With this pipeline our documents will come out looking something like this: ```json { "type": "article", "article": { "id": "123foo", "title": "Dogs Stop Barking", "content": "The world was shocked this morning to find that all dogs have stopped barking." }, "tmp": { "claims": [ { "entity": "world", "claim": "shocked" }, { "entity": "dogs", "claim": "NOT barking" } ] } } ``` ### Hyperbole detector Next up is a 'hyperbole detector' that takes a `POST` request containing the article contents and returns a hyperbole score between 0 and 1. This time the format is array-based and therefore supports calculating multiple documents in a single request, making better use of the host machines GPU. A request should take the following form: ```json [ { "text": "The world was shocked this morning to find that all dogs have stopped barking." } ] ``` And the response looks like this: ```json [ { "hyperbole_rank": 0.73 } ] ``` In order to create a single request from a batch of documents, and subsequently map the result back into our batch, we will use the [`archive`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/archive/) and [`unarchive`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/unarchive/) processors in our [`branch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/) flow, like this: ```yaml pipeline: processors: - branch: request_map: 'root.text = this.article.content' processors: - archive: format: json_array - http: url: http://localhost:4198/hyperbole verb: POST - unarchive: format: json_array result_map: 'root.tmp.hyperbole_rank = this.hyperbole_rank' ``` The purpose of the `json_array` format `archive` processor is to take a batch of JSON documents and place them into a single document as an array. Subsequently, we then send one single request for each batch. After the request is made we do the opposite with the `unarchive` processor in order to convert it back into a batch of the original size. ### Fake news detector Finally, we are going to use a 'fake news detector' that takes the article contents as well as the output of the previous two enrichments and calculates a fake news rank between 0 and 1. This service behaves similarly to the claims detector service and takes a document of the form: ```json { "text": "The world was shocked this morning to find that all dogs have stopped barking.", "hyperbole_rank": 0.73, "claims": [ { "entity": "world", "claim": "shocked" }, { "entity": "dogs", "claim": "NOT barking" } ] } ``` And returns an object of the form: ```json { "fake_news_rank": 0.893 } ``` We then wish to map the field `fake_news_rank` from that result into the original document at the path `article.fake_news_score`. Our [`branch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/) block for this enrichment would look like this: ```yaml pipeline: processors: - branch: request_map: | root.text = this.article.content root.claims = this.tmp.claims root.hyperbole_rank = this.tmp.hyperbole_rank processors: - http: url: http://localhost:4199/fakenews verb: POST result_map: 'root.article.fake_news_score = this.fake_news_rank' ``` Note that in our `request_map` we are targeting fields that are populated from the previous two enrichments. If we were to execute all three enrichments in a sequence we’ll end up with a document looking like this: ```json { "type": "article", "article": { "id": "123foo", "title": "Dogs Stop Barking", "content": "The world was shocked this morning to find that all dogs have stopped barking.", "fake_news_score": 0.76 }, "tmp": { "hyperbole_rank": 0.34, "claims": [ { "entity": "world", "claim": "shocked" }, { "entity": "dogs", "claim": "NOT barking" } ] } } ``` Great! However, as a streaming pipeline this set up isn’t ideal as our first two enrichments are independent and could potentially be executed in parallel in order to reduce processing latency. ## Combining into a workflow If we configure our enrichments within a [`workflow` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/workflow/) we can use Redpanda Connect to automatically detect our dependency graph, giving us two key benefits: 1. Enrichments at the same level of a dependency graph (claims and hyperbole) will be executed in parallel. 2. When introducing more enrichments to our pipeline the added complexity of resolving the dependency graph is handled automatically by Redpanda Connect. Placing our branches within a [`workflow` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/workflow/) makes our final pipeline configuration look like this: ```yaml input: kafka: addresses: [ TODO ] topics: [ articles ] consumer_group: benthos_articles_group batching: count: 20 # Tune this to set the size of our document batches. period: 1s pipeline: processors: - workflow: meta_path: '' # Don't bother storing branch metadata. branches: claims: request_map: 'root.text = this.article.content' processors: - http: url: http://localhost:4197/claims verb: POST result_map: 'root.tmp.claims = this.claims' hyperbole: request_map: 'root.text = this.article.content' processors: - archive: format: json_array - http: url: http://localhost:4198/hyperbole verb: POST - unarchive: format: json_array result_map: 'root.tmp.hyperbole_rank = this.hyperbole_rank' fake_news: request_map: | root.text = this.article.content root.claims = this.tmp.claims root.hyperbole_rank = this.tmp.hyperbole_rank processors: - http: url: http://localhost:4199/fakenews verb: POST result_map: 'root.article.fake_news_score = this.fake_news_rank' - catch: - log: fields_mapping: 'root.content = content().string()' message: "Enrichments failed due to: ${!error()}" - mapping: | root = this root.tmp = deleted() output: kafka: addresses: [ TODO ] topic: comments_hydrated ``` Since the contents of `tmp` won’t be required downstream we remove it after our enrichments using a [`mapping` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mapping/). A [`catch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/catch/) processor was added at the end of the pipeline which catches documents that failed enrichment. You can replace the log event with a wide range of recovery actions such as sending to a dead-letter/retry queue, dropping the message entirely, etc. You can read more about error handling [in this article](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/). --- # Page 296: Filtering and Sampling **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/filtering.md --- # Filtering and Sampling Filtering events in Redpanda Connect is both easy and flexible, this cookbook demonstrates a few different types of filtering you can do. All of these examples make use of the [`mapping` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mapping/) but shouldn’t require any prior knowledge. ## The basic filter Dropping events with [Bloblang](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) is done by mapping the function `deleted()` to the `root` of the mapped document. To remove all events indiscriminately you can simply do: ```yaml pipeline: processors: - mapping: root = deleted() ``` But that’s most likely not what you want. We can instead only delete an event under certain conditions with a [`match`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/#pattern-matching) or [`if`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/#conditional-mapping) expression: ```yaml pipeline: processors: - mapping: | root = if @topic.or("") == "foo" || this.doc.type == "bar" || this.doc.urls.contains("https://www.benthos.dev/").catch(false) { deleted() } ``` The above config removes any events where: - The metadata field `topic` is equal to `foo` - The event field `doc.type` (a string) is equal to `bar` - The event field `doc.urls` (an array) contains the string `https://www.benthos.dev/` Events that do not match any of these conditions will remain unchanged. ## Sample events Another type of filter we might want is a sampling filter, we can do that with a random number generator: ```yaml pipeline: processors: - mapping: | # Drop 50% of documents randomly root = if random_int() % 2 == 0 { deleted() } ``` We can also do this in a deterministic way by hashing events and filtering by that hash value: ```yaml pipeline: processors: - mapping: | # Drop ~10% of documents deterministically (same docs filtered each run) root = if content().hash("xxhash64").slice(-8).number() % 10 == 0 { deleted() } ``` --- # Page 297: Work with Jira Issues **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/jira.md --- # Work with Jira Issues The Jira processor enables querying Jira issues using JQL (Jira Query Language) and returning structured data. It’s a processor, so you can use it in pipelines for input-style flows (pair with `generate`) or output-style flows (pair with `drop`). Use this cookbook to: - Query Jira issues on a schedule or on-demand - Filter issues using JQL patterns - Create Jira issues using the HTTP processor ## Prerequisites The examples in this cookbook use the Secrets Store for Jira credentials. This keeps sensitive credentials secure and separate from your pipeline configuration. 1. [Generate a Jira API token](https://id.atlassian.com/manage-profile/security/api-tokens). 2. Add your Jira credentials to the [Secrets Store](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/): - `JIRA_BASE_URL`: Your Jira instance URL (for example, `https://your-domain.atlassian.net`) - `JIRA_USERNAME`: Your Jira account email address - `JIRA_API_TOKEN`: The API token generated from your Atlassian account - `JIRA_AUTH_TOKEN` (optional, for creating issues): Base64-encoded `username:api_token` string ## Use Jira as an input To use Jira as an input, combine the `generate` input with the Jira processor. This pattern triggers Jira queries at regular intervals or on-demand. > 💡 **TIP** > > Replace `MYPROJECT` in the examples with your actual Jira project key. ### Query Jira periodically This example queries Jira every 30 seconds for recent issues: ```yaml input: generate: interval: 30s mapping: | root.jql = "project = MYPROJECT AND updated >= -1h ORDER BY updated DESC" root.maxResults = 50 root.fields = ["key", "summary", "status", "assignee", "priority"] pipeline: processors: - jira: base_url: "${secrets.JIRA_BASE_URL}" username: "${secrets.JIRA_USERNAME}" api_token: "${secrets.JIRA_API_TOKEN}" output: stdout: {} ``` ### One-time query For a single query, use `count` instead of `interval`: ```yaml input: generate: count: 1 mapping: | root.jql = "project = MYPROJECT AND status = Open" root.maxResults = 100 pipeline: processors: - jira: base_url: "${secrets.JIRA_BASE_URL}" username: "${secrets.JIRA_USERNAME}" api_token: "${secrets.JIRA_API_TOKEN}" output: stdout: {} ``` ## Input message format The Jira processor expects input messages containing valid Jira queries in JSON format: ```json { "jql": "project = MYPROJECT AND status = Open", "maxResults": 50, "fields": ["key", "summary", "status", "assignee"] } ``` ### Required fields - `jql`: The JQL (Jira Query Language) query string ### Optional fields - `maxResults`: Maximum number of results to return (default: 50) - `fields`: Array of field names to include in the response ## JQL query patterns Here are common JQL patterns for filtering issues: ### Recent issues by project ```jql project = AND created >= -7d ORDER BY created DESC ``` ### Issues assigned to current user ```jql assignee = currentUser() AND status != Done ``` ### Issues by status ```jql project = AND status IN (Open, 'In Progress', 'To Do') ``` ### Issues by priority ```jql project = AND priority = High ORDER BY created DESC ``` ## Output message format The Jira processor returns individual issue messages, rather than a response object with an `issues` array. Each message output by the Jira processor represents a single issue: ```json { "id": "12345", "key": "DOC-123", "fields": { "summary": "Example issue", "status": { "name": "In Progress" }, "assignee": { "displayName": "John Doe" } } } ``` ## Pagination handling The Jira processor automatically handles pagination internally. The processor: 1. Makes the initial request with `startAt=0`. 2. Checks if more results are available. 3. Automatically fetches subsequent pages until all results are retrieved. 4. Outputs each issue as an individual message. You don’t need to handle pagination manually. ## Create and update Jira issues The Jira processor is read-only and only supports querying. To create or update Jira issues, use the [`http` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/http/) with the Jira REST API. ### Create a Jira issue ```yaml input: generate: count: 1 mapping: | root.fields = { "project": {"key": "MYPROJECT"}, "summary": "Issue created from Redpanda Connect", "description": { "type": "doc", "version": 1, "content": [{"type": "paragraph", "content": [{"type": "text", "text": "Created via API"}]}] }, "issuetype": {"name": "Task"} } pipeline: processors: - http: url: "${secrets.JIRA_BASE_URL}/rest/api/3/issue" verb: POST headers: Content-Type: application/json Authorization: "Basic ${secrets.JIRA_AUTH_TOKEN}" output: stdout: {} ``` ## See also - [Jira processor reference](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/jira/) - [Jira REST API documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/) - [JQL query guide](https://www.atlassian.com/software/jira/guides/jql) --- # Page 298: Joining Streams **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/joining_streams.md --- # Joining Streams This cookbook demonstrates how to merge JSON events from parallel streams using content based rules and a [cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/) of your choice. The imaginary problem we are going to solve is hydrating a feed of article comments with information from their parent articles. We will be consuming and writing to Kafka, but the example works with any [input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/about/) and [output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/about/) combination. Articles are received over the topic `articles` and look like this: ```json { "type": "article", "article": { "id": "123foo", "title": "Good article", "content": "this is a totally good article" }, "user": { "id": "user1" } } ``` Comments can either be posted on an article or a parent comment, are received over the topic `comments`, and look like this: ```json { "type": "comment", "comment": { "id": "456bar", "parent_id": "123foo", "content": "this article is bad" }, "user": { "id": "user2" } } ``` Our goal is to end up with a single stream of comments, where information about the root article of the comment is attached to the event. The above comment should exit our pipeline looking like this: ```json { "type": "comment", "comment": { "id": "456bar", "parent_id": "123foo", "content": "this article is bad" }, "article": { "title": "Good article", "content": "this is a totally good article" }, "user": { "id": "user2" } } ``` In order to achieve this we will need to cache articles as they pass through our pipelines and then retrieve them for each comment passing through. Since the parent of a comment might be another comment we will also need to cache and retrieve comments in the same way. ## Caching articles Our first pipeline is very simple, we just consume articles, reduce them to only the fields we wish to cache, and then cache them. If we receive the same article multiple times we’re going to assume it’s okay to overwrite the old article in the cache. In this example I’m targeting Redis, but you can choose any of the supported [cache targets](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/about/). The TTL of cached articles is set to one week. ```yaml input: kafka: addresses: [ TODO ] topics: [ articles ] consumer_group: benthos_articles_group pipeline: processors: # Reduce document into only fields we wish to cache. - mapping: 'article = article' # Store reduced articles into our cache. - cache: operator: set resource: hydration_cache key: '${!json("article.id")}' value: '${!content()}' # Drop all articles after they are cached. output: drop: {} cache_resources: - label: hydration_cache redis: url: TODO default_ttl: 168h ``` ## Hydrating comments Our second pipeline consumes comments, caches them in case a subsequent comment references them, obtains its parent (article or comment), and attaches the root article to the event before sending it to our output topic `comments_hydrated`. In this config we make use of the [`branch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/) processor as it allows us to reduce documents into smaller maps for caching and gives us greater control over how results are mapped back into the document. ```yaml input: kafka: addresses: [ TODO ] topics: [ comments ] consumer_group: benthos_comments_group pipeline: processors: # Perform both hydration and caching within a for_each block as this ensures # that a given message of a batch is cached before the next message is # hydrated, ensuring that when a message of the batch has a parent within # the same batch hydration can still work. - for_each: # Attempt to obtain parent event from cache (if the ID exists). - branch: request_map: 'root = this.comment.parent_id | deleted()' processors: - cache: operator: get resource: hydration_cache key: '${!content()}' # And if successful copy it into the field `article`. result_map: 'root.article = this.article' # Reduce comment into only fields we wish to cache. - branch: request_map: | root.comment.id = this.comment.id root.article = this.article processors: # Store reduced comment into our cache. - cache: operator: set resource: hydration_cache key: '${!json("comment.id")}' value: '${!content()}' # No `result_map` since we don't need to map into the original message. # Send resulting documents to our hydrated topic. output: kafka: addresses: [ TODO ] topic: comments_hydrated cache_resources: - label: hydration_cache redis: url: TODO default_ttl: 168h ``` This pipeline satisfies our basic needs but errors aren’t handled at all, meaning intermittent cache connectivity problems that span beyond our cache retries will result in failed documents entering our `comments_hydrated` topic. This is also the case if a comment arrives in our pipeline before its parent. There are [many patterns for error handling](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/) to choose from in Redpanda Connect. In this example we’re going to introduce a delayed retry queue as it enables us to reprocess failed documents after a grace period, which is isolated from our main pipeline. ## Adding a retry queue Our retry queue is going to be another topic called `comments_retried`. Since most errors are related to time we will delay retry attempts by storing the current timestamp after a failed request as a metadata field. We will use an input [`broker`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/broker/) so that we can consume both the `comments` and `comments_retry` topics in the same pipeline. Our config (omitting the caching sections for brevity) now looks like this: ```yaml input: broker: inputs: - kafka: addresses: [ TODO ] topics: [ comments ] consumer_group: benthos_comments_group - kafka: addresses: [ TODO ] topics: [ comments_retry ] consumer_group: benthos_comments_group processors: - for_each: # Calculate time until next retry attempt and sleep for that duration. # This sleep blocks the topic 'comments_retry' but NOT 'comments', # because both topics are consumed independently and these processors # only apply to the 'comments_retry' input. - sleep: duration: '${! 3600 - ( timestamp_unix() - meta("last_attempted").number() ) }s' pipeline: processors: - try: - for_each: # Attempt to obtain parent event from cache. - branch: {} # Omitted # Reduce document into only fields we wish to cache. - branch: {} # Omitted # If we've reached this point then both processors succeeded. - mapping: 'meta output_topic = "comments_hydrated"' - catch: # If we reach here then a processing stage failed. - mapping: | meta output_topic = "comments_retry" meta last_attempted = timestamp_unix() # Send resulting documents either to our hydrated topic or the retry topic. output: kafka: addresses: [ TODO ] topic: '${!meta("output_topic")}' cache_resources: - label: hydration_cache redis: url: TODO default_ttl: 168h ``` You can find a full example [in the project repo](https://github.com/redpanda-data/connect/blob/master/config/examples/joining_streams.yaml), and with this config we can deploy as many instances of Redpanda Connect as we need as the partitions will be balanced across the consumers. --- # Page 299: Retrieval-Augmented Generation (RAG) **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/rag.md --- # Retrieval-Augmented Generation (RAG) This cookbook shows you how to create a vector embeddings indexing pipeline for Retrieval-Augmented Generation (RAG), using PostgreSQL and [PGVector](https://github.com/pgvector/pgvector). Follow the cookbook to: - Take textual data from a Redpanda topic and compute vector embeddings for it using [Ollama](https://ollama.ai) - Write the pipeline output into a PostgreSQL table with a [PGVector](https://github.com/pgvector/pgvector) index on the embeddings column. ## Compute the embeddings Start by creating a Redpanda topic, which you can use as an input for an indexing data pipeline. ```bash rpk topic create articles echo '{ "type": "article", "article": { "id": "123foo", "title": "Dogs Stop Barking", "content": "The world was shocked this morning to find that all dogs have stopped barking." } }' | rpk topic produce articles -f '%v' ``` Your indexing pipeline can read from the Redpanda topic, using the [`kafka`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/kafka/) input: ```yaml input: kafka: addresses: [ "TODO" ] topics: [ articles ] consumer_group: rp_connect_articles_group tls: enabled: true sasl: mechanism: SCRAM-SHA-256 user: "TODO" password: "TODO" ``` Use [Nomic Embed](https://ollama.com/library/nomic-embed-text) to compute embeddings. Since each request only applies to a single document, you can scale this by making requests in parallel across document batches. To send a mapped request and map the response back into the original document, use the [`branch` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/branch/) with a child [`ollama_embeddings`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/ollama_embeddings/) processor. ```yaml pipeline: threads: -1 processors: - branch: request_map: 'root = "search_document: %s\n%s".format(this.article.title, this.article.content)' processors: - ollama_embeddings: model: nomic-embed-text result_map: 'root.article.embeddings = this' ``` With this pipeline, your processed documents should look something like this: ```yaml { "type": "article", "article": { "id": "123foo", "title": "Dogs Stop Barking", "content": "The world was shocked this morning to find that all dogs have stopped barking.", "embeddings": [0.754, 0.19283, 0.231, 0.834], # This vector will actually have 768 dimensions } } ``` Now, try sending this transformed data to PostgreSQL using the [`sql_insert`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/sql_insert/) output. You can take advantage of the `init_statement` functionality to set up `pgvector` and a table to write the data to. ```yaml output: sql_insert: driver: postgres dsn: "TODO" init_statement: | CREATE EXTENSION IF NOT EXISTS vector; CREATE TABLE IF NOT EXISTS searchable_text ( id varchar(128) PRIMARY KEY, title text NOT NULL, body text NOT NULL, embeddings vector(768) NOT NULL ); CREATE INDEX IF NOT EXISTS text_hnsw_index ON searchable_text USING hnsw (embeddings vector_l2_ops); table: searchable_text columns: ["id", "title", "body", "embeddings"] args_mapping: "[this.article.id, this.article.title, this.article.content, this.article.embeddings.vector()]" ``` After deploying this pipeline using the Redpanda Console, you can verify data is being written into PostgreSQL using `psql` to execute `SELECT count(*) FROM searchable_text;`. --- # Page 300: Redpanda Migrator **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/redpanda_migrator.md --- # Redpanda Migrator With Redpanda Migrator, you can move your workloads from any Apache Kafka system to Redpanda using a single command. It lets you migrate Kafka messages, schemas, and ACLs quickly and efficiently. Redpanda Migrator is Redpanda’s alternative to Kafka MirrorMaker 2 for continuous replication into Redpanda, including timestamp-based consumer group offset translation. Redpanda Connect’s Redpanda Migrator uses the unified migrator components (available in Redpanda Connect 4.67.5+): - [`redpanda_migrator` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda_migrator/) connects to the source Kafka cluster and Schema Registry. - [`redpanda_migrator` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda_migrator/) handles all migration logic including topic creation, schema synchronization, and consumer group offset translation. > 📝 **NOTE** > > If you’re currently using the legacy `redpanda_migrator_bundle` components, see [Migrate to the Unified Redpanda Migrator](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/migrate-unified-redpanda-migrator/) for migration instructions. ## Create a Kafka cluster and a Redpanda Cloud cluster First, you need to provision two clusters, a Kafka one called `source` and a Redpanda Cloud one called `destination`. This cookbook uses the following sample connection details throughout the rest of this cookbook: Source ``` broker: source.cloud.kafka.com:9092 schema registry: https://schema-registry-source.cloud.kafka.com:30081 username: kafka password: testpass ``` Destination ``` broker: destination.cloud.redpanda.com:9092 schema registry: https://schema-registry-destination.cloud.redpanda.com:30081 username: redpanda password: testpass ``` Then you create two topics in the `source` Kafka cluster, `foo` and `bar`, and an ACL for each topic: ```bash cat > ./config.properties < 📝 **NOTE** > > The Brave browser does not fully support code snippets. `generate_data.yaml` ```yaml http: enabled: false input: sequence: inputs: - generate: mapping: | let msg = counter() root.data = $msg meta kafka_topic = match $msg % 2 { 0 => "foo" 1 => "bar" } interval: 1s count: 0 batch_size: 1 processors: - schema_registry_encode: url: "https://schema-registry-source.cloud.kafka.com:30081" subject: ${! metadata("kafka_topic") } avro_raw_json: true basic_auth: enabled: true username: kafka password: testpass output: kafka_franz: seed_brokers: [ "source.cloud.kafka.com:9092" ] topic: ${! @kafka_topic } partitioner: manual partition: ${! random_int(min:0, max:1) } tls: enabled: true sasl: - mechanism: SCRAM-SHA-256 username: kafka password: testpass ``` > 📝 **NOTE** > > The Brave browser does not fully support code snippets. 5. Click **Create**. Your pipeline details are displayed and the pipeline state changes from **Starting** to **Running**, which may take a few minutes. If you don’t see this state change, refresh your page. Next, add a Redpanda Connect consumer, which reads messages from the `source` cluster topics, and leave it running. This consumer uses the `foobar` consumer group, which is reused in a later step when consuming from the `destination` cluster. 1. Go to the **Connect** page on your cluster and click **Create pipeline**. 2. In **Pipeline name**, enter a name and add a short description. 3. For **Compute units**, leave the default value of **1**. 4. For **Configuration**, paste the following configuration. `read_data_source.yaml` ```yaml http: enabled: false input: kafka_franz: seed_brokers: [ "source.cloud.kafka.com:9092" ] topics: - '^[^_]' # Skip topics which start with `_` regexp_topics: true consumer_group: foobar tls: enabled: true sasl: - mechanism: SCRAM-SHA-256 username: kafka password: testpass processors: - schema_registry_decode: url: "https://schema-registry-source.cloud.kafka.com:30081" avro_raw_json: true basic_auth: enabled: true username: kafka password: testpass output: stdout: {} processors: - mapping: | root = this.merge({"count": counter(), "topic": @kafka_topic, "partition": @kafka_partition}) ``` > 📝 **NOTE** > > The Brave browser does not fully support code snippets. 5. Click **Create**. Your pipeline details are displayed and the pipeline state changes from **Starting** to **Running**, which may take a few minutes. If you don’t see this state change, refresh your page. At this point, the `source` cluster has some data in both `foo` and `bar` topics, and the consumer prints the messages it reads from these topics to `stdout`. ## Required permissions This cookbook authenticates as a superuser for simplicity. In production, when the source and destination clusters enforce authorization (ACLs), a basic consumer or producer ACL is not sufficient for Redpanda Migrator. The migrator authenticates to the source cluster with the credentials in the `redpanda_migrator` input, and to the destination cluster with the credentials in the `redpanda_migrator` output, so grant ACLs to each principal as follows. > ❗ **IMPORTANT** > > To recreate each topic on the destination with matching settings, Redpanda Migrator reads the source topic’s configuration with a `DescribeConfigs` request, which requires the `DESCRIBE_CONFIGS` operation on the topic. > > A consumer ACL (`READ`) implicitly grants `DESCRIBE`, but it does **not** grant `DESCRIBE_CONFIGS`. If the source principal has only `READ`, the migrator consumes messages successfully but fails to create topics, logging an error such as: > > ```text > level=error msg="Failed to send message to redpanda_migrator: creating records: sync topics: > create topic : get topic details : TOPIC_AUTHORIZATION_FAILED: > Not authorized to access topics: [Topic authorization failed.]" > ``` > > Despite the `create topic` wording, this failure is the `DescribeConfigs` read against the **source** cluster, not the topic creation on the destination. ### Source cluster Grant the source principal (the `redpanda_migrator` input credentials) these ACLs: | Resource | Operations | Purpose | | --- | --- | --- | | Topic (migrated topics) | `READ`, `DESCRIBE_CONFIGS` | Consume records (`READ`, which also grants `DESCRIBE` for metadata and offsets) and read topic configurations to replicate them (`DESCRIBE_CONFIGS`). | | Group (the input’s `consumer_group`) | `READ` | Join the migrator’s own consumer group and track progress. | | Group (migrated groups) | `DESCRIBE` | Read source consumer group offsets. Required when consumer group migration is enabled (`consumer_groups.enabled`, the default). | | Cluster | `DESCRIBE` | List source consumer groups. Also required to read source ACLs when `sync_topic_acls` is enabled on the output. | For example, to grant the least-privilege source ACLs to `User:migrator` with `rpk`: ```bash # Consume records and read topic configs (READ also grants DESCRIBE; DESCRIBE_CONFIGS does not come with READ) rpk security acl create --allow-principal User:migrator \ --operation read,describe_configs \ --topic # READ on the migrator's own consumer group rpk security acl create --allow-principal User:migrator \ --operation read \ --group # DESCRIBE on the groups being migrated (omit if consumer_groups.enabled is false) rpk security acl create --allow-principal User:migrator \ --operation describe \ --group # List consumer groups (and describe ACLs if sync_topic_acls is enabled) rpk security acl create --allow-principal User:migrator \ --operation describe \ --cluster ``` ### Destination cluster Grant the destination principal (the `redpanda_migrator` output credentials) these ACLs: | Resource | Operations | Purpose | | --- | --- | --- | | Topic (migrated topics) | `CREATE`, `WRITE`, `ALTER`, `DESCRIBE_CONFIGS`, `READ` | Create topics (`CREATE` and `DESCRIBE_CONFIGS`), produce records (`WRITE`), and add partitions (`ALTER`). These operations also grant `DESCRIBE`. `READ` translates and commits consumer group offsets. Omit it if `consumer_groups.enabled` is `false`. | | Cluster | `CREATE` | Allow creating destination topics whose names are not known in advance. Use instead of per-topic `CREATE`. | | Group (migrated groups) | `READ` | Commit translated consumer group offsets. Required when consumer group migration is enabled (`consumer_groups.enabled`, the default). | | Cluster | `ALTER` | Create migrated ACLs on the destination. Required only when `sync_topic_acls` is enabled. | > 💡 **TIP** > > Run `rpk security acl --help-operations` to see which ACL operation each Kafka request requires. ## Configure and start Redpanda Migrator The unified Redpanda Migrator does the following: - The `redpanda_migrator` input connects to the source Kafka cluster and Schema Registry to consume messages and schema information. - The `redpanda_migrator` output handles all migration logic: - Schema migration: reads schemas from the source Schema Registry and synchronizes them to the destination. - Topic creation: automatically creates destination topics that don’t exist with proper configurations. - ACL migration: migrates access control lists according to the migration rules. - Message streaming: processes and routes messages from source to destination topics. - Consumer group offset translation: maps source consumer group offsets to equivalent destination positions. - If new topics are created in the source cluster while the migrator is running, they are migrated when messages are written to them. ACL migration for topics adheres to the following principles: - `ALLOW WRITE` ACLs for topics are not migrated - `ALLOW ALL` ACLs for topics are downgraded to `ALLOW READ` - Group ACLs are not migrated > 📝 **NOTE** > > Changing topic configurations, such as partition count, isn’t currently supported. Now, use the following unified Redpanda Migrator configuration. See the [`redpanda_migrator` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda_migrator/) and [`redpanda_migrator` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda_migrator/) docs for details. 1. Go to the **Connect** page on your cluster and click **Create pipeline**. 2. In **Pipeline name**, enter a name and add a short description. 3. For **Compute units**, leave the default value of **1**. 4. For **Configuration**, paste the following configuration. `redpanda_migrator.yaml` ```yaml input: redpanda_migrator: # Source Kafka settings seed_brokers: [ "source.cloud.kafka.com:9092" ] topics: - '^[^_]' # Skip internal topics which start with `_` regexp_topics: true consumer_group: migrator tls: enabled: true sasl: - mechanism: SCRAM-SHA-256 username: kafka password: testpass # Source Schema Registry settings schema_registry: url: "https://schema-registry-source.cloud.kafka.com:30081" basic_auth: enabled: true username: kafka password: testpass output: redpanda_migrator: # Destination Redpanda settings seed_brokers: [ "destination.cloud.redpanda.com:9092" ] tls: enabled: true sasl: - mechanism: SCRAM-SHA-256 username: redpanda password: testpass sync_topic_acls: true # Destination Schema Registry and migration settings schema_registry: url: https://schema-registry-destination.cloud.redpanda.com:30081 include_deleted: true translate_ids: true basic_auth: enabled: true username: redpanda password: testpass # Consumer group migration settings consumer_groups: enabled: true interval: 30s serverless: false (1) ``` 1. Enable this flag when migrating to Redpanda Serverless. It automatically limits configuration to features supported by Serverless clusters. If you’re migrating to a BYOC cluster, you can omit this field. 1. Click **Create**. Your pipeline details are displayed and the pipeline state changes from **Starting** to **Running**, which may take a few minutes. If you don’t see this state change, refresh your page. ## Check the status of migrated topics You can use the Redpanda [`rpk` CLI tool](https://docs.redpanda.com/streaming/current/get-started/rpk/) to check which topics and ACLs have been migrated to the `destination` cluster. You can quickly [install `rpk`](https://docs.redpanda.com/streaming/current/get-started/rpk-install/) if you don’t already have it. > 📝 **NOTE** > > For now, users require manual migration. However, this step is not required for the current demo. Similarly, roles are specific to Redpanda and, for now, also require manual migration if the `source` cluster is based on Redpanda. ```bash rpk -X brokers=destination.cloud.redpanda.com:9092 -X tls.enabled=true -X sasl.mechanism=SCRAM-SHA-256 -X user=redpanda -X pass=testpass topic list NAME PARTITIONS REPLICAS _schemas 1 1 bar 2 1 foo 2 1 rpk -X brokers=destination.cloud.redpanda.com:9092 -X tls.enabled=true -X sasl.mechanism=SCRAM-SHA-256 -X user=redpanda -X pass=testpass security acl list PRINCIPAL HOST RESOURCE-TYPE RESOURCE-NAME RESOURCE-PATTERN-TYPE OPERATION PERMISSION ERROR User:redpanda * TOPIC bar LITERAL READ DENY User:redpanda * TOPIC foo LITERAL READ ALLOW ``` ## Check metrics to monitor progress Redpanda Connect provides a comprehensive suite of metrics in various formats, such as Prometheus, which you can use to monitor its performance in your observability stack. Besides the [standard Redpanda Connect metrics](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/about/#metric-names), the `redpanda_migrator` input also emits a `redpanda_lag` metric for monitoring the migration progress of each topic and partition. To monitor the migration progress, use the Redpanda Cloud OpenMetrics endpoint, which exposes all Redpanda and connector metrics for your cluster. You can integrate this endpoint with Prometheus, Datadog, or other observability platforms. For step-by-step instructions on configuring monitoring and connecting your observability tool, see [Monitor Redpanda Cloud](https://docs.redpanda.com/cloud-data-platform/manage/monitor-cloud/). After ingesting the metrics, search for the `redpanda_lag` metric in your monitoring tool and filter by `topic` and `partition` as needed to track migration lag for each topic and partition. ## Read from the migrated topics Stop the `read_data_source.yaml` consumer you started earlier and, afterwards, start a similar consumer for the `destination` cluster. Before starting the consumer up on the `destination` cluster, make sure you give Redpanda Migrator time to replicate the translated offset (the `consumer_groups.interval` setting, 30 seconds in this example). 1. On the **Connect** page, stop the `read_data_source` pipeline you created earlier. 2. Go to the **Connect** page on your cluster and click **Create pipeline**. 3. In **Pipeline name**, enter a name and add a short description. 4. For **Compute units**, leave the default value of **1**. 5. For **Configuration**, paste the following configuration. `read_data_destination.yaml` ```yaml http: enabled: false input: kafka_franz: seed_brokers: [ "destination.cloud.redpanda.com:9092" ] topics: - '^[^_]' # Skip topics which start with `_` regexp_topics: true consumer_group: foobar sasl: - mechanism: SCRAM-SHA-256 username: redpanda password: testpass processors: - schema_registry_decode: url: "https://schema-registry-destination.cloud.redpanda.com:30081" avro_raw_json: true basic_auth: enabled: true username: redpanda password: testpass output: stdout: {} processors: - mapping: | root = this.merge({"count": counter(), "topic": @kafka_topic, "partition": @kafka_partition}) ``` > 📝 **NOTE** > > The Brave browser does not fully support code snippets. 6. Click **Create**. Your pipeline details are displayed and the pipeline state changes from **Starting** to **Running**, which may take a few minutes. If you don’t see this state change, refresh your page. The `source` cluster consumer uses the same `foobar` consumer group. This consumer resumes reading messages from where the `source` consumer left off. Redpanda Migrator remaps consumer group offsets when it migrates them to the `destination` cluster, because records get new offsets there. For each committed offset, it reads the timestamp of the last record the group consumed on the `source` cluster and queries the `destination` cluster for the first offset at or after that timestamp. When the group has no active members on the `source` cluster, Redpanda Migrator then refines the result to the exact record, using the `redpanda-migrator-offset` header that it adds to each migrated record. Redpanda Migrator writes the result as the `destination` consumer group offset for the corresponding topic and partition pair. Timestamps have millisecond precision, so when a group is still active and several records share a timestamp, the translated offset can point at a different record with the same timestamp. Stop the consumers on the `source` cluster before you move them, so that the exact refinement applies. --- # Page 301: Ingest data into Snowflake **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/snowflake_ingestion.md --- # Ingest data into Snowflake Configure a Redpanda Connect pipeline to generate and write data into a Redpanda Serverless topic, and then ingest that data into [Snowflake](https://www.snowflake.com/en/) using [Snowpipe Streaming](https://docs.snowflake.com/en/user-guide/data-load-snowpipe-streaming-overview). ## Prerequisites - A [Redpanda Cloud account](https://cloud.redpanda.com/sign-up) - [`rpk` installed](https://docs.redpanda.com/streaming/current/get-started/rpk-install/) and [signed into your Cloud account](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cloud/rpk-cloud-login/) - A [Snowflake account](https://trial.snowflake.com/) - `openssl` command-line tool ## Set up your Redpanda cluster In [Redpanda Cloud](https://cloud.redpanda.com/), create a new Serverless Standard cluster. When the cluster is ready, run `rpk cloud cluster select` to select the cluster and set it to be your current [rpk profile](https://docs.redpanda.com/streaming/current/get-started/config-rpk-profile/). Next, create a `demo_topic` to use as the data source for ingesting data into Snowflake: ```bash rpk topic create demo_topic ``` Create a user with minimal [ACLs](https://docs.redpanda.com/streaming/current/manage/security/authorization/acl/) to run the ingestion pipeline into Snowflake: ```bash rpk security user create ingestion_user --password Testing1234 ``` Now that the user exists, give them read permissions to `demo_topic`, as well as full control over any consumer group with the prefix `redpanda_connect`: ```bash rpk security acl create --allow-principal ingestion_user --operation read --topic demo_topic rpk security acl create --allow-principal ingestion_user --resource-pattern-type prefixed --operation all --group redpanda_connect ``` ## Set up your Snowflake account Log in to your Snowflake account with a user who has the ACCOUNTADMIN role. Then, run the following SQL commands in a worksheet. They set up another user with minimal permissions to write data into a specified database and schema, ready for streaming data to Snowflake. ```sql -- Set default values for multiple variables SET PWD = 'Test1234567'; SET USER = 'STREAMING_USER'; SET DB = 'STREAMING_DB'; SET ROLE = 'REDPANDA_CONNECT'; SET WH = 'STREAMING_WH'; USE ROLE ACCOUNTADMIN; -- Create users CREATE USER IF NOT EXISTS IDENTIFIER($USER) PASSWORD=$PWD COMMENT='STREAMING USER FOR REDPANDA CONNECT'; -- Create roles CREATE OR REPLACE ROLE IDENTIFIER($ROLE); -- Create the destination database and virtual warehouse CREATE DATABASE IF NOT EXISTS IDENTIFIER($DB); USE IDENTIFIER($DB); CREATE OR REPLACE WAREHOUSE IDENTIFIER($WH) WITH WAREHOUSE_SIZE = 'SMALL'; -- Grant privileges GRANT CREATE WAREHOUSE ON ACCOUNT TO ROLE IDENTIFIER($ROLE); GRANT ROLE IDENTIFIER($ROLE) TO USER IDENTIFIER($USER); GRANT OWNERSHIP ON DATABASE IDENTIFIER($DB) TO ROLE IDENTIFIER($ROLE); GRANT USAGE ON WAREHOUSE IDENTIFIER($WH) TO ROLE IDENTIFIER($ROLE); -- Set defaults ALTER USER IDENTIFIER($USER) SET DEFAULT_ROLE=$ROLE; ALTER USER IDENTIFIER($USER) SET DEFAULT_WAREHOUSE=$WH; -- Run the following commands to find your account identifier. Copy it down for later use. -- It will be something like `organization_name-account_name` -- e.g. ykmxgak-wyb52636 WITH HOSTLIST AS (SELECT * FROM TABLE(FLATTEN(INPUT => PARSE_JSON(SYSTEM$allowlist())))) SELECT REPLACE(VALUE:host,'.snowflakecomputing.com','') AS ACCOUNT_IDENTIFIER FROM HOSTLIST WHERE VALUE:type = 'SNOWFLAKE_DEPLOYMENT_REGIONLESS'; ``` ### Create an RSA key pair Create an [RSA key pair](https://docs.snowflake.com/en/user-guide/key-pair-auth) using `openssl` to authenticate Redpanda Connect to Snowflake. When you’re prompted to give an encryption password, record it for later. ```bash openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -passout pass:Testing123 -out rsa_key.p8 ``` Create a public key. You’re prompted to enter your encryption password. ```bash openssl rsa -in rsa_key.p8 -pubout -passout pass:Testing123 -out rsa_key.pub ``` To register the public key in Snowflake, remove the public key delimiters and output only the base64-encoded portion of the PEM file. Run the following bash command to print it: ```bash cat rsa_key.pub | sed -e '1d' -e '$d' | tr -d '\n' ``` In the Snowflake worksheet, add the output of the bash command you just ran to the following SQL command and execute it: ```sql use role accountadmin; alter user streaming_user set rsa_public_key='< PubKeyWithoutDelimiters >'; ``` ### Create a schema using `streaming_user` Log out of Snowflake and sign back in as the default user (`streaming_user`) with the associated password (default: `Test1234567`). You created these credentials in [Set up your Snowflake account](#set-up-your-snowflake-account). Run the following SQL commands in a worksheet to create a schema (e.g. `STREAMING_SCHEMA`) in the default database (e.g. `STREAMING_DB`): ```sql SET DB = 'STREAMING_DB'; SET SCHEMA = 'STREAMING_SCHEMA'; USE IDENTIFIER($DB); CREATE OR REPLACE SCHEMA IDENTIFIER($SCHEMA); ``` ## Create a pipeline from your Redpanda cluster to Snowflake You can now create the pipeline. First create [secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) for the passwords and keys you created during setup. On your Serverless cluster, go to the **Connect** page, select the **Secrets** tab and then create three secrets: - `REDPANDA_PASS` with the value `Testing1234` - `SNOWFLAKE_KEY` with the output value of `awk '{printf "%s\\n", $0}' rsa_key.p8` - `SNOWFLAKE_KEY_PASS` with the value `Testing123` Select the **Pipelines** tab and create a pipeline called **RedpandaToSnowflake**. Use the following YAML configuration: ```yaml input: # Reads data from our `demo_topic` kafka_franz: seed_brokers: ["${REDPANDA_BROKERS}"] topics: ["demo_topic"] consumer_group: "redpanda_connect_to_snowflake" tls: {enabled: true} checkpoint_limit: 4096 sasl: - mechanism: SCRAM-SHA-256 username: ingestion_user password: ${secrets.REDPANDA_PASS} # Define the batching policy. This cookbook creates small batches, # but in a production environment use the largest file size you can. batching: count: 100 # Collect 10 messages before flushing period: 10s # or after 10 seconds, whichever comes first output: snowflake_streaming: # Replace this placeholder with your account identifier account: "< OrgName-AccountName >" user: STREAMING_USER role: REDPANDA_CONNECT database: STREAMING_DB schema: STREAMING_SCHEMA table: STREAMING_DATA # Inject your private key and password private_key_file: "${secrets.SNOWFLAKE_KEY}" private_key_pass: "${secrets.SNOWFLAKE_KEY_PASS}" schema_evolution: enabled: true max_in_flight: 1 ``` You now can produce some data using `rpk` to test that everything works: ```bash echo '{"animal":"redpanda","attributes":"cute","age":6}' | rpk topic produce demo_topic -f '%v\n' echo '{"animal":"polar bear","attributes":"cool","age":13}' | rpk topic produce demo_topic -f '%v\n' echo '{"animal":"unicorn","attributes":"rare","age":999}' | rpk topic produce demo_topic -f '%v\n' ``` The data produced into the `demo_topic` is consumed and streamed into Snowflake in seconds. Go back to the Snowflake worksheet and run the following query to see data arrive in Snowflake with the schema from the JSON data you produced. ```sql SELECT * FROM STREAMING_DB.STREAMING_SCHEMA.STREAMING_DATA LIMIT 50; ``` See also: - The [`kafka_franz` input](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/kafka_franz/) - The [`snowflake_streaming`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/snowflake_streaming/) output --- # Page 302: Guides **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/guides.md --- # Guides - [Bloblang](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/) Learn what Bloblang is and how to use the native mapping language. - Cloud Credentials - [Amazon Web Services](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws/) Find out about AWS components in Redpanda Connect. - [Google Cloud Platform](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/gcp/) Find out about GCP components in Redpanda Connect. - [Ingest Real-Time Sensor Telemetry with the HTTP Gateway](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/gateway/) Learn how to stream sensor telemetry data into Redpanda Cloud using the gateway input in Redpanda Connect. - [Synchronous Responses](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/sync_responses/) Understand synchronous response handling in Redpanda Connect, ensuring reliable and efficient data processing. - [Migrate to the Unified Redpanda Migrator](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/migrate-unified-redpanda-migrator/) Learn how to migrate from legacy migrator components to the unified `redpanda_migrator` input/output pair in Redpanda Connect 4.67.5+. --- # Page 303: Migrate from gcp_bigquery to gcp_bigquery_write_api for CDC **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bigquery_cdc_migration.md --- # Migrate from `gcp_bigquery` to `gcp_bigquery_write_api` for CDC The `gcp_bigquery_write_api` output supports BigQuery’s Change Data Capture (CDC) ingestion via the Storage Write API. Compared to the load-jobs based `gcp_bigquery` output, the Storage Write API delivers: - Seconds-scale ingest latency instead of minutes (no batch-and-load cycle). - Per-row UPSERT and DELETE operations without writing intermediate files. - Sequence-number-based out-of-order resolution via `_CHANGE_SEQUENCE_NUMBER`. ## Config translation ```yaml # BEFORE: load-jobs based output output: gcp_bigquery: project: my-project dataset: my_dataset table: events format: NEWLINE_DELIMITED_JSON batching: count: 10000 period: 30s # AFTER: Storage Write API CDC mode output: gcp_bigquery_write_api: project: my-project dataset: my_dataset table: events write_mode: upsert_delete change_type: ${! metadata("operation") } change_sequence_number: ${! metadata("scn") } primary_keys: [id] batching: count: 500 period: 1s ``` The `change_type` expression must resolve to `UPSERT` or `DELETE` per message (case-insensitive). `change_sequence_number` is optional but recommended for any pipeline where out-of-order delivery is possible. ## Schema requirements The destination table must have a `PRIMARY KEY` declared. To add one to an existing table: ```sql ALTER TABLE my_dataset.events ADD PRIMARY KEY (id) NOT ENFORCED; ``` For new tables, use the `auto_create_table` option with `primary_keys`: ```yaml auto_create_table: true schema: - { name: id, type: STRING, mode: REQUIRED } - { name: payload, type: JSON } primary_keys: [id] ``` > 📝 **NOTE** > > Composite primary keys are supported with up to 16 columns. The column order in `primary_keys` is significant for composite keys. > ⚠️ **WARNING** > > `primary_keys` does not add a `PRIMARY KEY` to a pre-existing table. It only applies when `auto_create_table` creates the table. For an existing table without one, run `ALTER TABLE … ADD PRIMARY KEY (…) NOT ENFORCED` first. When `primary_keys` is set and the table already declares a `PRIMARY KEY`, the two must match exactly (same columns, same order). ## Snapshot vs streaming BigQuery’s CDC contract does not permit mixing INSERT (unspecified `_CHANGE_TYPE`) and UPSERT/DELETE rows in the same write. For initial backfills, recommendations are: 1. **UPSERT for everything.** The simplest path: write snapshot rows with `change_type: UPSERT` like any other CDC row. Idempotent; tolerates retries; pays the per-PK merge cost on every snapshot row. Suitable for tables up to ~10M rows. 2. **Separate snapshot pipeline.** Land snapshot rows via a second `gcp_bigquery_write_api` instance with `write_mode: default_stream` into a separate staging table, then `CREATE TABLE … AS SELECT` into the CDC-active table once the snapshot completes. Avoids the merge cost on the snapshot but adds operational complexity. ## Operational differences > ⚠️ **WARNING** > > Tables with active CDC do not support DML statements (`DELETE`, `UPDATE`, `MERGE`). If your existing pipeline relies on post-load DML for cleanup, that pattern will no longer work. Move cleanup to BigQuery scheduled queries against a non-CDC table or pre-process rows in the connector. - BigQuery does not enforce primary-key uniqueness; the producer is responsible. - DELETEs are retained for a two-day window for point-in-time recovery before being permanently dropped. - The `_CHANGE_TYPE` and `_CHANGE_SEQUENCE_NUMBER` pseudo-columns are injected by the connector; do not declare them in `schema`. - CDC ingestion requires the default write stream. The `write_mode: pending_stream` exactly-once mode is not compatible with CDC and is rejected at config parse time. ## Related - [`gcp_bigquery_write_api` output reference](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/gcp_bigquery_write_api/) - [BigQuery CDC documentation](https://cloud.google.com/bigquery/docs/change-data-capture) --- # Page 304: Bloblang **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about.md --- # Bloblang Bloblang, or blobl for short, is a language designed for mapping data of a wide variety of forms. It’s a safe, fast, and powerful way to perform document mapping within Redpanda Connect. It also has a [Go API for writing your own functions and methods](https://pkg.go.dev/github.com/redpanda-data/connect/v4/public/bloblang) as plugins. Bloblang is available as a [processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/mapping/) and it’s also possible to use blobl queries in [function interpolations](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/#bloblang-queries). This document outlines the core features of the Bloblang language, but if you’re totally new to Bloblang then it’s worth following [the walkthrough first](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/walkthrough/). ## Learn Bloblang [learnbloblang.com](https://www.learnbloblang.com) is an interactive resource for learning Bloblang with hands-on exercises. ## Assignment A Bloblang mapping expresses how to create a new document by extracting data from an existing input document. Assignments consist of a dot separated path segments on the left-hand side describing a field to be created within the new document, and a right-hand side query describing what the content of the new field should be. The keyword `root` on the left-hand side refers to the root of the new document, the keyword `this` on the right-hand side refers to the current context of the query, which is the read-only input document when querying from the root of a mapping: ```bloblang root.id = this.thing.id root.type = "yo" # Both `root` and `this` are optional, and will be inferred in their absence. content = thing.doc.message # In: {"thing":{"id":"wat1","doc":{"title":"wut","message":"hello world"}}} ``` Since the document being created starts off empty it is sometimes useful to begin a mapping by copying the entire contents of the input document, which can be expressed by assigning `this` to `root`. ```bloblang root = this root.foo = "added value" # In: {"id":"wat1","message":"hello world"} ``` If the new document `root` is never assigned to or otherwise mutated then the original document remains unchanged. ### Special characters in paths Quotes can be used to describe sections of a field path that contain whitespace, dots or other special characters: ```bloblang # Use quotes around a path segment in order to include whitespace or dots within # the path root."foo.bar".baz = this."buz bev".fub # In: {"buz bev":{"fub":"hello world"}} ``` ### Non-structured data Bloblang is able to map data that is unstructured, whether it’s a log line or a binary blob, by referencing it with the [`content` function](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/#content), which returns the raw bytes of the input document: ```bloblang # Parse a base64 encoded JSON document root = content().decode("base64").parse_json() # In: eyJmb28iOiJiYXIifQ== ``` And your newly mapped document can also be unstructured, simply assign a value type to the `root` of your document: ```bloblang root = this.foo # In: {"foo":"hello world"} ``` And the resulting message payload will be the raw value you’ve assigned. ### Deleting It’s possible to selectively delete fields from an object by assigning the function `deleted()` to the field path: ```bloblang root = this root.bar = deleted() # In: {"id":"wat1","message":"hello world","bar":"remove me"} ``` ### Variables Another type of assignment is a `let` statement, which creates a variable that can be referenced elsewhere within a mapping. Variables are discarded at the end of the mapping and are mostly useful for query reuse. Variables are referenced within queries with `$`: ```bloblang # Set a temporary variable let foo = "yo" root.new_doc.type = $foo ``` ### Metadata Redpanda Connect messages contain metadata that is separate from the main payload, in Bloblang you can modify the metadata of the resulting message with the `meta` assignment keyword. Metadata values of the resulting message are referenced within queries with the `@` operator or the [`metadata()` function](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/#metadata): ```bloblang # Reference a metadata value root.new_doc.bar = @kafka_topic # Or `@.kafka_topic` or `metadata("kafka_topic")` # Delete all metadata meta = deleted() # Set metadata values meta bar = "hello world" meta baz = { "something": "structured" } # Get an object of key/values for all metadata root.meta_obj = @ # Or `metadata()` ``` ## Coalesce The pipe operator (`|`) used within brackets allows you to coalesce multiple candidates for a path segment. The first field that exists and has a non-null value will be selected: ```bloblang root.new_doc.type = this.thing.(article | comment | this).type # In: {"thing":{"article":{"type":"foo"}}} # In: {"thing":{"comment":{"type":"bar"}}} # In: {"thing":{"type":"baz"}} ``` Opening brackets on a field begins a query where the context of `this` changes to value of the path it is opened upon, therefore in the above example `this` within the brackets refers to the contents of `this.thing`. ## Literals Bloblang supports number, boolean, string, null, array and object literals: ```bloblang root = [ 7, false, "string", null, { "first": 11, "second": {"foo":"bar"}, "third": """multiple lines on this string""" } ] # In: {} ``` The values within literal arrays and objects can be dynamic query expressions, as well as the keys of object literals. ## Comments You might’ve already spotted, comments are started with a hash (`#`) and end with a line break: ```bloblang root = this.some.value # And now this is a comment ``` ## Boolean logic and arithmetic Bloblang supports a range of boolean operators `!`, `>`, `>=`, `==`, `<`, `<=`, `&&`, `||` and mathematical operators `+`, `-`, `*`, `/`, `%`: ```bloblang root.is_big = this.number > 100 root.multiplied = this.number * 7 # In: {"number":50} # In: {"number":150} ``` For more information about these operators and how they work check out [the arithmetic page](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/arithmetic/). ## Conditional mapping Use `if` as either a statement or an expression in order to perform maps conditionally: ```bloblang root = this root.sorted_foo = if this.foo.type() == "array" { this.foo.sort() } if this.foo.type() == "string" { root.upper_foo = this.foo.uppercase() root.lower_foo = this.foo.lowercase() } # In: {"foo":"FooBar"} # In: {"foo":["foo","bar"]} ``` And add as many `else if` queries as you like, followed by an optional final fallback `else`: ```bloblang root.sound = if this.type == "cat" { this.cat.meow } else if this.type == "dog" { this.dog.woof.uppercase() } else { "sweet sweet silence" } # In: {"type":"cat","cat":{"meow":"meeeeooooow!"}} # In: {"type":"dog","dog":{"woof":"guurrrr woof woof!"}} # In: {"type":"caterpillar","caterpillar":{"name":"oleg"}} ``` ## Pattern matching A `match` expression allows you to perform conditional mappings on a value, each case should be either a boolean expression, a literal value to compare against the target value, or an underscore (`_`) which captures values that have not matched a prior case: ```bloblang root.new_doc = match this.doc { this.type == "article" => this.article this.type == "comment" => this.comment _ => this } # In: {"doc":{"type":"article","article":{"id":"foo","content":"qux"}}} # In: {"doc":{"type":"comment","comment":{"id":"bar","content":"quz"}}} # In: {"doc":{"type":"neither","content":"some other stuff unchanged"}} ``` Within a match block the context of `this` changes to the pattern matched expression, therefore `this` within the match expression above refers to `this.doc`. Match cases can specify a literal value for simple comparison: ```bloblang root = this root.type = match this.type { "doc" => "document", "art" => "article", _ => this } # In: {"type":"doc","foo":"bar"} ``` The match expression can also be left unset which means the context remains unchanged, and the catch-all case can also be omitted: ```bloblang root.new_doc = match { this.doc.type == "article" => this.doc.article this.doc.type == "comment" => this.doc.comment } # In: {"doc":{"type":"neither","content":"some other stuff unchanged"}} ``` If no case matches then the mapping is skipped entirely, hence we would end up with the original document in this case. ## Functions Functions can be placed anywhere and allow you to extract information from your environment, generate values, or access data from the underlying message being mapped: ```bloblang root.doc.id = uuid_v4() root.doc.received_at = now() root.doc.host = hostname() ``` Functions support both named and nameless style arguments: ```bloblang root.values_one = range(start: 0, stop: this.max, step: 2) root.values_two = range(0, this.max, 2) # In: {"max":10} ``` You can find a full list of functions and their parameters in [the functions page](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/). ## Methods Methods are similar to functions but enact upon a target value, these provide most of the power in Bloblang as they allow you to augment query values and can be added to any expression (including other methods): ```bloblang root.doc.id = this.thing.id.string().catch(uuid_v4()) root.doc.reduced_nums = this.thing.nums.map_each(num -> if num < 10 { deleted() } else { num - 10 }) root.has_good_taste = ["pikachu","mewtwo","magmar"].contains(this.user.fav_pokemon) # In: {"thing":{"id":123,"nums":[5,12,8,15,20]},"user":{"fav_pokemon":"pikachu"}} ``` Methods also support both named and nameless style arguments: ```bloblang root.foo_one = this.(bar | baz).trim().replace_all(old: "dog", new: "cat") root.foo_two = this.(bar | baz).trim().replace_all("dog", "cat") # In: {"bar":" I love my dog "} ``` You can find a full list of methods and their parameters in [the methods page](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/). ## Maps Defining named maps allows you to reuse common mappings on values with the [`apply` method](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#apply): ```bloblang map things { root.first = this.thing_one root.second = this.thing_two } root.foo = this.value_one.apply("things") root.bar = this.value_two.apply("things") # In: {"value_one":{"thing_one":"hey","thing_two":"yo"},"value_two":{"thing_one":"sup","thing_two":"waddup"}} ``` Within a map the keyword `root` refers to a newly created document that will replace the target of the map, and `this` refers to the original value of the target. The argument of `apply` is a string, which allows you to dynamically resolve the mapping to apply. ## Import maps It’s possible to import maps defined in a file with an `import` statement: ```bloblang import "./common_maps.blobl" root.foo = this.value_one.apply("things") root.bar = this.value_two.apply("things") # In: {"value_one":{"thing_one":"hey","thing_two":"yo"},"value_two":{"thing_one":"sup","thing_two":"waddup"}} ``` Imports from a Bloblang mapping within a Redpanda Connect config are relative to the process running the config. Imports from an imported file are relative to the file that is importing it. ## Filtering By assigning the root of a mapped document to the `deleted()` function you can delete a message entirely: ```bloblang # Filter all messages that have fewer than 10 URLs. root = if this.doc.urls.length() < 10 { deleted() } # In: {"doc":{"urls":["a","b","c"]}} # In: {"doc":{"urls":["a","b","c","d","e","f","g","h","i","j"]}} ``` ## Error handling Functions and methods can fail under certain circumstances, such as when they receive types they aren’t able to act upon. These failures, when not caught, will cause the entire mapping to fail. However, the [method `catch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#catch) can be used in order to return a value when a failure occurs instead: ```bloblang # Map an empty array to `foo` if the field `bar` is not a string. root.foo = this.bar.split(",").catch([]) # In: {"bar":"a,b,c"} # In: {"bar":123} ``` Since `catch` is a method it can also be attached to bracketed map expressions: ```bloblang # Map `false` if any of the operations in this boolean query fail. root.thing = ( this.foo > this.bar && this.baz.contains("wut") ).catch(false) # In: {"foo":10,"bar":5,"baz":"wut wut"} # In: {"foo":"not a number","bar":5,"baz":"wut wut"} ``` And one of the more powerful features of Bloblang is that a single `catch` method at the end of a chain of methods can recover errors from any method in the chain: ```bloblang # Catch errors caused by: # - foo not existing # - foo not being a string # - an element from split foo not being a valid JSON string root.things = this.foo.split(",").map_each( ele -> ele.parse_json() ).catch([]) # Specifically catch a JSON parse error root.things = this.foo.split(",").map_each( ele -> ele.parse_json().catch({}) ) # In: {"foo":"{\"a\":1},{\"b\":2}"} # In: {"foo":"not valid json"} ``` However, the `catch` method only acts on errors, sometimes it’s also useful to set a fall back value when a query returns `null` in which case the [method `or`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#or) can be used the same way: ```bloblang # Map "default" if either the element index 5 does not exist, or the underlying # element is `null`. root.foo = this.bar.index(5).or("default") # In: {"bar":["a","b","c"]} # In: {"bar":["a","b","c","d","e","f","g"]} ``` ## Unit testing It’s possible to execute unit tests for your Bloblang mappings using the standard Redpanda Connect unit test capabilities outlined [in this document](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/unit_testing/). ## Troubleshooting 1. I’m seeing `unable to reference message as structured (with 'this')` when I try to run mappings with `rpk connect blobl`. That particular error message means the mapping is failing to parse what’s being fed in as a JSON document. Make sure that the data you are feeding in is valid JSON, and also that the documents _do not_ contain line breaks as `rpk connect blobl` will parse each line individually. Why? That’s a good question. Bloblang supports non-JSON formats too, so it can’t delimit documents with a streaming JSON parser like tools such as `jq`, so instead it uses line breaks to determine the boundaries of each message. --- # Page 305: Bloblang Arithmetic **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/arithmetic.md --- # Bloblang Arithmetic Bloblang supports a range of comparison operators `!`, `>`, `>=`, `==`, `<`, `<=`, `&&`, `||` and mathematical operators `+`, `-`, `*`, `/`, `%`. How these operators behave is dependent on the type of the values they’re used with, and therefore it’s worth fully understanding these behaviors if you intend to use them heavily in your mappings. ## Mathematical All mathematical operators (`+`, `-`, `*`, `/`, `%`) are valid against number values, and addition (`+`) is also supported when both the left and right hand side arguments are strings. If a mathematical operator is used with an argument that is non-numeric (with the aforementioned string exception) then a [recoverable mapping error will be thrown](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/#error-handling). ### Number degradation In Bloblang any number resulting from a method, function or arithmetic is either a 64-bit signed integer or a 64-bit floating point value. Numbers from input documents can be any combination of size and be signed or unsigned. When a mathematical operation is performed with two or more integer values Bloblang will create an integer result, with the exception of division. However, if any number within a mathematical operation is a floating point then the result will be a floating point value. In order to explicitly coerce numbers into integer types you can use the [`.ceil()`, `.floor()`, or `.round()` methods](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#number-manipulation). ## Comparison The not (`!`) operator reverses the boolean value of the expression immediately following it, and is valid to place before any query that yields a boolean value. If the following expression yields a non-boolean value then a [recoverable mapping error will be thrown](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/#error-handling). If you wish to reverse the boolean result of a complex query then simply place the query within brackets (`!(this.foo > this.bar)`). ### Equality The equality operators (`==` and `!=`) are valid to use against any value type. In order for arguments to be considered equal they must match in both their basic type (`string`, `number`, `null`, `bool`, etc) as well as their value. If you wish to compare mismatched value types then use [coercion methods](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#type-coercion). Number arguments are considered equal if their value is the same when represented the same way, which means their underlying representations (integer, float, etc) do not need to match in order for them to be considered equal. ### Numerical Numerical comparisons (`>`, `>=`, `<`, `<=`) are valid to use against number values only. If a non-number value is used as an argument then a [recoverable mapping error will be thrown](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/#error-handling). ### Boolean Boolean comparison operators (`||`, `&&`) are valid to use against boolean values only (`true` or `false`). If a non-boolean value is used as an argument then a [recoverable mapping error will be thrown](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/#error-handling). --- # Page 306: Bloblang Functions **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions.md --- # Bloblang Functions Functions can be placed anywhere and allow you to extract information from your environment, generate values, or access data from the underlying message being mapped: ```bloblang root.doc.id = uuid_v4() root.doc.received_at = now() root.doc.host = hostname() ``` Functions support both named and nameless style arguments: ```bloblang root.values_one = range(start: 0, stop: this.max, step: 2) root.values_two = range(0, this.max, 2) # In: {"max":10} ``` ## batch_index Returns the zero-based index of the current message within its batch. Use this to conditionally process messages based on their position, or to create sequential identifiers within a batch. ### Examples ```bloblang root = if batch_index() > 0 { deleted() } ``` Create a unique identifier combining batch position with timestamp: ```bloblang root.id = "%v-%v".format(timestamp_unix(), batch_index()) ``` ## batch_size Returns the total number of messages in the current batch. Use this to determine batch boundaries or compute relative positions. ### Examples ```bloblang root.total = batch_size() ``` Check if processing the last message in a batch: ```bloblang root.is_last = batch_index() == batch_size() - 1 ``` ## bytes Creates a zero-initialized byte array of specified length. Use this to allocate fixed-size byte buffers for binary data manipulation or to generate padding. ### Parameters | Name | Type | Description | | --- | --- | --- | | `length` | `integer` | The size of the resulting byte array. | ### Examples ```bloblang root.data = bytes(5) ``` Create a buffer for binary operations: ```bloblang root.header = bytes(16) root.payload = content() ``` ## content Returns the raw message payload as bytes, regardless of the current mapping context. Use this to access the original message when working within nested contexts, or to store the entire message as a field. ### Examples ```bloblang root.doc = content().string() # In: {"foo":"bar"} # Out: {"doc":"{\"foo\":\"bar\"}"} ``` Preserve original message while adding metadata: ```bloblang root.original = content().string() root.processed_by = "ai" # In: {"foo":"bar"} # Out: {"original":"{\"foo\":\"bar\"}","processed_by":"ai"} ``` ## counter > ⚠️ **CAUTION** > > This function is experimental. It might change or be removed in a future release. Generates an incrementing sequence of integers starting from a minimum value (default 1). Each counter instance maintains its own independent state across message processing. When the maximum value is reached, the counter automatically resets to the minimum. ### Parameters | Name | Type | Description | | --- | --- | --- | | `min` (optional) | `query expression` | The starting value of the counter. This is the first value yielded. Evaluated once when the mapping is initialized. Default: `1`. | | `max` (optional) | `query expression` | The maximum value before the counter resets to min. Evaluated once when the mapping is initialized. Default: `9223372036854775807`. | | `set` (optional) | `query expression` | An optional query that controls counter behavior: when it resolves to a non-negative integer, the counter is set to that value; when it resolves to `null`, the counter is read without incrementing; when it resolves to a deletion, the counter resets to min; otherwise the counter increments normally. | ### Examples Generate sequential IDs for each message: ```bloblang root.id = counter() # In: {} # Out: {"id":1} # In: {} # Out: {"id":2} ``` Use a custom range for the counter: ```bloblang root.batch_num = counter(min: 100, max: 200) # In: {} # Out: {"batch_num":100} # In: {} # Out: {"batch_num":101} ``` Increment a counter multiple times within a single mapping using a named map: ```bloblang map increment { root = counter() } root.first_id = null.apply("increment") root.second_id = null.apply("increment") # In: {} # Out: {"first_id":1,"second_id":2} # In: {} # Out: {"first_id":3,"second_id":4} ``` Conditionally reset a counter based on input data: ```bloblang root.streak = counter(set: if this.status != "success" { 0 }) # In: {"status":"success"} # Out: {"streak":1} # In: {"status":"success"} # Out: {"streak":2} # In: {"status":"failure"} # Out: {"streak":0} # In: {"status":"success"} # Out: {"streak":1} ``` Peek at the current counter value without incrementing by using null in the set parameter: ```bloblang root.count = counter(set: if this.peek { null }) # In: {"peek":false} # Out: {"count":1} # In: {"peek":false} # Out: {"count":2} # In: {"peek":true} # Out: {"count":2} # In: {"peek":false} # Out: {"count":3} ``` ## deleted Returns a deletion marker that removes the target field or message. When applied to root, the entire message is dropped while still being acknowledged as successfully processed. Use this to filter data or conditionally remove fields. ### Examples ```bloblang root = this root.bar = deleted() # In: {"bar":"bar_value","baz":"baz_value","foo":"foo value"} # Out: {"baz":"baz_value","foo":"foo value"} ``` Filter array elements by returning deleted for unwanted items: ```bloblang root.new_nums = this.nums.map_each(num -> if num < 10 { deleted() } else { num - 10 }) # In: {"nums":[3,11,4,17]} # Out: {"new_nums":[1,7]} ``` ## error Returns the error message string if the message has failed processing, otherwise `null`. Use this in error handling pipelines to log or route failed messages based on their error details. ### Examples ```bloblang root.doc.error = error() ``` Route messages to different outputs based on error presence: ```bloblang root = this root.error_msg = error() root.has_error = error() != null ``` ## error_source_label Returns the user-defined label of the component that caused the error, empty string if no label is set, or `null` if the message has no error. Use this for more human-readable error tracking when components have custom labels. ### Examples ```bloblang root.doc.error_source_label = error_source_label() ``` Route errors based on component labels: ```bloblang root.error_category = error_source_label().or("unknown") ``` ## error_source_name Returns the component name that caused the error, or `null` if the message has no error or the error has no associated component. Use this to identify which processor or component in your pipeline caused a failure. ### Examples ```bloblang root.doc.error_source_name = error_source_name() ``` Create detailed error logs with component information: ```bloblang root.error_details = if errored() { { "message": error(), "component": error_source_name(), "timestamp": now() } } ``` ## error_source_path Returns the dot-separated path to the component that caused the error, or `null` if the message has no error. Use this to identify the exact location of a failed component in nested pipeline configurations. ### Examples ```bloblang root.doc.error_source_path = error_source_path() ``` Build comprehensive error context for debugging: ```bloblang root.error_info = { "path": error_source_path(), "component": error_source_name(), "message": error() } ``` ## errored Returns true if the message has failed processing, false otherwise. Use this for conditional logic in error handling workflows or to route failed messages to dead letter queues. ### Examples ```bloblang root.doc.status = if errored() { 400 } else { 200 } ``` Send only failed messages to a separate stream: ```bloblang root = if errored() { this } else { deleted() } ``` ## fake Generates realistic fake data for testing and development purposes. Supports a wide variety of data types including personal information, network addresses, dates/times, financial data, and UUIDs. Useful for creating mock data, populating test databases, or anonymizing sensitive information. Supported functions: `latitude`, `longitude`, `unix_time`, `date`, `time_string`, `month_name`, `year_string`, `day_of_week`, `day_of_month`, `timestamp`, `century`, `timezone`, `time_period`, `email`, `mac_address`, `domain_name`, `url`, `username`, `ipv4`, `ipv6`, `password`, `jwt`, `word`, `sentence`, `paragraph`, `cc_type`, `cc_number`, `currency`, `amount_with_currency`, `title_male`, `title_female`, `first_name`, `first_name_male`, `first_name_female`, `last_name`, `name`, `gender`, `chinese_first_name`, `chinese_last_name`, `chinese_name`, `phone_number`, `toll_free_phone_number`, `e164_phone_number`, `uuid_hyphenated`, `uuid_digit`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `function` (optional) | `string` | The name of the faker function to use. See description for full list of supported functions. Default: `""`. | ### Examples Generate fake user profile data for testing: ```bloblang root.user = { "id": fake("uuid_hyphenated"), "name": fake("name"), "email": fake("email"), "created_at": fake("timestamp") } ``` Create realistic test data for network monitoring: ```bloblang root.event = { "source_ip": fake("ipv4"), "mac_address": fake("mac_address"), "url": fake("url") } ``` ## json Returns a field from the original JSON message by dot path, always accessing the root document regardless of mapping context. Use this to reference the source message when working in nested contexts or to extract specific fields. ### Parameters | Name | Type | Description | | --- | --- | --- | | `path` (optional) | `string` | An optional \[dot path\]\[field_paths\] identifying a field to obtain. Default: `""`. | ### Examples ```bloblang root.mapped = json("foo.bar") # In: {"foo":{"bar":"hello world"}} # Out: {"mapped":"hello world"} ``` Access the original message from within nested mapping contexts: ```bloblang root.doc = json() # In: {"foo":{"bar":"hello world"}} # Out: {"doc":{"foo":{"bar":"hello world"}}} ``` ## ksuid Generates a K-Sortable Unique Identifier with built-in timestamp ordering. Use this for distributed unique IDs that sort chronologically and remain collision-resistant without coordination between generators. ### Examples ```bloblang root.id = ksuid() ``` Create sortable event IDs for logging: ```bloblang root.event = { "id": ksuid(), "type": this.event_type, "data": this.payload } ``` ## meta > ⚠️ **WARNING** > > This function is deprecated and will be removed in a future version. Returns the value of a metadata key from the input message as a string, or `null` if the key does not exist. Since values are extracted from the read-only input message they do NOT reflect changes made from within the map. In order to query metadata mutations made within a mapping use the [`root_meta` function](#root_meta). This function supports extracting metadata from other messages of a batch with the `from` method. ### Parameters | Name | Type | Description | | --- | --- | --- | | `key` (optional) | `string` | An optional key of a metadata value to obtain. Default: `""`. | ### Examples ```bloblang root.topic = meta("kafka_topic") ``` The key parameter is optional and if omitted the entire metadata contents are returned as an object: ```bloblang root.all_metadata = meta() ``` ## metadata Returns metadata from the input message by key, or `null` if the key doesn’t exist. This reads the original metadata; to access modified metadata during mapping, use the `@` operator instead. Use this to extract message properties like topics, headers, or timestamps. ### Parameters | Name | Type | Description | | --- | --- | --- | | `key` (optional) | `string` | An optional key of a metadata value to obtain. Default: `""`. | ### Examples ```bloblang root.topic = metadata("kafka_topic") ``` Retrieve all metadata as an object by omitting the key parameter: ```bloblang root.all_metadata = metadata() ``` Copy specific metadata fields to the message body: ```bloblang root.source = { "topic": metadata("kafka_topic"), "partition": metadata("kafka_partition"), "timestamp": metadata("kafka_timestamp_unix") } ``` ## nanoid Generates a URL-safe unique identifier using Nano ID. Use this for compact, URL-friendly IDs with good collision resistance. Customize the length (default 21) or provide a custom alphabet for specific character requirements. ### Parameters | Name | Type | Description | | --- | --- | --- | | `length` (optional) | `integer` | An optional length. | | `alphabet` (optional) | `string` | An optional custom alphabet to use for generating IDs. When specified the field `length` must also be present. | ### Examples ```bloblang root.id = nanoid() ``` Generate a longer ID for additional uniqueness: ```bloblang root.id = nanoid(54) ``` Use a custom alphabet for domain-specific IDs: ```bloblang root.id = nanoid(54, "abcde") ``` ## now Returns the current timestamp as an RFC 3339 formatted string with nanosecond precision. Use this to add processing timestamps to messages or measure time between events. Chain with `ts_format` to customize the format or timezone. ### Examples ```bloblang root.received_at = now() ``` Format the timestamp in a custom format and timezone: ```bloblang root.received_at = now().ts_format("Mon Jan 2 15:04:05 -0700 MST 2006", "UTC") ``` ## pi Returns the value of the mathematical constant Pi. ### Examples ```bloblang root.radians = this.degrees * (pi() / 180) # In: {"degrees":45} # Out: {"radians":0.7853981633974483} ``` ```bloblang root.degrees = this.radians * (180 / pi()) # In: {"radians":0.78540} # Out: {"degrees":45.00010522957486} ``` ## random_int Generates a pseudo-random non-negative 64-bit integer. Use this for creating random IDs, sampling data, or generating test values. Provide a seed for reproducible randomness, or use a dynamic seed like `timestamp_unix_nano()` for unique values per mapping instance. Optional `min` and `max` parameters constrain the output range (both inclusive). For dynamic ranges based on message data, use the modulo operator instead: `random_int() % dynamic_max + dynamic_min`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `seed` (optional) | `query expression` | A seed to use, if a query is provided it will only be resolved once during the lifetime of the mapping. | | `min` (optional) | `integer` | The minimum value the random generated number will have. The default value is 0. Default: `0`. | | `max` (optional) | `integer` | The maximum value the random generated number will have. The default value is 9223372036854775806 (math.MaxInt64 - 1). Default: `9223372036854775806`. | ### Examples ```bloblang root.first = random_int() root.second = random_int(1) root.third = random_int(max:20) root.fourth = random_int(min:10, max:20) root.fifth = random_int(timestamp_unix_nano(), 5, 20) root.sixth = random_int(seed:timestamp_unix_nano(), max:20) ``` Use a dynamic seed for unique random values per mapping instance: ```bloblang root.random_id = random_int(timestamp_unix_nano()) root.sample_percent = random_int(seed: timestamp_unix_nano(), min: 0, max: 100) ``` ## range Creates an array of integers from start (inclusive) to stop (exclusive) with an optional step. Use this to generate sequences for iteration, indexing, or creating numbered lists. ### Parameters | Name | Type | Description | | --- | --- | --- | | `start` | `integer` | The start value. | | `stop` | `integer` | The stop value. | | `step` (optional) | `integer` | The step value. Default: `1`. | ### Examples ```bloblang root.a = range(0, 10) root.b = range(start: 0, stop: this.max, step: 2) # Using named params root.c = range(0, -this.max, -2) # In: {"max":10} # Out: {"a":[0,1,2,3,4,5,6,7,8,9],"b":[0,2,4,6,8],"c":[0,-2,-4,-6,-8]} ``` Generate a sequence for batch processing: ```bloblang root.pages = range(0, this.total_items, 100).map_each(offset -> { "offset": offset, "limit": 100 }) # In: {"total_items":250} # Out: {"pages":[{"limit":100,"offset":0},{"limit":100,"offset":100}]} ``` ## root_meta > ⚠️ **WARNING** > > This function is deprecated and will be removed in a future version. Returns the value of a metadata key from the new message being created as a string, or `null` if the key does not exist. Changes made to metadata during a mapping will be reflected by this function. ### Parameters | Name | Type | Description | | --- | --- | --- | | `key` (optional) | `string` | An optional key of a metadata value to obtain. Default: `""`. | ### Examples ```bloblang root.topic = root_meta("kafka_topic") ``` The key parameter is optional and if omitted the entire metadata contents are returned as an object: ```bloblang root.all_metadata = root_meta() ``` ## snowflake_id Generates a unique, time-ordered Snowflake ID. Snowflake IDs are 64-bit integers that encode timestamp, node ID, and sequence information, making them ideal for distributed systems where sortable unique identifiers are needed. Returns a string representation of the ID. ### Parameters | Name | Type | Description | | --- | --- | --- | | `node_id` (optional) | `integer` | Optional node identifier (0-1023) to distinguish IDs generated by different machines in a distributed system. Defaults to 1. Default: `1`. | ### Examples Generate a unique Snowflake ID for each message: ```bloblang root.id = snowflake_id() root.payload = this ``` Generate Snowflake IDs with different node IDs for multi-datacenter deployments: ```bloblang root.id = snowflake_id(42) root.data = this ``` ## throw Immediately fails the mapping with a custom error message. Use this to halt processing when data validation fails or required fields are missing, causing the message to be routed to error handlers. ### Parameters | Name | Type | Description | | --- | --- | --- | | `why` | `string` | A string explanation for why an error was thrown, this will be added to the resulting error message. | ### Examples ```bloblang root.doc.type = match { this.exists("header.id") => "foo" this.exists("body.data") => "bar" _ => throw("unknown type") } root.doc.contents = (this.body.content | this.thing.body) # In: {"header":{"id":"first"},"thing":{"body":"hello world"}} # Out: {"doc":{"contents":"hello world","type":"foo"}} # In: {"nothing":"matches"} # Out: Error("failed assignment (line 1): unknown type") ``` Validate required fields before processing: ```bloblang root = if this.exists("user_id") { this } else { throw("missing required field: user_id") } # In: {"user_id":123,"name":"alice"} # Out: {"name":"alice","user_id":123} # In: {"name":"bob"} # Out: Error("failed assignment (line 1): missing required field: user_id") ``` ## timestamp_unix Returns the current Unix timestamp in seconds since epoch. Use this for numeric timestamps compatible with most systems, or as a seed for random number generation. ### Examples ```bloblang root.received_at = timestamp_unix() ``` Create a sortable ID combining timestamp with a counter: ```bloblang root.id = "%v-%v".format(timestamp_unix(), batch_index()) ``` ## timestamp_unix_micro Returns the current Unix timestamp in microseconds since epoch. Use this for high-precision timing measurements or when microsecond resolution is required. ### Examples ```bloblang root.received_at = timestamp_unix_micro() ``` Measure elapsed time between events: ```bloblang root.processing_duration_us = timestamp_unix_micro() - this.start_time_us ``` ## timestamp_unix_milli Returns the current Unix timestamp in milliseconds since epoch. Use this for millisecond-precision timestamps common in web APIs and JavaScript systems. ### Examples ```bloblang root.received_at = timestamp_unix_milli() ``` Add processing time metadata: ```bloblang meta processing_time_ms = timestamp_unix_milli() ``` ## timestamp_unix_nano Returns the current Unix timestamp in nanoseconds since epoch. Use this for the highest precision timing or as a unique seed value that changes on every invocation. ### Examples ```bloblang root.received_at = timestamp_unix_nano() ``` Generate unique random values on each mapping: ```bloblang root.random_value = random_int(timestamp_unix_nano()) ``` ## tracing_id > ⚠️ **CAUTION** > > This function is experimental. It might change or be removed in a future release. Returns the OpenTelemetry trace ID for the message, or an empty string if no tracing span exists. Use this to correlate logs and events with distributed traces. ### Examples ```bloblang meta trace_id = tracing_id() ``` Add trace ID to structured logs: ```bloblang root.log_entry = this root.log_entry.trace_id = tracing_id() ``` ## tracing_span > ⚠️ **CAUTION** > > This function is experimental. It might change or be removed in a future release. Returns the OpenTelemetry tracing span attached to the message as a text map object, or `null` if no span exists. Use this to propagate trace context to downstream systems via headers or metadata. ### Examples ```bloblang root.headers.traceparent = tracing_span().traceparent # In: {"some_stuff":"just can't be explained by science"} # Out: {"headers":{"traceparent":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"}} ``` Forward all tracing fields to output metadata: ```bloblang meta = tracing_span() ``` ## ulid Generates a Universally Unique Lexicographically Sortable Identifier (ULID). ULIDs are 128-bit identifiers that are sortable by creation time, URL-safe, and case-insensitive. They consist of a 48-bit timestamp (millisecond precision) and 80 bits of randomness, making them ideal for distributed systems that need time-ordered unique IDs without coordination. ### Parameters | Name | Type | Description | | --- | --- | --- | | `encoding` (optional) | `string` | Encoding format for the ULID. "crockford" produces 26-character Base32 strings (recommended). "hex" produces 32-character hexadecimal strings. Default: `"crockford"`. | | `random_source` (optional) | `string` | Randomness source: `secure_random` uses cryptographically secure random (recommended for production), `fast_random` uses faster but non-secure random (only for non-sensitive testing). Default: `"secure_random"`. | ### Examples Generate time-sortable IDs for distributed message ordering: ```bloblang root.message_id = ulid() root.timestamp = now() root.data = this ``` Generate hex-encoded ULIDs for systems that prefer hexadecimal format: ```bloblang root.id = ulid("hex") ``` ## uuid_v4 Generates a random RFC-4122 version 4 UUID. Use this for creating unique identifiers that don’t reveal timing information or require ordering. Each invocation produces a new globally unique ID. ### Examples ```bloblang root.id = uuid_v4() ``` Add unique request IDs for tracing: ```bloblang root = this root.request_id = uuid_v4() ``` ## uuid_v7 Generates a time-ordered UUID version 7 with millisecond timestamp precision. Use this for sortable unique identifiers that maintain chronological ordering, ideal for database keys or event IDs. Optionally specify a custom timestamp. ### Parameters | Name | Type | Description | | --- | --- | --- | | `time` (optional) | `timestamp` | An optional timestamp to use for the time ordered portion of the UUID. | ### Examples ```bloblang root.id = uuid_v7() ``` Generate a UUID with a specific timestamp for backdating events: ```bloblang root.id = uuid_v7(now().ts_sub_iso8601("PT1M")) ``` ## with_schema_registry_header Prepends a Confluent Schema Registry wire format header to message bytes. The header is 5 bytes: a magic byte (0x00) followed by a 4-byte big-endian schema ID. This format is required when producing messages to Kafka topics that use Confluent Schema Registry for schema validation and evolution. ### Parameters | Name | Type | Description | | --- | --- | --- | | `schema_id` | `unknown` | The schema ID from your Schema Registry (0 to 4294967295). This ID references the schema version used to encode the message. | | `message` | `unknown` | The serialized message bytes (for example, Avro, Protobuf, or JSON Schema encoded data) to prepend the header to. | ### Examples Add Schema Registry header to Avro-encoded message: ```bloblang root = with_schema_registry_header(123, content()) ``` Use schema ID from metadata to add header dynamically: ```bloblang root = with_schema_registry_header(meta("schema_id").number(), content()) ``` --- # Page 307: Bloblang Methods **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods.md --- # Bloblang Methods Methods provide most of the power in Bloblang as they allow you to augment values and can be added to any expression (including other methods): ```bloblang root.doc.id = this.thing.id.string().catch(uuid_v4()) root.doc.reduced_nums = this.thing.nums.map_each(num -> if num < 10 { deleted() } else { num - 10 }) root.has_good_taste = ["pikachu","mewtwo","magmar"].contains(this.user.fav_pokemon) # In: {"thing":{"id":123,"nums":[5,12,18,7,25]},"user":{"fav_pokemon":"pikachu"}} ``` Methods support both named and nameless style arguments: ```bloblang root.foo_one = this.(bar | baz).trim().replace_all(old: "dog", new: "cat") root.foo_two = this.(bar | baz).trim().replace_all("dog", "cat") # In: {"bar":" I love my dog "} ``` ## General ### apply Apply a declared mapping to a target value. #### Parameters | Name | Type | Description | | --- | --- | --- | | `mapping` | `string` | The mapping to apply. | #### Examples ```bloblang map thing { root.inner = this.first } root.foo = this.doc.apply("thing") # In: {"doc":{"first":"hello world"}} # Out: {"foo":{"inner":"hello world"}} ``` ```bloblang map create_foo { root.name = "a foo" root.purpose = "to be a foo" } root = this root.foo = null.apply("create_foo") # In: {"id":"1234"} # Out: {"foo":{"name":"a foo","purpose":"to be a foo"},"id":"1234"} ``` ### catch If the result of a target query fails (due to incorrect types, failed parsing, etc) the argument is returned instead. #### Parameters | Name | Type | Description | | --- | --- | --- | | `fallback` | `query expression` | A value to yield, or query to execute, if the target query fails. | #### Examples ```bloblang root.doc.id = this.thing.id.string().catch(uuid_v4()) ``` The fallback argument can be a mapping, allowing you to capture the error string and yield structured data back: ```bloblang root.url = this.url.parse_url().catch(err -> {"error":err,"input":this.url}) # In: {"url":"invalid %&# url"} # Out: {"url":{"error":"field `this.url`: parse \"xxxxx\": invalid URL escape","input":"invalid %&# url"}} ``` When the input document is not structured attempting to reference structured fields with `this` will result in an error. Therefore, a convenient way to delete non-structured data is with a catch: ```bloblang root = this.catch(deleted()) # In: {"doc":{"foo":"bar"}} # Out: {"doc":{"foo":"bar"}} # In: not structured data # Out: ``` ### from Modifies a target query such that certain functions are executed from the perspective of another message in the batch. This allows you to mutate events based on the contents of other messages. Functions that support this behavior are `content`, `json` and `meta`. #### Parameters | Name | Type | Description | | --- | --- | --- | | `index` | `integer` | The message index to use as a perspective. | #### Examples For example, the following map extracts the contents of the JSON field `foo` specifically from message index `1` of a batch, effectively overriding the field `foo` for all messages of a batch to that of message 1: ```bloblang root = this root.foo = json("foo").from(1) ``` ### from_all Modifies a target query such that certain functions are executed from the perspective of each message in the batch, and returns the set of results as an array. Functions that support this behavior are `content`, `json` and `meta`. #### Examples ```bloblang root = this root.foo_summed = json("foo").from_all().sum() ``` ### map Executes a query on the target value, allowing you to transform or extract data from the current context. #### Parameters | Name | Type | Description | | --- | --- | --- | | `query` | `query expression` | A query to execute on the target. | ### not Returns the logical NOT (negation) of a boolean value. Converts true to false and false to true. ### or If the result of the target query fails or resolves to `null`, returns the argument instead. This is an explicit method alternative to the coalesce pipe operator `|`. #### Parameters | Name | Type | Description | | --- | --- | --- | | `fallback` | `query expression` | A value to yield, or query to execute, if the target query fails or resolves to `null`. | #### Examples ```bloblang root.doc.id = this.thing.id.or(uuid_v4()) ``` ## Encoding and encryption ### compress Compresses a string or byte array using the specified compression algorithm. Returns compressed data as bytes. Useful for reducing payload size before transmission or storage. #### Parameters | Name | Type | Description | | --- | --- | --- | | `algorithm` | `string` | The compression algorithm: `flate`, `gzip`, `pgzip` (parallel gzip), `lz4`, `snappy`, `zlib`, or `zstd`. | | `level` (optional) | `integer` | Compression level (default: -1 for default compression). Higher values increase compression ratio but use more CPU. Range and effect varies by algorithm. Default: `-1`. | #### Examples Compress and encode for safe transmission: ```bloblang root.compressed = content().bytes().compress("gzip").encode("base64") # In: {"message":"hello world I love space"} # Out: {"compressed":"H4sIAAAJbogA/wAmANn/eyJtZXNzYWdlIjoiaGVsbG8gd29ybGQgSSBsb3ZlIHNwYWNlIn0DAHEvdwomAAAA"} ``` Compare compression ratios across algorithms: ```bloblang root.original_size = content().length() root.gzip_size = content().compress("gzip").length() root.lz4_size = content().compress("lz4").length() # In: The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. # Out: {"gzip_size":114,"lz4_size":85,"original_size":89} ``` ### decode Decodes an encoded string target according to a chosen scheme and returns the result as a byte array. When mapping the result to a JSON field the value should be cast to a string using the method `string`, or encoded using the method `encode`, otherwise it will be base64 encoded by default. Available schemes are: `base64`, `base64url` [(RFC 4648 with padding characters)](https://rfc-editor.org/rfc/rfc4648.html), `base64rawurl` [(RFC 4648 without padding characters)](https://rfc-editor.org/rfc/rfc4648.html), `hex`, `ascii85`. #### Parameters | Name | Type | Description | | --- | --- | --- | | `scheme` | `string` | The decoding scheme to use. | #### Examples ```bloblang root.decoded = this.value.decode("hex").string() # In: {"value":"68656c6c6f20776f726c64"} # Out: {"decoded":"hello world"} ``` ```bloblang root = this.encoded.decode("ascii85") # In: {"encoded":"FD,B0+DGm>FDl80Ci\"A>F`)8BEckl6F`M&(+Cno&@/"} # Out: this is totally unstructured data ``` ### decompress Decompresses a byte array using the specified decompression algorithm. Returns decompressed data as bytes. Use with data that was previously compressed using the corresponding algorithm. #### Parameters | Name | Type | Description | | --- | --- | --- | | `algorithm` | `string` | The decompression algorithm: `gzip`, `pgzip` (parallel gzip), `zlib`, `bzip2`, `flate`, `snappy`, `lz4`, or `zstd`. | #### Examples Decompress base64-encoded compressed data: ```bloblang root = this.compressed.decode("base64").decompress("gzip") # In: {"compressed":"H4sIAN12MWkAA8tIzcnJVyjPL8pJUfBUyMkvS1UoLkhMTgUAQpDxbxgAAAA="} # Out: hello world I love space ``` Convert decompressed bytes to string for JSON output: ```bloblang root.message = this.compressed.decode("base64").decompress("gzip").string() # In: {"compressed":"H4sIAN12MWkAA8tIzcnJVyjPL8pJUfBUyMkvS1UoLkhMTgUAQpDxbxgAAAA="} # Out: {"message":"hello world I love space"} ``` ### decrypt_aes Decrypts an encrypted string or byte array target according to a chosen AES encryption method and returns the result as a byte array. The algorithms require a key and an initialization vector / nonce. Available schemes are: `ctr`, `gcm`, `ofb`, `cbc`. #### Parameters | Name | Type | Description | | --- | --- | --- | | `scheme` | `string` | The scheme to use for decryption, one of `ctr`, `gcm`, `ofb`, `cbc`. | | `key` | `string` | A key to decrypt with. | | `iv` | `string` | An initialization vector / nonce. | #### Examples ```bloblang let key = "2b7e151628aed2a6abf7158809cf4f3c".decode("hex") let vector = "f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff".decode("hex") root.decrypted = this.value.decode("hex").decrypt_aes("ctr", $key, $vector).string() # In: {"value":"84e9b31ff7400bdf80be7254"} # Out: {"decrypted":"hello world!"} ``` ### encode Encodes a string or byte array target according to a chosen scheme and returns a string result. Available schemes are: `base64`, `base64url` [(RFC 4648 with padding characters)](https://rfc-editor.org/rfc/rfc4648.html), `base64rawurl` [(RFC 4648 without padding characters)](https://rfc-editor.org/rfc/rfc4648.html), `hex`, `ascii85`. #### Parameters | Name | Type | Description | | --- | --- | --- | | `scheme` | `string` | The encoding scheme to use. | #### Examples ```bloblang root.encoded = this.value.encode("hex") # In: {"value":"hello world"} # Out: {"encoded":"68656c6c6f20776f726c64"} ``` ```bloblang root.encoded = content().encode("ascii85") # In: this is totally unstructured data # Out: {"encoded":"FD,B0+DGm>FDl80Ci\"A>F`)8BEckl6F`M&(+Cno&@/"} ``` ### encrypt_aes Encrypts a string or byte array target according to a chosen AES encryption method and returns a string result. The algorithms require a key and an initialization vector / nonce. Available schemes are: `ctr`, `gcm`, `ofb`, `cbc`. #### Parameters | Name | Type | Description | | --- | --- | --- | | `scheme` | `string` | The scheme to use for encryption, one of `ctr`, `gcm`, `ofb`, `cbc`. | | `key` | `string` | A key to encrypt with. | | `iv` | `string` | An initialization vector / nonce. | #### Examples ```bloblang let key = "2b7e151628aed2a6abf7158809cf4f3c".decode("hex") let vector = "f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff".decode("hex") root.encrypted = this.value.encrypt_aes("ctr", $key, $vector).encode("hex") # In: {"value":"hello world!"} # Out: {"encrypted":"84e9b31ff7400bdf80be7254"} ``` ### hash Hashes a string or byte array according to a chosen algorithm and returns the result as a byte array. When mapping the result to a JSON field the value should be cast to a string using the method [`string`](#string), or encoded using the method [`encode`](#encode), otherwise it will be base64 encoded by default. Available algorithms are: `hmac_sha1`, `hmac_sha256`, `hmac_sha512`, `md5`, `sha1`, `sha256`, `sha512`, `sha3_256`, `sha3_512`, `xxhash64`, `crc32`, `fnv32`. The following algorithms require a key, which is specified as a second argument: `hmac_sha1`, `hmac_sha256`, `hmac_sha512`. #### Parameters | Name | Type | Description | | --- | --- | --- | | `algorithm` | `string` | The hashing algorithm to use. | | `key` (optional) | `string` | An optional key to use. | | `polynomial` (optional) | `string` | An optional polynomial key to use when selecting the `crc32` algorithm, otherwise ignored. Options are `IEEE` (default), `Castagnoli` and `Koopman`. Default: `"IEEE"`. | #### Examples ```bloblang root.h1 = this.value.hash("sha1").encode("hex") root.h2 = this.value.hash("hmac_sha1","static-key").encode("hex") # In: {"value":"hello world"} # Out: {"h1":"2aae6c35c94fcfb415dbe95f408b9ce91ee846ed","h2":"d87e5f068fa08fe90bb95bc7c8344cb809179d76"} ``` The `crc32` algorithm supports options for the polynomial: ```bloblang root.h1 = this.value.hash(algorithm: "crc32", polynomial: "Castagnoli").encode("hex") root.h2 = this.value.hash(algorithm: "crc32", polynomial: "Koopman").encode("hex") # In: {"value":"hello world"} # Out: {"h1":"c99465aa","h2":"df373d3c"} ``` ### uuid_v5 Returns UUID version 5 for the given string. #### Parameters | Name | Type | Description | | --- | --- | --- | | `ns` (optional) | `string` | An optional namespace name or UUID. It supports the `dns`, `url`, `oid` and `x500` predefined namespaces and any valid RFC-9562 UUID. If empty, the nil UUID will be used. | #### Examples ```bloblang root.id = "example".uuid_v5() ``` ```bloblang root.id = "example".uuid_v5("x500") ``` ```bloblang root.id = "example".uuid_v5("77f836b7-9f61-46c0-851e-9b6ca3535e69") ``` ## GeoIP ### geoip_anonymous_ip Looks up an IP address against a [MaxMind database file](https://www.maxmind.com/en/home) and, if found, returns an object describing the anonymous IP associated with it. #### Parameters | Name | Type | Description | | --- | --- | --- | | `path` | `string` | A path to an mmdb (maxmind) file. | ### geoip_asn Looks up an IP address against a [MaxMind database file](https://www.maxmind.com/en/home) and, if found, returns an object describing the ASN associated with it. #### Parameters | Name | Type | Description | | --- | --- | --- | | `path` | `string` | A path to an mmdb (maxmind) file. | ### geoip_city Looks up an IP address against a [MaxMind database file](https://www.maxmind.com/en/home) and, if found, returns an object describing the city associated with it. #### Parameters | Name | Type | Description | | --- | --- | --- | | `path` | `string` | A path to an mmdb (maxmind) file. | ### geoip_connection_type Looks up an IP address against a [MaxMind database file](https://www.maxmind.com/en/home) and, if found, returns an object describing the connection type associated with it. #### Parameters | Name | Type | Description | | --- | --- | --- | | `path` | `string` | A path to an mmdb (maxmind) file. | ### geoip_country Looks up an IP address against a [MaxMind database file](https://www.maxmind.com/en/home) and, if found, returns an object describing the country associated with it. #### Parameters | Name | Type | Description | | --- | --- | --- | | `path` | `string` | A path to an mmdb (maxmind) file. | ### geoip_domain Looks up an IP address against a [MaxMind database file](https://www.maxmind.com/en/home) and, if found, returns an object describing the domain associated with it. #### Parameters | Name | Type | Description | | --- | --- | --- | | `path` | `string` | A path to an mmdb (maxmind) file. | ### geoip_enterprise Looks up an IP address against a [MaxMind database file](https://www.maxmind.com/en/home) and, if found, returns an object describing the enterprise associated with it. #### Parameters | Name | Type | Description | | --- | --- | --- | | `path` | `string` | A path to an mmdb (maxmind) file. | ### geoip_isp Looks up an IP address against a [MaxMind database file](https://www.maxmind.com/en/home) and, if found, returns an object describing the ISP associated with it. #### Parameters | Name | Type | Description | | --- | --- | --- | | `path` | `string` | A path to an mmdb (maxmind) file. | ## JSON web tokens ### parse_jwt_es256 Parses a claims object from a JWT string encoded with ES256. This method does not validate JWT claims. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The ES256 secret that was used for signing the token. | #### Examples ```bloblang root.claims = this.signed.parse_jwt_es256("""-----BEGIN PUBLIC KEY----- MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEGtLqIBePHmIhQcf0JLgc+F/4W/oI dp0Gta53G35VerNDgUUXmp78J2kfh4qLdh0XtmOMI587tCaqjvDAXfs//w== -----END PUBLIC KEY-----""") # In: {"signed":"eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1MTYyMzkwMjIsIm1vb2QiOiJEaXNkYWluZnVsIiwic3ViIjoiMTIzNDU2Nzg5MCJ9.GIRajP9JJbpTlqSCdNEz4qpQkRvzX4Q51YnTwVyxLDM9tKjR_a8ggHWn9CWj7KG0x8J56OWtmUxn112SRTZVhQ"} # Out: {"claims":{"iat":1516239022,"mood":"Disdainful","sub":"1234567890"}} ``` ### parse_jwt_es384 Parses a claims object from a JWT string encoded with ES384. This method does not validate JWT claims. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The ES384 secret that was used for signing the token. | #### Examples ```bloblang root.claims = this.signed.parse_jwt_es384("""-----BEGIN PUBLIC KEY----- MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAERoz74/B6SwmLhs8X7CWhnrWyRrB13AuU 8OYeqy0qHRu9JWNw8NIavqpTmu6XPT4xcFanYjq8FbeuM11eq06C52mNmS4LLwzA 2imlFEgn85bvJoC3bnkuq4mQjwt9VxdH -----END PUBLIC KEY-----""") # In: {"signed":"eyJhbGciOiJFUzM4NCIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1MTYyMzkwMjIsIm1vb2QiOiJEaXNkYWluZnVsIiwic3ViIjoiMTIzNDU2Nzg5MCJ9.H2HBSlrvQBaov2tdreGonbBexxtQB-xzaPL4-tNQZ6TVh7VH8VBcSwcWHYa1lBAHmdsKOFcB2Wk0SB7QWeGT3ptSgr-_EhDMaZ8bA5spgdpq5DsKfaKHrd7DbbQlmxNq"} # Out: {"claims":{"iat":1516239022,"mood":"Disdainful","sub":"1234567890"}} ``` ### parse_jwt_es512 Parses a claims object from a JWT string encoded with ES512. This method does not validate JWT claims. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The ES512 secret that was used for signing the token. | #### Examples ```bloblang root.claims = this.signed.parse_jwt_es512("""-----BEGIN PUBLIC KEY----- MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQAkHLdts9P56fFkyhpYQ31M/Stwt3w vpaxhlfudxnXgTO1IP4RQRgryRxZ19EUzhvWDcG3GQIckoNMY5PelsnCGnIBT2Xh 9NQkjWF5K6xS4upFsbGSAwQ+GIyyk5IPJ2LHgOyMSCVh5gRZXV3CZLzXujx/umC9 UeYyTt05zRRWuD+p5bY= -----END PUBLIC KEY-----""") # In: {"signed":"eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1MTYyMzkwMjIsIm1vb2QiOiJEaXNkYWluZnVsIiwic3ViIjoiMTIzNDU2Nzg5MCJ9.ACrpLuU7TKpAnncDCpN9m85nkL55MJ45NFOBl6-nEXmNT1eIxWjiP4pwWVbFH9et_BgN14119jbL_KqEJInPYc9nAXC6dDLq0aBU-dalvNl4-O5YWpP43-Y-TBGAsWnbMTrchILJ4-AEiICe73Ck5yWPleKg9c3LtkEFWfGs7BoPRguZ"} # Out: {"claims":{"iat":1516239022,"mood":"Disdainful","sub":"1234567890"}} ``` ### parse_jwt_hs256 Parses a claims object from a JWT string encoded with HS256. This method does not validate JWT claims. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The HS256 secret that was used for signing the token. | #### Examples ```bloblang root.claims = this.signed.parse_jwt_hs256("""dont-tell-anyone""") # In: {"signed":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1MTYyMzkwMjIsIm1vb2QiOiJEaXNkYWluZnVsIiwic3ViIjoiMTIzNDU2Nzg5MCJ9.YwXOM8v3gHVWcQRRRQc_zDlhmLnM62fwhFYGpiA0J1A"} # Out: {"claims":{"iat":1516239022,"mood":"Disdainful","sub":"1234567890"}} ``` ### parse_jwt_hs384 Parses a claims object from a JWT string encoded with HS384. This method does not validate JWT claims. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The HS384 secret that was used for signing the token. | #### Examples ```bloblang root.claims = this.signed.parse_jwt_hs384("""dont-tell-anyone""") # In: {"signed":"eyJhbGciOiJIUzM4NCIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1MTYyMzkwMjIsIm1vb2QiOiJEaXNkYWluZnVsIiwic3ViIjoiMTIzNDU2Nzg5MCJ9.2Y8rf_ijwN4t8hOGGViON_GrirLkCQVbCOuax6EoZ3nluX0tCGezcJxbctlIfsQ2"} # Out: {"claims":{"iat":1516239022,"mood":"Disdainful","sub":"1234567890"}} ``` ### parse_jwt_hs512 Parses a claims object from a JWT string encoded with HS512. This method does not validate JWT claims. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The HS512 secret that was used for signing the token. | #### Examples ```bloblang root.claims = this.signed.parse_jwt_hs512("""dont-tell-anyone""") # In: {"signed":"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1MTYyMzkwMjIsIm1vb2QiOiJEaXNkYWluZnVsIiwic3ViIjoiMTIzNDU2Nzg5MCJ9.utRb0urG6LGGyranZJVo5Dk0Fns1QNcSUYPN0TObQ-YzsGGB8jrxHwM5NAJccjJZzKectEUqmmKCaETZvuX4Fg"} # Out: {"claims":{"iat":1516239022,"mood":"Disdainful","sub":"1234567890"}} ``` ### parse_jwt_rs256 Parses a claims object from a JWT string encoded with RS256. This method does not validate JWT claims. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The RS256 secret that was used for signing the token. | #### Examples ```bloblang root.claims = this.signed.parse_jwt_rs256("""-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs/ibN8r68pLMR6gRzg4S 8v8l6Q7yi8qURjkEbcNeM1rkokC7xh0I4JVTwxYSVv/JIW8qJdyspl5NIfuAVi32 WfKvSAs+NIs+DMsNPYw3yuQals4AX8hith1YDvYpr8SD44jxhz/DR9lYKZFGhXGB +7NqQ7vpTWp3BceLYocazWJgusZt7CgecIq57ycM5hjM93BvlrUJ8nQ1a46wfL/8 Cy4P0et70hzZrsjjN41KFhKY0iUwlyU41yEiDHvHDDsTMBxAZosWjSREGfJL6Mfp XOInTHs/Gg6DZMkbxjQu6L06EdJ+Q/NwglJdAXM7Zo9rNELqRig6DdvG5JesdMsO +QIDAQAB -----END PUBLIC KEY-----""") # In: {"signed":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1MTYyMzkwMjIsIm1vb2QiOiJEaXNkYWluZnVsIiwic3ViIjoiMTIzNDU2Nzg5MCJ9.b0lH3jEupZZ4zoaly4Y_GCvu94HH6UKdKY96zfGNsIkPZpQLHIkZ7jMWlLlNOAd8qXlsBGP_i8H2qCKI4zlWJBGyPZgxXDzNRPVrTDfFpn4t4nBcA1WK2-ntXP3ehQxsaHcQU8Z_nsogId7Pme5iJRnoHWEnWtbwz5DLSXL3ZZNnRdrHM9MdI7QSDz9mojKDCaMpGN9sG7Xl-tGdBp1XzXuUOzG8S03mtZ1IgVR1uiBL2N6oohHIAunk8DIAmNWI-zgycTgzUGU7mvPkKH43qO8Ua1-13tCUBKKa8VxcotZ67Mxm1QAvBGoDnTKwWMwghLzs6d6WViXQg6eWlJcpBA"} # Out: {"claims":{"iat":1516239022,"mood":"Disdainful","sub":"1234567890"}} ``` ### parse_jwt_rs384 Parses a claims object from a JWT string encoded with RS384. This method does not validate JWT claims. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The RS384 secret that was used for signing the token. | #### Examples ```bloblang root.claims = this.signed.parse_jwt_rs384("""-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs/ibN8r68pLMR6gRzg4S 8v8l6Q7yi8qURjkEbcNeM1rkokC7xh0I4JVTwxYSVv/JIW8qJdyspl5NIfuAVi32 WfKvSAs+NIs+DMsNPYw3yuQals4AX8hith1YDvYpr8SD44jxhz/DR9lYKZFGhXGB +7NqQ7vpTWp3BceLYocazWJgusZt7CgecIq57ycM5hjM93BvlrUJ8nQ1a46wfL/8 Cy4P0et70hzZrsjjN41KFhKY0iUwlyU41yEiDHvHDDsTMBxAZosWjSREGfJL6Mfp XOInTHs/Gg6DZMkbxjQu6L06EdJ+Q/NwglJdAXM7Zo9rNELqRig6DdvG5JesdMsO +QIDAQAB -----END PUBLIC KEY-----""") # In: {"signed":"eyJhbGciOiJSUzM4NCIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1MTYyMzkwMjIsIm1vb2QiOiJEaXNkYWluZnVsIiwic3ViIjoiMTIzNDU2Nzg5MCJ9.orcXYBcjVE5DU7mvq4KKWFfNdXR4nEY_xupzWoETRpYmQZIozlZnM_nHxEk2dySvpXlAzVm7kgOPK2RFtGlOVaNRIa3x-pMMr-bhZTno4L8Hl4sYxOks3bWtjK7wql4uqUbqThSJB12psAXw2-S-I_FMngOPGIn4jDT9b802ottJSvTpXcy0-eKTjrV2PSkRRu-EYJh0CJZW55MNhqlt6kCGhAXfbhNazN3ASX-dmpd_JixyBKphrngr_zRA-FCn_Xf3QQDA-5INopb4Yp5QiJ7UxVqQEKI80X_JvJqz9WE1qiAw8pq5-xTen1t7zTP-HT1NbbD3kltcNa3G8acmNg"} # Out: {"claims":{"iat":1516239022,"mood":"Disdainful","sub":"1234567890"}} ``` ### parse_jwt_rs512 Parses a claims object from a JWT string encoded with RS512. This method does not validate JWT claims. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The RS512 secret that was used for signing the token. | #### Examples ```bloblang root.claims = this.signed.parse_jwt_rs512("""-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs/ibN8r68pLMR6gRzg4S 8v8l6Q7yi8qURjkEbcNeM1rkokC7xh0I4JVTwxYSVv/JIW8qJdyspl5NIfuAVi32 WfKvSAs+NIs+DMsNPYw3yuQals4AX8hith1YDvYpr8SD44jxhz/DR9lYKZFGhXGB +7NqQ7vpTWp3BceLYocazWJgusZt7CgecIq57ycM5hjM93BvlrUJ8nQ1a46wfL/8 Cy4P0et70hzZrsjjN41KFhKY0iUwlyU41yEiDHvHDDsTMBxAZosWjSREGfJL6Mfp XOInTHs/Gg6DZMkbxjQu6L06EdJ+Q/NwglJdAXM7Zo9rNELqRig6DdvG5JesdMsO +QIDAQAB -----END PUBLIC KEY-----""") # In: {"signed":"eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1MTYyMzkwMjIsIm1vb2QiOiJEaXNkYWluZnVsIiwic3ViIjoiMTIzNDU2Nzg5MCJ9.rsMp_X5HMrUqKnZJIxo27aAoscovRA6SSQYR9rq7pifIj0YHXxMyNyOBDGnvVALHKTi25VUGHpfNUW0VVMmae0A4t_ObNU6hVZHguWvetKZZq4FZpW1lgWHCMqgPGwT5_uOqwYCH6r8tJuZT3pqXeL0CY4putb1AN2w6CVp620nh3l8d3XWb4jaifycd_4CEVCqHuWDmohfug4VhmoVKlIXZkYoAQowgHlozATDssBSWdYtv107Wd2AzEoiXPu6e3pflsuXULlyqQnS4ELEKPYThFLafh1NqvZDPddqozcPZ-iODBW-xf3A4DYDdivnMYLrh73AZOGHexxu8ay6nDA"} # Out: {"claims":{"iat":1516239022,"mood":"Disdainful","sub":"1234567890"}} ``` ### sign_jwt_es256 Hash and sign an object representing JSON Web Token (JWT) claims using ES256. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The secret to use for signing the token. | | `headers` (optional) | `unknown` | Optional object of JWT header fields to include in the token. Keys "alg", "typ", "jku", "jwk", "x5u", "x5c", "x5t","x5t#S256" and "crit" will be ignored if provided. | #### Examples ```bloblang root.signed = this.claims.sign_jwt_es256("""-----BEGIN EC PRIVATE KEY----- ... signature data ... -----END EC PRIVATE KEY-----""") # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ```bloblang root.signed = this.claims.sign_jwt_es256(signing_secret: """-----BEGIN EC PRIVATE KEY----- ... signature data ... -----END EC PRIVATE KEY-----""", headers: {"kid": "my-key", "x": "y"}) # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ### sign_jwt_es384 Hash and sign an object representing JSON Web Token (JWT) claims using ES384. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The secret to use for signing the token. | | `headers` (optional) | `unknown` | Optional object of JWT header fields to include in the token. Keys "alg", "typ", "jku", "jwk", "x5u", "x5c", "x5t","x5t#S256" and "crit" will be ignored if provided. | #### Examples ```bloblang root.signed = this.claims.sign_jwt_es384("""-----BEGIN EC PRIVATE KEY----- ... signature data ... -----END EC PRIVATE KEY-----""") # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ```bloblang root.signed = this.claims.sign_jwt_es384(signing_secret: """-----BEGIN EC PRIVATE KEY----- ... signature data ... -----END EC PRIVATE KEY-----""", headers: {"kid": "my-key", "x": "y"}) # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ### sign_jwt_es512 Hash and sign an object representing JSON Web Token (JWT) claims using ES512. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The secret to use for signing the token. | | `headers` (optional) | `unknown` | Optional object of JWT header fields to include in the token. Keys "alg", "typ", "jku", "jwk", "x5u", "x5c", "x5t","x5t#S256" and "crit" will be ignored if provided. | #### Examples ```bloblang root.signed = this.claims.sign_jwt_es512("""-----BEGIN EC PRIVATE KEY----- ... signature data ... -----END EC PRIVATE KEY-----""") # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ```bloblang root.signed = this.claims.sign_jwt_es512(signing_secret: """-----BEGIN EC PRIVATE KEY----- ... signature data ... -----END EC PRIVATE KEY-----""", headers: {"kid": "my-key", "x": "y"}) # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ### sign_jwt_hs256 Hash and sign an object representing JSON Web Token (JWT) claims using HS256. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The secret to use for signing the token. | | `headers` (optional) | `unknown` | Optional object of JWT header fields to include in the token. Keys "alg", "typ", "jku", "jwk", "x5u", "x5c", "x5t","x5t#S256" and "crit" will be ignored if provided. | #### Examples ```bloblang root.signed = this.claims.sign_jwt_hs256("""dont-tell-anyone""") # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ```bloblang root.signed = this.claims.sign_jwt_hs256(signing_secret: """dont-tell-anyone""", headers: {"kid": "my-key", "x": "y"}) # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ### sign_jwt_hs384 Hash and sign an object representing JSON Web Token (JWT) claims using HS384. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The secret to use for signing the token. | | `headers` (optional) | `unknown` | Optional object of JWT header fields to include in the token. Keys "alg", "typ", "jku", "jwk", "x5u", "x5c", "x5t","x5t#S256" and "crit" will be ignored if provided. | #### Examples ```bloblang root.signed = this.claims.sign_jwt_hs384("""dont-tell-anyone""") # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ```bloblang root.signed = this.claims.sign_jwt_hs384(signing_secret: """dont-tell-anyone""", headers: {"kid": "my-key", "x": "y"}) # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ### sign_jwt_hs512 Hash and sign an object representing JSON Web Token (JWT) claims using HS512. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The secret to use for signing the token. | | `headers` (optional) | `unknown` | Optional object of JWT header fields to include in the token. Keys "alg", "typ", "jku", "jwk", "x5u", "x5c", "x5t","x5t#S256" and "crit" will be ignored if provided. | #### Examples ```bloblang root.signed = this.claims.sign_jwt_hs512("""dont-tell-anyone""") # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ```bloblang root.signed = this.claims.sign_jwt_hs512(signing_secret: """dont-tell-anyone""", headers: {"kid": "my-key", "x": "y"}) # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ### sign_jwt_rs256 Hash and sign an object representing JSON Web Token (JWT) claims using RS256. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The secret to use for signing the token. | | `headers` (optional) | `unknown` | Optional object of JWT header fields to include in the token. Keys "alg", "typ", "jku", "jwk", "x5u", "x5c", "x5t","x5t#S256" and "crit" will be ignored if provided. | #### Examples ```bloblang root.signed = this.claims.sign_jwt_rs256("""-----BEGIN RSA PRIVATE KEY----- ... signature data ... -----END RSA PRIVATE KEY-----""") # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ```bloblang root.signed = this.claims.sign_jwt_rs256(signing_secret: """-----BEGIN RSA PRIVATE KEY----- ... signature data ... -----END RSA PRIVATE KEY-----""", headers: {"kid": "my-key", "x": "y"}) # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ### sign_jwt_rs384 Hash and sign an object representing JSON Web Token (JWT) claims using RS384. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The secret to use for signing the token. | | `headers` (optional) | `unknown` | Optional object of JWT header fields to include in the token. Keys "alg", "typ", "jku", "jwk", "x5u", "x5c", "x5t","x5t#S256" and "crit" will be ignored if provided. | #### Examples ```bloblang root.signed = this.claims.sign_jwt_rs384("""-----BEGIN RSA PRIVATE KEY----- ... signature data ... -----END RSA PRIVATE KEY-----""") # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ```bloblang root.signed = this.claims.sign_jwt_rs384(signing_secret: """-----BEGIN RSA PRIVATE KEY----- ... signature data ... -----END RSA PRIVATE KEY-----""", headers: {"kid": "my-key", "x": "y"}) # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ### sign_jwt_rs512 Hash and sign an object representing JSON Web Token (JWT) claims using RS512. #### Parameters | Name | Type | Description | | --- | --- | --- | | `signing_secret` | `string` | The secret to use for signing the token. | | `headers` (optional) | `unknown` | Optional object of JWT header fields to include in the token. Keys "alg", "typ", "jku", "jwk", "x5u", "x5c", "x5t","x5t#S256" and "crit" will be ignored if provided. | #### Examples ```bloblang root.signed = this.claims.sign_jwt_rs512("""-----BEGIN RSA PRIVATE KEY----- ... signature data ... -----END RSA PRIVATE KEY-----""") # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ```bloblang root.signed = this.claims.sign_jwt_rs512(signing_secret: """-----BEGIN RSA PRIVATE KEY----- ... signature data ... -----END RSA PRIVATE KEY-----""", headers: {"kid": "my-key", "x": "y"}) # In: {"claims":{"sub":"user123"}} # Out: {"signed":""} ``` ## Number manipulation ### abs Returns the absolute value of an int64 or float64 number. As a special case, when an integer is provided that is the minimum value it is converted to the maximum value. #### Examples ```bloblang root.outs = this.ins.map_each(ele -> ele.abs()) # In: {"ins":[9,-18,1.23,-4.56]} # Out: {"outs":[9,18,1.23,4.56]} ``` ### bitwise_and Performs a bitwise AND operation between the integer and the specified value. #### Parameters | Name | Type | Description | | --- | --- | --- | | `value` | `integer` | The value to AND with | #### Examples ```bloblang root.new_value = this.value.bitwise_and(6) # In: {"value":12} # Out: {"new_value":4} ``` ```bloblang root.masked = this.flags.bitwise_and(15) # In: {"flags":127} # Out: {"masked":15} ``` ### bitwise_or Performs a bitwise OR operation between the integer and the specified value. #### Parameters | Name | Type | Description | | --- | --- | --- | | `value` | `integer` | The value to OR with | #### Examples ```bloblang root.new_value = this.value.bitwise_or(6) # In: {"value":12} # Out: {"new_value":14} ``` ```bloblang root.combined = this.flags.bitwise_or(8) # In: {"flags":4} # Out: {"combined":12} ``` ### bitwise_xor Performs a bitwise XOR (exclusive OR) operation between the integer and the specified value. #### Parameters | Name | Type | Description | | --- | --- | --- | | `value` | `integer` | The value to XOR with | #### Examples ```bloblang root.new_value = this.value.bitwise_xor(6) # In: {"value":12} # Out: {"new_value":10} ``` ```bloblang root.toggled = this.flags.bitwise_xor(5) # In: {"flags":3} # Out: {"toggled":6} ``` ### ceil Rounds a number up to the nearest integer. Returns an integer if the result fits in 64-bit, otherwise returns a float. #### Examples ```bloblang root.new_value = this.value.ceil() # In: {"value":5.3} # Out: {"new_value":6} # In: {"value":-5.9} # Out: {"new_value":-5} ``` ```bloblang root.result = this.price.ceil() # In: {"price":19.99} # Out: {"result":20} ``` ### cos Calculates the cosine of a given angle specified in radians. #### Examples ```bloblang root.new_value = (this.value * (pi() / 180)).cos() # In: {"value":45} # Out: {"new_value":0.7071067811865476} # In: {"value":0} # Out: {"new_value":1} # In: {"value":180} # Out: {"new_value":-1} ``` ### float32 Converts a numerical type into a 32-bit floating point number, this is for advanced use cases where a specific data type is needed for a given component (such as the ClickHouse SQL driver). If the value is a string then an attempt will be made to parse it as a 32-bit floating point number. Please refer to the [`strconv.ParseFloat` documentation](https://pkg.go.dev/strconv#ParseFloat) for details regarding the supported formats. #### Examples ```bloblang root.out = this.in.float32() # In: {"in":"6.674282313423543523453425345e-11"} # Out: {"out":6.674283e-11} ``` ### float64 Converts a numerical type into a 64-bit floating point number, this is for advanced use cases where a specific data type is needed for a given component (such as the ClickHouse SQL driver). If the value is a string then an attempt will be made to parse it as a 64-bit floating point number. Please refer to the [`strconv.ParseFloat` documentation](https://pkg.go.dev/strconv#ParseFloat) for details regarding the supported formats. #### Examples ```bloblang root.out = this.in.float64() # In: {"in":"6.674282313423543523453425345e-11"} # Out: {"out":6.674282313423544e-11} ``` ### floor Rounds a number down to the nearest integer. Returns an integer if the result fits in 64-bit, otherwise returns a float. #### Examples ```bloblang root.new_value = this.value.floor() # In: {"value":5.7} # Out: {"new_value":5} # In: {"value":-3.2} # Out: {"new_value":-4} ``` ```bloblang root.whole_seconds = this.duration_seconds.floor() # In: {"duration_seconds":12.345} # Out: {"whole_seconds":12} ``` ### int16 Converts a numerical type into a 16-bit signed integer, this is for advanced use cases where a specific data type is needed for a given component (such as the ClickHouse SQL driver). If the value is a string then an attempt will be made to parse it as a 16-bit signed integer. If the target value exceeds the capacity of an integer or contains decimal values then this method will throw an error. In order to convert a floating point number containing decimals first use [`.round()`](#round) on the value. Please refer to the [`strconv.ParseInt` documentation](https://pkg.go.dev/strconv#ParseInt) for details regarding the supported formats. #### Examples ```bloblang root.a = this.a.int16() root.b = this.b.round().int16() root.c = this.c.int16() root.d = this.d.int16().catch(0) # In: {"a":12,"b":12.34,"c":"12","d":-12} # Out: {"a":12,"b":12,"c":12,"d":-12} ``` ```bloblang root = this.int16() # In: "0xDE" # Out: 222 ``` ### int32 Converts a numerical type into a 32-bit signed integer, this is for advanced use cases where a specific data type is needed for a given component (such as the ClickHouse SQL driver). If the value is a string then an attempt will be made to parse it as a 32-bit signed integer. If the target value exceeds the capacity of an integer or contains decimal values then this method will throw an error. In order to convert a floating point number containing decimals first use [`.round()`](#round) on the value. Please refer to the [`strconv.ParseInt` documentation](https://pkg.go.dev/strconv#ParseInt) for details regarding the supported formats. #### Examples ```bloblang root.a = this.a.int32() root.b = this.b.round().int32() root.c = this.c.int32() root.d = this.d.int32().catch(0) # In: {"a":12,"b":12.34,"c":"12","d":-12} # Out: {"a":12,"b":12,"c":12,"d":-12} ``` ```bloblang root = this.int32() # In: "0xDEAD" # Out: 57005 ``` ### int64 Converts a numerical type into a 64-bit signed integer, this is for advanced use cases where a specific data type is needed for a given component (such as the ClickHouse SQL driver). If the value is a string then an attempt will be made to parse it as a 64-bit signed integer. If the target value exceeds the capacity of an integer or contains decimal values then this method will throw an error. In order to convert a floating point number containing decimals first use [`.round()`](#round) on the value. Please refer to the [`strconv.ParseInt` documentation](https://pkg.go.dev/strconv#ParseInt) for details regarding the supported formats. #### Examples ```bloblang root.a = this.a.int64() root.b = this.b.round().int64() root.c = this.c.int64() root.d = this.d.int64().catch(0) # In: {"a":12,"b":12.34,"c":"12","d":-12} # Out: {"a":12,"b":12,"c":12,"d":-12} ``` ```bloblang root = this.int64() # In: "0xDEADBEEF" # Out: 3735928559 ``` ### int8 Converts a numerical type into a 8-bit signed integer, this is for advanced use cases where a specific data type is needed for a given component (such as the ClickHouse SQL driver). If the value is a string then an attempt will be made to parse it as a 8-bit signed integer. If the target value exceeds the capacity of an integer or contains decimal values then this method will throw an error. In order to convert a floating point number containing decimals first use [`.round()`](#round) on the value. Please refer to the [`strconv.ParseInt` documentation](https://pkg.go.dev/strconv#ParseInt) for details regarding the supported formats. #### Examples ```bloblang root.a = this.a.int8() root.b = this.b.round().int8() root.c = this.c.int8() root.d = this.d.int8().catch(0) # In: {"a":12,"b":12.34,"c":"12","d":-12} # Out: {"a":12,"b":12,"c":12,"d":-12} ``` ```bloblang root = this.int8() # In: "0xD" # Out: 13 ``` ### log Calculates the natural logarithm (base e) of a number. #### Examples ```bloblang root.new_value = this.value.log().round() # In: {"value":1} # Out: {"new_value":0} # In: {"value":2.7183} # Out: {"new_value":1} ``` ```bloblang root.ln_result = this.number.log() # In: {"number":10} # Out: {"ln_result":2.302585092994046} ``` ### log10 Calculates the base-10 logarithm of a number. #### Examples ```bloblang root.new_value = this.value.log10() # In: {"value":100} # Out: {"new_value":2} # In: {"value":1000} # Out: {"new_value":3} ``` ```bloblang root.log_value = this.magnitude.log10() # In: {"magnitude":10000} # Out: {"log_value":4} ``` ### max Returns the largest number from an array. All elements must be numbers and the array cannot be empty. #### Examples ```bloblang root.biggest = this.values.max() # In: {"values":[0,3,2.5,7,5]} # Out: {"biggest":7} ``` ```bloblang root.highest_temp = this.temperatures.max() # In: {"temperatures":[20.5,22.1,19.8,23.4]} # Out: {"highest_temp":23.4} ``` ### min Returns the smallest number from an array. All elements must be numbers and the array cannot be empty. #### Examples ```bloblang root.smallest = this.values.min() # In: {"values":[0,3,-2.5,7,5]} # Out: {"smallest":-2.5} ``` ```bloblang root.lowest_temp = this.temperatures.min() # In: {"temperatures":[20.5,22.1,19.8,23.4]} # Out: {"lowest_temp":19.8} ``` ### pow Returns the number raised to the specified exponent. #### Parameters | Name | Type | Description | | --- | --- | --- | | `exponent` | `float` | The exponent you want to raise to the power of. | #### Examples ```bloblang root.new_value = this.value * 10.pow(-2) # In: {"value":2} # Out: {"new_value":0.02} ``` ```bloblang root.new_value = this.value.pow(-2) # In: {"value":2} # Out: {"new_value":0.25} ``` ### round Rounds a number to the nearest integer. Values at .5 round away from zero. Returns an integer if the result fits in 64-bit, otherwise returns a float. #### Examples ```bloblang root.new_value = this.value.round() # In: {"value":5.3} # Out: {"new_value":5} # In: {"value":5.9} # Out: {"new_value":6} ``` ```bloblang root.rounded = this.score.round() # In: {"score":87.5} # Out: {"rounded":88} ``` ### sin Calculates the sine of a given angle specified in radians. #### Examples ```bloblang root.new_value = (this.value * (pi() / 180)).sin() # In: {"value":45} # Out: {"new_value":0.7071067811865475} # In: {"value":0} # Out: {"new_value":0} # In: {"value":90} # Out: {"new_value":1} ``` ### tan Calculates the tangent of a given angle specified in radians. #### Examples ```bloblang root.new_value = "%f".format((this.value * (pi() / 180)).tan()) # In: {"value":0} # Out: {"new_value":"0.000000"} # In: {"value":45} # Out: {"new_value":"1.000000"} # In: {"value":180} # Out: {"new_value":"-0.000000"} ``` ### uint16 Converts a numerical type into a 16-bit unsigned integer, this is for advanced use cases where a specific data type is needed for a given component (such as the ClickHouse SQL driver). If the value is a string then an attempt will be made to parse it as a 16-bit unsigned integer. If the target value exceeds the capacity of an integer or contains decimal values then this method will throw an error. In order to convert a floating point number containing decimals first use [`.round()`](#round) on the value. Please refer to the [`strconv.ParseInt` documentation](https://pkg.go.dev/strconv#ParseInt) for details regarding the supported formats. #### Examples ```bloblang root.a = this.a.uint16() root.b = this.b.round().uint16() root.c = this.c.uint16() root.d = this.d.uint16().catch(0) # In: {"a":12,"b":12.34,"c":"12","d":-12} # Out: {"a":12,"b":12,"c":12,"d":0} ``` ```bloblang root = this.uint16() # In: "0xDE" # Out: 222 ``` ### uint32 Converts a numerical type into a 32-bit unsigned integer, this is for advanced use cases where a specific data type is needed for a given component (such as the ClickHouse SQL driver). If the value is a string then an attempt will be made to parse it as a 32-bit unsigned integer. If the target value exceeds the capacity of an integer or contains decimal values then this method will throw an error. In order to convert a floating point number containing decimals first use [`.round()`](#round) on the value. Please refer to the [`strconv.ParseInt` documentation](https://pkg.go.dev/strconv#ParseInt) for details regarding the supported formats. #### Examples ```bloblang root.a = this.a.uint32() root.b = this.b.round().uint32() root.c = this.c.uint32() root.d = this.d.uint32().catch(0) # In: {"a":12,"b":12.34,"c":"12","d":-12} # Out: {"a":12,"b":12,"c":12,"d":0} ``` ```bloblang root = this.uint32() # In: "0xDEAD" # Out: 57005 ``` ### uint64 Converts a numerical type into a 64-bit unsigned integer, this is for advanced use cases where a specific data type is needed for a given component (such as the ClickHouse SQL driver). If the value is a string then an attempt will be made to parse it as a 64-bit unsigned integer. If the target value exceeds the capacity of an integer or contains decimal values then this method will throw an error. In order to convert a floating point number containing decimals first use [`.round()`](#round) on the value. Please refer to the [`strconv.ParseInt` documentation](https://pkg.go.dev/strconv#ParseInt) for details regarding the supported formats. #### Examples ```bloblang root.a = this.a.uint64() root.b = this.b.round().uint64() root.c = this.c.uint64() root.d = this.d.uint64().catch(0) # In: {"a":12,"b":12.34,"c":"12","d":-12} # Out: {"a":12,"b":12,"c":12,"d":0} ``` ```bloblang root = this.uint64() # In: "0xDEADBEEF" # Out: 3735928559 ``` ### uint8 Converts a numerical type into a 8-bit unsigned integer, this is for advanced use cases where a specific data type is needed for a given component (such as the ClickHouse SQL driver). If the value is a string then an attempt will be made to parse it as a 8-bit unsigned integer. If the target value exceeds the capacity of an integer or contains decimal values then this method will throw an error. In order to convert a floating point number containing decimals first use [`.round()`](#round) on the value. Please refer to the [`strconv.ParseInt` documentation](https://pkg.go.dev/strconv#ParseInt) for details regarding the supported formats. #### Examples ```bloblang root.a = this.a.uint8() root.b = this.b.round().uint8() root.c = this.c.uint8() root.d = this.d.uint8().catch(0) # In: {"a":12,"b":12.34,"c":"12","d":-12} # Out: {"a":12,"b":12,"c":12,"d":0} ``` ```bloblang root = this.uint8() # In: "0xD" # Out: 13 ``` ## Object & array manipulation ### all Tests whether all elements in an array satisfy a condition. Returns true only if the query evaluates to true for every element. Returns false for empty arrays. #### Parameters | Name | Type | Description | | --- | --- | --- | | `test` | `query expression` | A test query to apply to each element. | #### Examples ```bloblang root.all_over_21 = this.patrons.all(patron -> patron.age >= 21) # In: {"patrons":[{"id":"1","age":18},{"id":"2","age":23}]} # Out: {"all_over_21":false} # In: {"patrons":[{"id":"1","age":45},{"id":"2","age":23}]} # Out: {"all_over_21":true} ``` ```bloblang root.all_positive = this.values.all(v -> v > 0) # In: {"values":[1,2,3,4,5]} # Out: {"all_positive":true} # In: {"values":[1,-2,3,4,5]} # Out: {"all_positive":false} ``` ### any Tests whether at least one element in an array satisfies a condition. Returns true if the query evaluates to true for any element. Returns false for empty arrays. #### Parameters | Name | Type | Description | | --- | --- | --- | | `test` | `query expression` | A test query to apply to each element. | #### Examples ```bloblang root.any_over_21 = this.patrons.any(patron -> patron.age >= 21) # In: {"patrons":[{"id":"1","age":18},{"id":"2","age":23}]} # Out: {"any_over_21":true} # In: {"patrons":[{"id":"1","age":10},{"id":"2","age":12}]} # Out: {"any_over_21":false} ``` ```bloblang root.has_errors = this.results.any(r -> r.status == "error") # In: {"results":[{"status":"ok"},{"status":"error"},{"status":"ok"}]} # Out: {"has_errors":true} # In: {"results":[{"status":"ok"},{"status":"ok"}]} # Out: {"has_errors":false} ``` ### append Adds one or more elements to the end of an array and returns the new array. The original array is not modified. #### Parameters This method accepts any number of arguments. #### Examples ```bloblang root.foo = this.foo.append("and", "this") # In: {"foo":["bar","baz"]} # Out: {"foo":["bar","baz","and","this"]} ``` ```bloblang root.combined = this.items.append(this.new_item) # In: {"items":["apple","banana"],"new_item":"orange"} # Out: {"combined":["apple","banana","orange"]} ``` ### assign Merges two objects or arrays with override behavior. For objects, source values replace destination values on key conflicts. Arrays are concatenated. To preserve both values on conflict, use the merge method instead. #### Parameters | Name | Type | Description | | --- | --- | --- | | `with` | `unknown` | A value to merge the target value with. | #### Examples ```bloblang root = this.foo.assign(this.bar) # In: {"foo":{"first_name":"fooer","likes":"bars"},"bar":{"second_name":"barer","likes":"foos"}} # Out: {"first_name":"fooer","likes":"foos","second_name":"barer"} ``` Override defaults with user settings: ```bloblang root.config = this.defaults.assign(this.user_settings) # In: {"defaults":{"timeout":30,"retries":3},"user_settings":{"timeout":60}} # Out: {"config":{"retries":3,"timeout":60}} ``` ### collapse Flattens a nested structure into a single-level object with dot-notation keys representing the full path to each value. Empty arrays and objects are excluded by default. #### Parameters | Name | Type | Description | | --- | --- | --- | | `include_empty` (optional) | `bool` | Whether to include empty objects and arrays in the resulting object. Default: `false`. | #### Examples ```bloblang root.result = this.collapse() # In: {"foo":[{"bar":"1"},{"bar":{}},{"bar":"2"},{"bar":[]}]} # Out: {"result":{"foo.0.bar":"1","foo.2.bar":"2"}} ``` Set include_empty to true to preserve empty objects and arrays in the output: ```bloblang root.result = this.collapse(include_empty: true) # In: {"foo":[{"bar":"1"},{"bar":{}},{"bar":"2"},{"bar":[]}]} # Out: {"result":{"foo.0.bar":"1","foo.1.bar":{},"foo.2.bar":"2","foo.3.bar":[]}} ``` ### concat Concatenates an array value with one or more argument arrays. #### Parameters This method accepts any number of arguments. #### Examples ```bloblang root.foo = this.foo.concat(this.bar, this.baz) # In: {"foo":["a","b"],"bar":["c"],"baz":["d","e","f"]} # Out: {"foo":["a","b","c","d","e","f"]} ``` ### contains Checks whether an array contains an element matching the argument, or an object contains a value matching the argument, and returns a boolean result. Numerical comparisons are made irrespective of the representation type (float versus integer). #### Parameters | Name | Type | Description | | --- | --- | --- | | `value` | `unknown` | A value to test against elements of the target. | #### Examples ```bloblang root.has_foo = this.thing.contains("foo") # In: {"thing":["this","foo","that"]} # Out: {"has_foo":true} # In: {"thing":["this","bar","that"]} # Out: {"has_foo":false} ``` ```bloblang root.has_bar = this.thing.contains(20) # In: {"thing":[10.3,20.0,"huh",3]} # Out: {"has_bar":true} # In: {"thing":[2,3,40,67]} # Out: {"has_bar":false} ``` ### diff Compares the current value with another value and returns a detailed changelog describing all differences. The changelog contains operations (create, update, delete) with their paths and values, enabling you to track changes between data versions, implement audit logs, or synchronize data between systems. #### Parameters | Name | Type | Description | | --- | --- | --- | | `other` | `unknown` | The value to compare against the current value. Can be any structured data (object or array). | #### Examples Compare two objects to track field changes: ```bloblang root.changes = this.before.diff(this.after) # In: {"before":{"name":"Alice","age":30},"after":{"name":"Alice","age":31,"city":"NYC"}} # Out: {"changes":[{"From":30,"Path":["age"],"To":31,"Type":"update"},{"From":null,"Path":["city"],"To":"NYC","Type":"create"}]} ``` Detect deletions in configuration changes: ```bloblang root.changelog = this.old_config.diff(this.new_config) # In: {"old_config":{"debug":true,"timeout":30},"new_config":{"timeout":60}} # Out: {"changelog":[{"From":true,"Path":["debug"],"To":null,"Type":"delete"},{"From":30,"Path":["timeout"],"To":60,"Type":"update"}]} ``` ### enumerated Transforms an array into an array of objects with index and value fields, making it easy to access both the position and content of each element. #### Examples ```bloblang root.foo = this.foo.enumerated() # In: {"foo":["bar","baz"]} # Out: {"foo":[{"index":0,"value":"bar"},{"index":1,"value":"baz"}]} ``` Useful for filtering by index position: ```bloblang root.first_two = this.items.enumerated().filter(item -> item.index < 2).map_each(item -> item.value) # In: {"items":["a","b","c","d"]} # Out: {"first_two":["a","b"]} ``` ### exists Checks whether a field exists at the specified dot path within an object. Returns true if the field is present (even if null), false otherwise. #### Parameters | Name | Type | Description | | --- | --- | --- | | `path` | `string` | A [dot path](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/field_paths/) to a field. | #### Examples ```bloblang root.result = this.foo.exists("bar.baz") # In: {"foo":{"bar":{"baz":"yep, I exist"}}} # Out: {"result":true} # In: {"foo":{"bar":{}}} # Out: {"result":false} # In: {"foo":{}} # Out: {"result":false} ``` Also returns true for null values if the field exists: ```bloblang root.has_field = this.data.exists("optional_field") # In: {"data":{"optional_field":null}} # Out: {"has_field":true} # In: {"data":{}} # Out: {"has_field":false} ``` ### explode Expands a nested array or object field into multiple documents, distributing elements while preserving the surrounding structure. Useful for denormalizing data. #### Parameters | Name | Type | Description | | --- | --- | --- | | `path` | `string` | A [dot path](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/field_paths/) to a field to explode. | #### Examples ##### On arrays When exploding an array, each element becomes a separate document with the array element replacing the original field: ```bloblang root = this.explode("value") # In: {"id":1,"value":["foo","bar","baz"]} # Out: [{"id":1,"value":"foo"},{"id":1,"value":"bar"},{"id":1,"value":"baz"}] ``` ##### On objects When exploding an object, the output keys match the nested object’s keys, with values being the full document where the target field is replaced by each nested value: ```bloblang root = this.explode("value") # In: {"id":1,"value":{"foo":2,"bar":[3,4],"baz":{"bev":5}}} # Out: {"bar":{"id":1,"value":[3,4]},"baz":{"id":1,"value":{"bev":5}},"foo":{"id":1,"value":2}} ``` ### filter Returns a new array or object containing only elements that satisfy the provided condition. Elements for which the query returns true are kept, all others are removed. #### Parameters | Name | Type | Description | | --- | --- | --- | | `test` | `query expression` | A query to apply to each element, if this query resolves to any value other than a boolean `true` the element will be removed from the result. | #### Examples ```bloblang root.new_nums = this.nums.filter(num -> num > 10) # In: {"nums":[3,11,4,17]} # Out: {"new_nums":[11,17]} ``` ##### On objects When filtering objects, the query receives a context with `key` and `value` fields for each entry: ```bloblang root.new_dict = this.dict.filter(item -> item.value.contains("foo")) # In: {"dict":{"first":"hello foo","second":"world","third":"this foo is great"}} # Out: {"new_dict":{"first":"hello foo","third":"this foo is great"}} ``` ### find > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Searches an array for a matching value and returns the index of the first occurrence. Returns -1 if no match is found. Numeric types are compared by value regardless of representation. #### Parameters | Name | Type | Description | | --- | --- | --- | | `value` | `unknown` | A value to find. | #### Examples ```bloblang root.index = this.find("bar") # In: ["foo", "bar", "baz"] # Out: {"index":1} ``` ```bloblang root.index = this.things.find(this.goal) # In: {"goal":"bar","things":["foo", "bar", "baz"]} # Out: {"index":1} ``` ### find_all > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Searches an array for all occurrences of a value and returns an array of matching indexes. Returns an empty array if no matches are found. Numeric types are compared by value regardless of representation. #### Parameters | Name | Type | Description | | --- | --- | --- | | `value` | `unknown` | A value to find. | #### Examples ```bloblang root.index = this.find_all("bar") # In: ["foo", "bar", "baz", "bar"] # Out: {"index":[1,3]} ``` ```bloblang root.indexes = this.things.find_all(this.goal) # In: {"goal":"bar","things":["foo", "bar", "baz", "bar", "buz"]} # Out: {"indexes":[1,3]} ``` ### find_all_by > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Searches an array for all elements that satisfy a condition and returns an array of their indexes. Returns an empty array if no elements match. #### Parameters | Name | Type | Description | | --- | --- | --- | | `query` | `query expression` | A query to execute for each element. | #### Examples ```bloblang root.index = this.find_all_by(v -> v != "bar") # In: ["foo", "bar", "baz"] # Out: {"index":[0,2]} ``` Find all indexes matching criteria: ```bloblang root.error_indexes = this.logs.find_all_by(log -> log.level == "error") # In: {"logs":[{"level":"info"},{"level":"error"},{"level":"warn"},{"level":"error"}]} # Out: {"error_indexes":[1,3]} ``` ### find_by > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Searches an array for the first element that satisfies a condition and returns its index. Returns -1 if no element matches the query. #### Parameters | Name | Type | Description | | --- | --- | --- | | `query` | `query expression` | A query to execute for each element. | #### Examples ```bloblang root.index = this.find_by(v -> v != "bar") # In: ["foo", "bar", "baz"] # Out: {"index":0} ``` Find first object matching criteria: ```bloblang root.first_adult = this.users.find_by(u -> u.age >= 18) # In: {"users":[{"name":"Alice","age":15},{"name":"Bob","age":22},{"name":"Carol","age":19}]} # Out: {"first_adult":1} ``` ### flatten Flattens an array by one level, expanding nested arrays into the parent array. Only the first level of nesting is removed. #### Examples ```bloblang root.result = this.flatten() # In: ["foo",["bar","baz"],"buz"] # Out: {"result":["foo","bar","baz","buz"]} ``` Deeper nesting requires multiple flatten calls: ```bloblang root.result = this.data.flatten() # In: {"data":["a",["b",["c","d"]],"e"]} # Out: {"result":["a","b",["c","d"],"e"]} ``` ### fold Reduces an array to a single value by iteratively applying a function. Also known as reduce or aggregate. The query receives an accumulator (tally) and current element (value) for each iteration. #### Parameters | Name | Type | Description | | --- | --- | --- | | `initial` | `unknown` | The initial value to start the fold with. For example, an empty object `{}`, a zero count `0`, or an empty string `""`. | | `query` | `query expression` | A query to apply for each element. The query is provided an object with two fields; `tally` containing the current tally, and `value` containing the value of the current element. The query should result in a new tally to be passed to the next element query. | #### Examples Sum numbers in an array: ```bloblang root.sum = this.foo.fold(0, item -> item.tally + item.value) # In: {"foo":[3,8,11]} # Out: {"sum":22} ``` Concatenate strings: ```bloblang root.result = this.foo.fold("", item -> "%v%v".format(item.tally, item.value)) # In: {"foo":["hello ", "world"]} # Out: {"result":"hello world"} ``` Merge an array of objects into a single object: ```bloblang root.smoothie = this.fruits.fold({}, item -> item.tally.merge(item.value)) # In: {"fruits":[{"apple":5},{"banana":3},{"orange":8}]} # Out: {"smoothie":{"apple":5,"banana":3,"orange":8}} ``` ### get Extract a field value, identified via a [dot path](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/field_paths/), from an object. #### Parameters | Name | Type | Description | | --- | --- | --- | | `path` | `string` | A [dot path](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/field_paths/) identifying a field to obtain. | #### Examples ```bloblang root.result = this.foo.get(this.target) # In: {"foo":{"bar":"from bar","baz":"from baz"},"target":"bar"} # Out: {"result":"from bar"} # In: {"foo":{"bar":"from bar","baz":"from baz"},"target":"baz"} # Out: {"result":"from baz"} ``` ### index Extract an element from an array by an index. The index can be negative, and if so the element will be selected from the end counting backwards starting from -1. E.g. an index of -1 returns the last element, an index of -2 returns the element before the last, and so on. #### Parameters | Name | Type | Description | | --- | --- | --- | | `index` | `integer` | The index to obtain from an array. | #### Examples ```bloblang root.last_name = this.names.index(-1) # In: {"names":["rachel","stevens"]} # Out: {"last_name":"stevens"} ``` It is also possible to use this method on byte arrays, in which case the selected element will be returned as an integer: ```bloblang root.last_byte = this.name.bytes().index(-1) # In: {"name":"foobar bazson"} # Out: {"last_byte":110} ``` ### join Concatenates an array of strings into a single string with an optional delimiter between elements. Use for building CSV strings, URLs, or combining text fragments. #### Parameters | Name | Type | Description | | --- | --- | --- | | `delimiter` (optional) | `string` | An optional delimiter to add between each string. | #### Examples ```bloblang root.joined_words = this.words.join() root.joined_numbers = this.numbers.map_each(this.string()).join(",") # In: {"words":["hello","world"],"numbers":[3,8,11]} # Out: {"joined_numbers":"3,8,11","joined_words":"helloworld"} ``` ### json_path Executes the given JSONPath expression on an object or array and returns the result. The JSONPath expression syntax can be found at [https://goessner.net/articles/JsonPath/](https://goessner.net/articles/JsonPath/). For more complex logic, you can use Gval expressions ([https://github.com/PaesslerAG/gval](https://github.com/PaesslerAG/gval)). #### Parameters | Name | Type | Description | | --- | --- | --- | | `expression` | `string` | The JSONPath expression to execute. | #### Examples ```bloblang root.all_names = this.json_path("$..name") # In: {"name":"alice","foo":{"name":"bob"}} # Out: {"all_names":["alice","bob"]} # In: {"thing":["this","bar",{"name":"alice"}]} # Out: {"all_names":["alice"]} ``` ```bloblang root.text_objects = this.json_path("$.body[?(@.type=='text')]") # In: {"body":[{"type":"image","id":"foo"},{"type":"text","id":"bar"}]} # Out: {"text_objects":[{"id":"bar","type":"text"}]} ``` ### json_schema > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Checks a [JSON schema](https://json-schema.org/) against a value and returns the value if it matches or throws an error if it does not. To load the schema from a file, pass it the result of the `file` function, which isn’t available in Redpanda Cloud. #### Parameters | Name | Type | Description | | --- | --- | --- | | `schema` | `string` | The schema to check values against. | #### Examples ```bloblang root = this.json_schema("""{ "type":"object", "properties":{ "foo":{ "type":"string" } } }""") # In: {"foo":"bar"} # Out: {"foo":"bar"} # In: {"foo":5} # Out: Error("failed assignment (line 1): field `this`: foo invalid type. expected: string, given: integer") ``` ### key_values Converts an object into an array of key-value pair objects. Each element has a 'key' field and a 'value' field. Order is not guaranteed unless sorted. #### Examples ```bloblang root.foo_key_values = this.foo.key_values().sort_by(pair -> pair.key) # In: {"foo":{"bar":1,"baz":2}} # Out: {"foo_key_values":[{"key":"bar","value":1},{"key":"baz","value":2}]} ``` Filter object entries by value: ```bloblang root.large_items = this.items.key_values().filter(pair -> pair.value > 15).map_each(pair -> pair.key) # In: {"items":{"a":5,"b":15,"c":20,"d":3}} # Out: {"large_items":["c"]} ``` ### keys Extracts all keys from an object and returns them as a sorted array. #### Examples ```bloblang root.foo_keys = this.foo.keys() # In: {"foo":{"bar":1,"baz":2}} # Out: {"foo_keys":["bar","baz"]} ``` Check if specific keys exist: ```bloblang root.has_id = this.data.keys().contains("id") # In: {"data":{"id":123,"name":"test"}} # Out: {"has_id":true} ``` ### length Returns the size of an array (element count) or object (key count). #### Examples ```bloblang root.foo_len = this.foo.length() # In: {"foo":["first","second"]} # Out: {"foo_len":2} # In: {"foo":{"first":"bar","second":"baz"}} # Out: {"foo_len":2} ``` ### map_each Applies a mapping query to each element of an array or each value in an object. Returns a new collection with the transformed values. #### Parameters | Name | Type | Description | | --- | --- | --- | | `query` | `query expression` | A query that will be used to map each element. | #### Examples ##### On arrays Transforms each array element using a query. Return deleted() to remove an element, or the new value to replace it: ```bloblang root.new_nums = this.nums.map_each(num -> if num < 10 { deleted() } else { num - 10 }) # In: {"nums":[3,11,4,17]} # Out: {"new_nums":[1,7]} ``` ##### On objects Transforms each object value using a query. The query receives an object with 'key' and 'value' fields for each entry: ```bloblang root.new_dict = this.dict.map_each(item -> item.value.uppercase()) # In: {"dict":{"foo":"hello","bar":"world"}} # Out: {"new_dict":{"bar":"WORLD","foo":"HELLO"}} ``` ### map_each_key Transforms object keys using a query. The query receives each key as a string and must return a new string key. Use this to rename or transform keys while preserving values. #### Parameters | Name | Type | Description | | --- | --- | --- | | `query` | `query expression` | A query that will be used to map each key. | #### Examples ```bloblang root.new_dict = this.dict.map_each_key(key -> key.uppercase()) # In: {"dict":{"keya":"hello","keyb":"world"}} # Out: {"new_dict":{"KEYA":"hello","KEYB":"world"}} ``` Conditionally transform keys: ```bloblang root = this.map_each_key(key -> if key.contains("kafka") { "_" + key }) # In: {"amqp_key":"foo","kafka_key":"bar","kafka_topic":"baz"} # Out: {"_kafka_key":"bar","_kafka_topic":"baz","amqp_key":"foo"} ``` ### merge Combines two objects or arrays. When merging objects, conflicting keys create arrays containing both values. Arrays are concatenated. For key override behavior instead, use the assign method. #### Parameters | Name | Type | Description | | --- | --- | --- | | `with` | `unknown` | A value to merge the target value with. | #### Examples ```bloblang root = this.foo.merge(this.bar) # In: {"foo":{"first_name":"fooer","likes":"bars"},"bar":{"second_name":"barer","likes":"foos"}} # Out: {"first_name":"fooer","likes":["bars","foos"],"second_name":"barer"} ``` Merge arrays: ```bloblang root.combined = this.list1.merge(this.list2) # In: {"list1":["a","b"],"list2":["c","d"]} # Out: {"combined":["a","b","c","d"]} ``` ### patch Applies a changelog (created by the diff method) to the current value, transforming it according to the specified operations. This enables you to synchronize data, replay changes, or implement event sourcing patterns by applying recorded changes to reconstruct state. #### Parameters | Name | Type | Description | | --- | --- | --- | | `changelog` | `unknown` | The changelog array to apply. Should be in the format returned by the diff method, containing Type, Path, From, and To fields for each change. | #### Examples Apply recorded changes to update an object: ```bloblang root.updated = this.current.patch(this.changelog) # In: {"current":{"name":"Alice","age":30},"changelog":[{"Type":"update","Path":["age"],"From":30,"To":31},{"Type":"create","Path":["city"],"From":null,"To":"NYC"}]} # Out: {"updated":{"age":31,"city":"NYC","name":"Alice"}} ``` Restore previous state by applying inverse changes: ```bloblang root.restored = this.modified.patch(this.reverse_changelog) # In: {"modified":{"timeout":60},"reverse_changelog":[{"Type":"create","Path":["debug"],"From":null,"To":true},{"Type":"update","Path":["timeout"],"From":60,"To":30}]} # Out: {"restored":{"debug":true,"timeout":30}} ``` ### slice Extract a slice from an array by specifying two indices, a low and high bound, which selects a half-open range that includes the first element, but excludes the last one. If the second index is omitted then it defaults to the length of the input sequence. #### Parameters | Name | Type | Description | | --- | --- | --- | | `low` | `integer` | The low bound, which is the first element of the selection, or if negative selects from the end. | | `high` (optional) | `integer` | An optional high bound. | #### Examples ```bloblang root.beginning = this.value.slice(0, 2) root.end = this.value.slice(4) # In: {"value":["foo","bar","baz","buz","bev"]} # Out: {"beginning":["foo","bar"],"end":["bev"]} ``` A negative low index can be used, indicating an offset from the end of the sequence. If the low index is greater than the length of the sequence then an empty result is returned: ```bloblang root.last_chunk = this.value.slice(-2) root.the_rest = this.value.slice(0, -2) # In: {"value":["foo","bar","baz","buz","bev"]} # Out: {"last_chunk":["buz","bev"],"the_rest":["foo","bar","baz"]} ``` ### sort Sorts an array in ascending order. Works with strings and numbers. For custom sorting logic, provide a comparison query that receives 'left' and 'right' elements. #### Parameters | Name | Type | Description | | --- | --- | --- | | `compare` (optional) | `query expression` | An optional query that should explicitly compare elements `left` and `right` and provide a boolean result. | #### Examples ```bloblang root.sorted = this.foo.sort() # In: {"foo":["bbb","ccc","aaa"]} # Out: {"sorted":["aaa","bbb","ccc"]} ``` Custom comparison for complex objects - return true if left < right: ```bloblang root.sorted = this.foo.sort(item -> item.left.v < item.right.v) # In: {"foo":[{"id":"foo","v":"bbb"},{"id":"bar","v":"ccc"},{"id":"baz","v":"aaa"}]} # Out: {"sorted":[{"id":"baz","v":"aaa"},{"id":"foo","v":"bbb"},{"id":"bar","v":"ccc"}]} ``` ### sort_by Sorts an array by a value extracted from each element using a query. The extracted values determine sort order and must all be strings or numbers. #### Parameters | Name | Type | Description | | --- | --- | --- | | `query` | `query expression` | A query to apply to each element that yields a value used for sorting. | #### Examples ```bloblang root.sorted = this.foo.sort_by(ele -> ele.id) # In: {"foo":[{"id":"bbb","message":"bar"},{"id":"aaa","message":"foo"},{"id":"ccc","message":"baz"}]} # Out: {"sorted":[{"id":"aaa","message":"foo"},{"id":"bbb","message":"bar"},{"id":"ccc","message":"baz"}]} ``` Sort by numeric field: ```bloblang root.sorted = this.items.sort_by(item -> item.priority) # In: {"items":[{"name":"low","priority":3},{"name":"high","priority":1},{"name":"med","priority":2}]} # Out: {"sorted":[{"name":"high","priority":1},{"name":"med","priority":2},{"name":"low","priority":3}]} ``` ### squash Squashes an array of objects into a single object, where key collisions result in the values being merged (following similar rules as the `.merge()` method). #### Examples ```bloblang root.locations = this.locations.map_each(loc -> {loc.state: [loc.name]}).squash() # In: {"locations":[{"name":"Seattle","state":"WA"},{"name":"New York","state":"NY"},{"name":"Bellevue","state":"WA"},{"name":"Olympia","state":"WA"}]} # Out: {"locations":{"NY":["New York"],"WA":["Seattle","Bellevue","Olympia"]}} ``` ### sum Calculates the sum of all numeric values in an array. Non-numeric values cause an error. #### Examples ```bloblang root.sum = this.foo.sum() # In: {"foo":[3,8,4]} # Out: {"sum":15} ``` Works with decimals: ```bloblang root.total = this.prices.sum() # In: {"prices":[10.5,20.25,5.00]} # Out: {"total":35.75} ``` ### unique Removes duplicate values from an array, keeping the first occurrence of each unique value. Strings and numbers are treated as distinct types ("5" differs from 5). #### Parameters | Name | Type | Description | | --- | --- | --- | | `emit` (optional) | `query expression` | An optional query that can be used in order to yield a value for each element to determine uniqueness. | #### Examples ```bloblang root.uniques = this.foo.unique() # In: {"foo":["a","b","a","c"]} # Out: {"uniques":["a","b","c"]} ``` Use a query to determine uniqueness by a field: ```bloblang root.unique_users = this.users.unique(u -> u.id) # In: {"users":[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"},{"id":1,"name":"Alice Duplicate"}]} # Out: {"unique_users":[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]} ``` ### values Extracts all values from an object and returns them as an array. Order is not guaranteed unless the result is sorted. #### Examples ```bloblang root.foo_vals = this.foo.values().sort() # In: {"foo":{"bar":1,"baz":2}} # Out: {"foo_vals":[1,2]} ``` Find max value in object: ```bloblang root.max = this.scores.values().sort().index(-1) # In: {"scores":{"player1":85,"player2":92,"player3":78}} # Out: {"max":92} ``` ### with Returns an object where all but one or more [field path](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/field_paths/) arguments are removed. Each path specifies a specific field to be retained from the input object, allowing for nested fields. If a key within a nested path does not exist then it is ignored. #### Parameters This method accepts any number of arguments. #### Examples ```bloblang root = this.with("inner.a","inner.c","d") # In: {"inner":{"a":"first","b":"second","c":"third"},"d":"fourth","e":"fifth"} # Out: {"d":"fourth","inner":{"a":"first","c":"third"}} ``` ### without Removes specified fields from an object using dot-notation paths. Returns a new object with the fields removed. Non-existent paths are safely ignored. #### Parameters This method accepts any number of arguments. #### Examples ```bloblang root = this.without("inner.a","inner.c","d") # In: {"inner":{"a":"first","b":"second","c":"third"},"d":"fourth","e":"fifth"} # Out: {"e":"fifth","inner":{"b":"second"}} ``` Remove sensitive fields: ```bloblang root = this.without("password","ssn","creditCard") # In: {"username":"alice","password":"secret","email":"alice@example.com","ssn":"123-45-6789"} # Out: {"email":"alice@example.com","username":"alice"} ``` ### zip Zip an array value with one or more argument arrays. Each array must match in length. #### Parameters This method accepts any number of arguments. #### Examples ```bloblang root.foo = this.foo.zip(this.bar, this.baz) # In: {"foo":["a","b","c"],"bar":[1,2,3],"baz":[4,5,6]} # Out: {"foo":[["a",1,4],["b",2,5],["c",3,6]]} ``` ## Parsing ### bloblang > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Executes an argument Bloblang mapping on the target. This method can be used in order to execute dynamic mappings. Imports and functions that interact with the environment, such as `file` and `env`, or that access message information directly, such as `content` or `json`, are not enabled for dynamic Bloblang mappings. #### Parameters | Name | Type | Description | | --- | --- | --- | | `mapping` | `string` | The mapping to execute. | #### Examples ```bloblang root.body = this.body.bloblang(this.mapping) # In: {"body":{"foo":"hello world"},"mapping":"root.foo = this.foo.uppercase()"} # Out: {"body":{"foo":"HELLO WORLD"}} # In: {"body":{"foo":"hello world 2"},"mapping":"root.foo = this.foo.capitalize()"} # Out: {"body":{"foo":"Hello World 2"}} ``` ### format_json > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Serializes a target value into a pretty-printed JSON byte array (with 4 space indentation by default). #### Parameters | Name | Type | Description | | --- | --- | --- | | `indent` (optional) | `string` | Indentation string. Each element in a JSON object or array will begin on a new, indented line followed by one or more copies of indent according to the indentation nesting. Default: `" "`. | | `no_indent` (optional) | `bool` | Disable indentation. Default: `false`. | | `escape_html` (optional) | `bool` | Escape problematic HTML characters. Default: `true`. | #### Examples ```bloblang root = this.doc.format_json() # In: {"doc":{"foo":"bar"}} # Out: { "foo": "bar" } ``` Pass a string to the `indent` parameter in order to customise the indentation: ```bloblang root = this.format_json(" ") # In: {"doc":{"foo":"bar"}} # Out: { "doc": { "foo": "bar" } } ``` Use the `.string()` method in order to coerce the result into a string: ```bloblang root.doc = this.doc.format_json().string() # In: {"doc":{"foo":"bar"}} # Out: {"doc":"{\n \"foo\": \"bar\"\n}"} ``` Set the `no_indent` parameter to true to disable indentation. The result is equivalent to calling `bytes()`: ```bloblang root = this.doc.format_json(no_indent: true) # In: {"doc":{"foo":"bar"}} # Out: {"foo":"bar"} ``` Escapes problematic HTML characters: ```bloblang root = this.doc.format_json() # In: {"doc":{"email":"foo&bar@benthos.dev","name":"foo>bar"}} # Out: { "email": "foo\u0026bar@benthos.dev", "name": "foo\u003ebar" } ``` Set the `escape_html` parameter to false to disable escaping of problematic HTML characters: ```bloblang root = this.doc.format_json(escape_html: false) # In: {"doc":{"email":"foo&bar@benthos.dev","name":"foo>bar"}} # Out: { "email": "foo&bar@benthos.dev", "name": "foo>bar" } ``` ### format_msgpack Serializes structured data into MessagePack binary format. MessagePack is a compact binary serialization that is faster and more space-efficient than JSON, making it ideal for network transmission and storage of structured data. Returns a byte array that can be further encoded as needed. #### Examples Serialize object to MessagePack and encode as hex for transmission: ```bloblang root = this.format_msgpack().encode("hex") # In: {"foo":"bar"} # Out: 81a3666f6fa3626172 ``` Serialize data to MessagePack and base64 encode for embedding in JSON: ```bloblang root.msgpack_payload = this.data.format_msgpack().encode("base64") # In: {"data":{"foo":"bar"}} # Out: {"msgpack_payload":"gaNmb2+jYmFy"} ``` ### format_xml Serializes an object into an XML document. Converts structured data to XML format with support for attributes (prefixed with hyphen), custom indentation, and configurable root element. Returns XML as a byte array. #### Parameters | Name | Type | Description | | --- | --- | --- | | `indent` (optional) | `string` | String to use for each level of indentation (default is 4 spaces). Each nested XML element will be indented by this string. Default: `" "`. | | `no_indent` (optional) | `bool` | Disable indentation and newlines to produce compact XML on a single line. Default: `false`. | | `root_tag` (optional) | `string` | Custom name for the root XML element. By default, the root element name is derived from the first key in the object. | #### Examples Serialize object to pretty-printed XML with default indentation: ```bloblang root = this.format_xml() # In: {"foo":{"bar":{"baz":"foo bar baz"}}} # Out: foo bar baz ``` Create compact XML without indentation for smaller message size: ```bloblang root = this.format_xml(no_indent: true) # In: {"foo":{"bar":{"baz":"foo bar baz"}}} # Out: foo bar baz ``` ### format_yaml Serializes a target value into a YAML byte array. #### Examples ```bloblang root = this.doc.format_yaml() # In: {"doc":{"foo":"bar"}} # Out: foo: bar ``` Use the `.string()` method in order to coerce the result into a string: ```bloblang root.doc = this.doc.format_yaml().string() # In: {"doc":{"foo":"bar"}} # Out: {"doc":"foo: bar\n"} ``` ### infer_schema Attempt to infer the schema of a given value. The resulting schema can then be used as an input to schema conversion and enforcement methods. ### parse_csv Attempts to parse a string into an array of objects by following the CSV format described in RFC 4180. #### Parameters | Name | Type | Description | | --- | --- | --- | | `parse_header_row` (optional) | `bool` | Whether to reference the first row as a header row. If set to true the output structure for messages will be an object where field keys are determined by the header row. Otherwise, the output will be an array of row arrays. Default: `true`. | | `delimiter` (optional) | `string` | The delimiter to use for splitting values in each record. It must be a single character. Default: `","`. | | `lazy_quotes` (optional) | `bool` | If set to `true`, a quote may appear in an unquoted field and a non-doubled quote may appear in a quoted field. Default: `false`. | #### Examples Parses CSV data with a header row: ```bloblang root.orders = this.orders.parse_csv() # In: {"orders":"foo,bar\nfoo 1,bar 1\nfoo 2,bar 2"} # Out: {"orders":[{"bar":"bar 1","foo":"foo 1"},{"bar":"bar 2","foo":"foo 2"}]} ``` Parses CSV data without a header row: ```bloblang root.orders = this.orders.parse_csv(false) # In: {"orders":"foo 1,bar 1\nfoo 2,bar 2"} # Out: {"orders":[["foo 1","bar 1"],["foo 2","bar 2"]]} ``` Parses CSV data delimited by dots: ```bloblang root.orders = this.orders.parse_csv(delimiter:".") # In: {"orders":"foo.bar\nfoo 1.bar 1\nfoo 2.bar 2"} # Out: {"orders":[{"bar":"bar 1","foo":"foo 1"},{"bar":"bar 2","foo":"foo 2"}]} ``` Parses CSV data containing a quote in an unquoted field: ```bloblang root.orders = this.orders.parse_csv(lazy_quotes:true) # In: {"orders":"foo,bar\nfoo 1,bar 1\nfoo\" \"2,bar\" \"2"} # Out: {"orders":[{"bar":"bar 1","foo":"foo 1"},{"bar":"bar\" \"2","foo":"foo\" \"2"}]} ``` ### parse_form_url_encoded Attempts to parse a url-encoded query string (from an x-www-form-urlencoded request body) and returns a structured result. #### Examples ```bloblang root.values = this.body.parse_form_url_encoded() # In: {"body":"noise=meow&animal=cat&fur=orange&fur=fluffy"} # Out: {"values":{"animal":"cat","fur":["orange","fluffy"],"noise":"meow"}} ``` ### parse_json Attempts to parse a string as a JSON document and returns the result. #### Parameters | Name | Type | Description | | --- | --- | --- | | `use_number` (optional) | `bool` | An optional flag that when set makes parsing numbers as json.Number instead of the default float64. | #### Examples ```bloblang root.doc = this.doc.parse_json() # In: {"doc":"{\"foo\":\"bar\"}"} # Out: {"doc":{"foo":"bar"}} ``` ```bloblang root.doc = this.doc.parse_json(use_number: true) # In: {"doc":"{\"foo\":\"11380878173205700000000000000000000000000000000\"}"} # Out: {"doc":{"foo":"11380878173205700000000000000000000000000000000"}} ``` ### parse_logfmt Attempts to parse a logfmt encoded string into an object. A logfmt string contains key=value pairs separated by spaces, where values can optionally be quoted. #### Examples ```bloblang root = this.msg.parse_logfmt() # In: {"msg":"level=info msg=\"hello world\" dur=1.5s"} # Out: {"dur":"1.5s","level":"info","msg":"hello world"} ``` ### parse_msgpack Parses MessagePack binary data into a structured object. MessagePack is an efficient binary serialization format that is more compact than JSON while maintaining similar data structures. Commonly used for high-performance APIs and data interchange between microservices. #### Examples Parse MessagePack data from hex-encoded content: ```bloblang root = content().decode("hex").parse_msgpack() # In: 81a3666f6fa3626172 # Out: {"foo":"bar"} ``` Parse MessagePack from base64-encoded field: ```bloblang root.decoded = this.msgpack_data.decode("base64").parse_msgpack() # In: {"msgpack_data":"gaNmb2+jYmFy"} # Out: {"decoded":{"foo":"bar"}} ``` ### parse_parquet Parses Apache Parquet binary data into an array of objects. Parquet is a columnar storage format optimized for analytics, commonly used with big data systems like Apache Spark, Hive, and cloud data warehouses. Each row in the Parquet file becomes an object in the output array. #### Parameters | Name | Type | Description | | --- | --- | --- | | `byte_array_as_string` (optional) | `bool` | Deprecated: This parameter is no longer used. Default: `false`. | #### Examples Parse Parquet file data into structured objects: ```bloblang root.records = content().parse_parquet() ``` Process Parquet data from a field and extract specific columns: ```bloblang root.users = this.parquet_data.parse_parquet().map_each(row -> {"name": row.name, "email": row.email}) ``` ### parse_url Attempts to parse a URL from a string value, returning a structured result that describes the various facets of the URL. The fields returned within the structured result roughly follow [https://pkg.go.dev/net/url#URL](https://pkg.go.dev/net/url#URL), and may be expanded in future in order to present more information. #### Examples ```bloblang root.foo_url = this.foo_url.parse_url() # In: {"foo_url":"https://docs.redpanda.com/redpanda-connect/guides/bloblang/about/"} # Out: {"foo_url":{"fragment":"","host":"docs.redpanda.com","opaque":"","path":"/redpanda-connect/guides/bloblang/about/","raw_fragment":"","raw_path":"","raw_query":"","scheme":"https"}} ``` ```bloblang root.username = this.url.parse_url().user.name | "unknown" # In: {"url":"amqp://foo:bar@127.0.0.1:5672/"} # Out: {"username":"foo"} # In: {"url":"redis://localhost:6379"} # Out: {"username":"unknown"} ``` ### parse_xml Parses an XML document into a structured object. Converts XML elements to JSON-like objects following these rules: - Element attributes are prefixed with a hyphen (e.g., `-id` for an `id` attribute) - Elements with both attributes and text content store the text in a `#text` field - Repeated elements become arrays - XML comments, directives, and processing instructions are ignored - Optionally cast numeric and boolean strings to their proper types. #### Parameters | Name | Type | Description | | --- | --- | --- | | `cast` (optional) | `bool` | Whether to automatically cast numeric and boolean string values to their proper types. When false, all values remain as strings. Default: `false`. | #### Examples Parse XML document into object structure: ```bloblang root.doc = this.doc.parse_xml() # In: {"doc":"This is a titleThis is some content"} # Out: {"doc":{"root":{"content":"This is some content","title":"This is a title"}}} ``` Parse XML with type casting enabled to convert strings to numbers and booleans: ```bloblang root.doc = this.doc.parse_xml(cast: true) # In: {"doc":"This is a title123True"} # Out: {"doc":{"root":{"bool":true,"number":{"#text":123,"-id":99},"title":"This is a title"}}} ``` ### parse_yaml Attempts to parse a string as a single YAML document and returns the result. #### Examples ```bloblang root.doc = this.doc.parse_yaml() # In: {"doc":"foo: bar"} # Out: {"doc":{"foo":"bar"}} ``` ## Regular expressions ### re_find_all Finds all matches of a regular expression in a string and returns them as an array. Use for extracting multiple patterns or validating repeating structures. #### Parameters | Name | Type | Description | | --- | --- | --- | | `pattern` | `string` | The pattern to match against. | #### Examples ```bloblang root.matches = this.value.re_find_all("a.") # In: {"value":"paranormal"} # Out: {"matches":["ar","an","al"]} ``` ```bloblang root.numbers = this.text.re_find_all("[0-9]+") # In: {"text":"I have 2 apples and 15 oranges"} # Out: {"numbers":["2","15"]} ``` ### re_find_all_object Finds all regex matches and returns an array of objects with named capture groups as keys. Each object represents one match with its captured groups. Use for parsing multiple structured records from text. #### Parameters | Name | Type | Description | | --- | --- | --- | | `pattern` | `string` | The pattern to match against. | #### Examples ```bloblang root.matches = this.value.re_find_all_object("a(?Px*)b") # In: {"value":"-axxb-ab-"} # Out: {"matches":[{"0":"axxb","foo":"xx"},{"0":"ab","foo":""}]} ``` ```bloblang root.matches = this.value.re_find_all_object("(?m)(?P\\w+):\\s+(?P\\w+)$") # In: {"value":"option1: value1\noption2: value2\noption3: value3"} # Out: {"matches":[{"0":"option1: value1","key":"option1","value":"value1"},{"0":"option2: value2","key":"option2","value":"value2"},{"0":"option3: value3","key":"option3","value":"value3"}]} ``` ### re_find_all_submatch Finds all regex matches and their capture groups, returning an array of arrays where each inner array contains the full match and captured subgroups. Use for extracting structured data with capture groups. #### Parameters | Name | Type | Description | | --- | --- | --- | | `pattern` | `string` | The pattern to match against. | #### Examples ```bloblang root.matches = this.value.re_find_all_submatch("a(x*)b") # In: {"value":"-axxb-ab-"} # Out: {"matches":[["axxb","xx"],["ab",""]]} ``` ```bloblang root.emails = this.text.re_find_all_submatch("(\\w+)@(\\w+\\.\\w+)") # In: {"text":"Contact: alice@example.com or bob@test.org"} # Out: {"emails":[["alice@example.com","alice","example.com"],["bob@test.org","bob","test.org"]]} ``` ### re_find_object Finds the first regex match and returns an object with named capture groups as keys (or numeric indices for unnamed groups). The key "0" contains the full match. Use for parsing structured text into fields. #### Parameters | Name | Type | Description | | --- | --- | --- | | `pattern` | `string` | The pattern to match against. | #### Examples ```bloblang root.matches = this.value.re_find_object("a(?Px*)b") # In: {"value":"-axxb-ab-"} # Out: {"matches":{"0":"axxb","foo":"xx"}} ``` ```bloblang root.matches = this.value.re_find_object("(?P\\w+):\\s+(?P\\w+)") # In: {"value":"option1: value1"} # Out: {"matches":{"0":"option1: value1","key":"option1","value":"value1"}} ``` ### re_match Tests if a regular expression matches anywhere in a string, returning `true` or `false`. Use for validation or conditional routing based on patterns. #### Parameters | Name | Type | Description | | --- | --- | --- | | `pattern` | `string` | The pattern to match against. | #### Examples ```bloblang root.matches = this.value.re_match("[0-9]") # In: {"value":"there are 10 puppies"} # Out: {"matches":true} # In: {"value":"there are ten puppies"} # Out: {"matches":false} ``` ### re_replace Replaces all regex matches with a replacement string that can reference capture groups using `$1`, `$2`, etc. Use for pattern-based transformations or data reformatting. #### Parameters | Name | Type | Description | | --- | --- | --- | | `pattern` | `string` | The pattern to match against. | | `value` | `string` | The value to replace with. | ### re_replace_all Replaces all regex matches with a replacement string that can reference capture groups using `$1`, `$2`, etc. Use for pattern-based transformations or data reformatting. #### Parameters | Name | Type | Description | | --- | --- | --- | | `pattern` | `string` | The pattern to match against. | | `value` | `string` | The value to replace with. | #### Examples ```bloblang root.new_value = this.value.re_replace_all("ADD ([0-9]+)","+($1)") # In: {"value":"foo ADD 70"} # Out: {"new_value":"foo +(70)"} ``` ```bloblang root.masked = this.email.re_replace_all("(\\w{2})\\w+@", "$1***@") # In: {"email":"alice@example.com"} # Out: {"masked":"al***@example.com"} ``` ## SQL ### vector Converts an array of numbers into a vector type suitable for insertion into SQL databases with vector/embedding support. This is commonly used with PostgreSQL’s pgvector extension for storing and querying machine learning embeddings, enabling similarity search and vector operations in your database. #### Examples Convert embeddings array to vector for pgvector storage: ```bloblang root.embedding = this.embeddings.vector() root.text = this.text ``` Process ML model output into database-ready vector format: ```bloblang root.doc_id = this.id root.vector_embedding = this.model_output.map_each(num -> num.number()).vector() ``` ## String manipulation ### capitalize Converts the first letter of each word in a string to uppercase (title case). Useful for formatting names, titles, and headings. #### Examples ```bloblang root.title = this.title.capitalize() # In: {"title":"the foo bar"} # Out: {"title":"The Foo Bar"} ``` ```bloblang root.name = this.name.capitalize() # In: {"name":"alice smith"} # Out: {"name":"Alice Smith"} ``` ### compare_argon2 Checks whether a string matches a hashed secret using Argon2. #### Parameters | Name | Type | Description | | --- | --- | --- | | `hashed_secret` | `string` | The hashed secret to compare with the input. This must be a fully-qualified string which encodes the Argon2 options used to generate the hash. | #### Examples ```bloblang root.match = this.secret.compare_argon2("$argon2id$v=19$m=4096,t=3,p=1$c2FsdHktbWNzYWx0ZmFjZQ$RMUMwgtS32/mbszd+ke4o4Ej1jFpYiUqY6MHWa69X7Y") # In: {"secret":"there-are-many-blobs-in-the-sea"} # Out: {"match":true} ``` ```bloblang root.match = this.secret.compare_argon2("$argon2id$v=19$m=4096,t=3,p=1$c2FsdHktbWNzYWx0ZmFjZQ$RMUMwgtS32/mbszd+ke4o4Ej1jFpYiUqY6MHWa69X7Y") # In: {"secret":"will-i-ever-find-love"} # Out: {"match":false} ``` ### compare_bcrypt Checks whether a string matches a hashed secret using bcrypt. #### Parameters | Name | Type | Description | | --- | --- | --- | | `hashed_secret` | `string` | The hashed secret value to compare with the input. | #### Examples ```bloblang root.match = this.secret.compare_bcrypt("$2y$10$Dtnt5NNzVtMCOZONT705tOcS8It6krJX8bEjnDJnwxiFKsz1C.3Ay") # In: {"secret":"there-are-many-blobs-in-the-sea"} # Out: {"match":true} ``` ```bloblang root.match = this.secret.compare_bcrypt("$2y$10$Dtnt5NNzVtMCOZONT705tOcS8It6krJX8bEjnDJnwxiFKsz1C.3Ay") # In: {"secret":"will-i-ever-find-love"} # Out: {"match":false} ``` ### contains Checks whether a string contains a substring and returns a boolean result. #### Parameters | Name | Type | Description | | --- | --- | --- | | `value` | `unknown` | A value to test against elements of the target. | #### Examples ```bloblang root.has_foo = this.thing.contains("foo") # In: {"thing":"this foo that"} # Out: {"has_foo":true} # In: {"thing":"this bar that"} # Out: {"has_foo":false} ``` ### escape_html Escapes special HTML characters (`<`, `>`, `&`, `'`, `"`) to make a string safe for HTML output. Use when embedding untrusted text in HTML to prevent XSS vulnerabilities. #### Examples ```bloblang root.escaped = this.value.escape_html() # In: {"value":"foo & bar"} # Out: {"escaped":"foo & bar"} ``` ```bloblang root.safe_html = this.user_input.escape_html() # In: {"user_input":""} # Out: {"safe_html":"<script>alert('xss')</script>"} ``` ### escape_url_path Encodes a string for safe use in URL path segments using percent-encoding. Unlike `escape_url_query`, spaces are encoded as `%20` instead of `+`. Use when building URL paths with dynamic segments. #### Examples ```bloblang root.escaped = this.value.escape_url_path() # In: {"value":"foo & bar"} # Out: {"escaped":"foo%20&%20bar"} ``` ```bloblang root.url = "https://example.com/docs/" + this.path.escape_url_path() # In: {"path":"my document.pdf"} # Out: {"url":"https://example.com/docs/my%20document.pdf"} ``` ### escape_url_query Encodes a string for safe use in URL query parameters. Converts spaces to `+` and special characters to percent-encoded values. Use when building URLs with dynamic query parameters. #### Examples ```bloblang root.escaped = this.value.escape_url_query() # In: {"value":"foo & bar"} # Out: {"escaped":"foo+%26+bar"} ``` ```bloblang root.url = "https://example.com?search=" + this.query.escape_url_query() # In: {"query":"hello world!"} # Out: {"url":"https://example.com?search=hello+world%21"} ``` ### filepath_join Combines an array of path components into a single OS-specific file path using the correct separator (`/` on Unix, `\` on Windows). Use for constructing file paths from components. #### Examples ```bloblang root.path = this.path_elements.filepath_join() # In: {"path_elements":["/foo/","bar.txt"]} # Out: {"path":"/foo/bar.txt"} ``` ### filepath_split Separates a file path into directory and filename components, returning a two-element array `[directory, filename]`. Use for extracting the filename or directory from a full path. #### Examples ```bloblang root.path_sep = this.path.filepath_split() # In: {"path":"/foo/bar.txt"} # Out: {"path_sep":["/foo/","bar.txt"]} # In: {"path":"baz.txt"} # Out: {"path_sep":["","baz.txt"]} ``` ### format Formats a string using Go’s printf-style formatting with the string as the format template. Supports all Go format verbs (`%s`, `%d`, `%v`, etc.). Use for building formatted strings from dynamic values. #### Parameters This method accepts any number of arguments. #### Examples ```bloblang root.foo = "%s(%v): %v".format(this.name, this.age, this.fingers) # In: {"name":"lance","age":37,"fingers":13} # Out: {"foo":"lance(37): 13"} ``` ```bloblang root.message = "User %s has %v points".format(this.username, this.score) # In: {"username":"alice","score":100} # Out: {"message":"User alice has 100 points"} ``` ### has_prefix Tests if a string starts with a specified prefix. Returns `true` if the string begins with the prefix, `false` otherwise. Use for conditional logic based on string patterns. #### Parameters | Name | Type | Description | | --- | --- | --- | | `value` | `string` | The string to test. | #### Examples ```bloblang root.t1 = this.v1.has_prefix("foo") root.t2 = this.v2.has_prefix("foo") # In: {"v1":"foobar","v2":"barfoo"} # Out: {"t1":true,"t2":false} ``` ### has_suffix Tests if a string ends with a specified suffix. Returns `true` if the string ends with the suffix, `false` otherwise. Use for filtering or routing based on file extensions or string patterns. #### Parameters | Name | Type | Description | | --- | --- | --- | | `value` | `string` | The string to test. | #### Examples ```bloblang root.t1 = this.v1.has_suffix("foo") root.t2 = this.v2.has_suffix("foo") # In: {"v1":"foobar","v2":"barfoo"} # Out: {"t1":false,"t2":true} ``` ### index_of Finds the position of a substring within a string. Returns the zero-based index of the first occurrence, or -1 if not found. Useful for searching and string manipulation. #### Parameters | Name | Type | Description | | --- | --- | --- | | `value` | `string` | A string to search for. | #### Examples ```bloblang root.index = this.thing.index_of("bar") # In: {"thing":"foobar"} # Out: {"index":3} ``` ```bloblang root.index = content().index_of("meow") # In: the cat meowed, the dog woofed # Out: {"index":8} ``` ### length Returns the character count of a string. #### Examples ```bloblang root.foo_len = this.foo.length() # In: {"foo":"hello world"} # Out: {"foo_len":11} ``` ### lowercase Converts all letters in a string to lowercase. Use for case-insensitive comparisons, normalization, or formatting output. #### Examples ```bloblang root.foo = this.foo.lowercase() # In: {"foo":"HELLO WORLD"} # Out: {"foo":"hello world"} ``` ```bloblang root.email = this.user_email.lowercase() # In: {"user_email":"User@Example.COM"} # Out: {"email":"user@example.com"} ``` ### quote Wraps a string in double quotes and escapes special characters (newlines, tabs, etc.) using Go escape sequences. Use for generating string literals or preparing strings for JSON-like formats. #### Examples ```bloblang root.quoted = this.thing.quote() # In: {"thing":"foo\nbar"} # Out: {"quoted":"\"foo\\nbar\""} ``` ```bloblang root.literal = this.text.quote() # In: {"text":"hello\tworld"} # Out: {"literal":"\"hello\\tworld\""} ``` ### repeat Creates a new string by repeating the input string a specified number of times. Use for generating padding, separators, or test data. #### Parameters | Name | Type | Description | | --- | --- | --- | | `count` | `integer` | The number of times to repeat the string. | #### Examples ```bloblang root.repeated = this.name.repeat(3) root.not_repeated = this.name.repeat(0) # In: {"name":"bob"} # Out: {"not_repeated":"","repeated":"bobbobbob"} ``` ```bloblang root.separator = "-".repeat(10) # In: {} # Out: {"separator":"----------"} ``` ### replace Replaces all occurrences of a substring with another string. Use for text transformation, cleaning data, or normalizing strings. #### Parameters | Name | Type | Description | | --- | --- | --- | | `old` | `string` | A string to match against. | | `new` | `string` | A string to replace with. | ### replace_all Replaces all occurrences of a substring with another string. Use for text transformation, cleaning data, or normalizing strings. #### Parameters | Name | Type | Description | | --- | --- | --- | | `old` | `string` | A string to match against. | | `new` | `string` | A string to replace with. | #### Examples ```bloblang root.new_value = this.value.replace_all("foo","dog") # In: {"value":"The foo ate my homework"} # Out: {"new_value":"The dog ate my homework"} ``` ```bloblang root.clean = this.text.replace_all(" ", " ") # In: {"text":"hello world foo"} # Out: {"clean":"hello world foo"} ``` ### replace_all_many Performs multiple find-and-replace operations in sequence using an array of `[old, new]` pairs. More efficient than chaining multiple `replace_all` calls. Use for bulk text transformations. #### Parameters | Name | Type | Description | | --- | --- | --- | | `values` | `array` | An array of values, each even value will be replaced with the following odd value. | #### Examples ```bloblang root.new_value = this.value.replace_all_many([ "", "<b>", "", "</b>", "", "<i>", "", "</i>", ]) # In: {"value":"Hello World"} # Out: {"new_value":"<i>Hello</i> <b>World</b>"} ``` ### replace_many Performs multiple find-and-replace operations in sequence using an array of `[old, new]` pairs. More efficient than chaining multiple `replace_all` calls. Use for bulk text transformations. #### Parameters | Name | Type | Description | | --- | --- | --- | | `values` | `array` | An array of values, each even value will be replaced with the following odd value. | ### reverse Reverses the order of characters in a string. Unicode-aware for proper handling of multi-byte characters. Use for creating palindrome checks or reversing text data. #### Examples ```bloblang root.reversed = this.thing.reverse() # In: {"thing":"backwards"} # Out: {"reversed":"sdrawkcab"} ``` ```bloblang root = content().reverse() # In: {"thing":"backwards"} # Out: }"sdrawkcab":"gniht"{ ``` ### slice Extract a slice from a string by specifying two indices, a low and high bound, which selects a half-open range that includes the first character, but excludes the last one. If the second index is omitted then it defaults to the length of the input sequence. #### Parameters | Name | Type | Description | | --- | --- | --- | | `low` | `integer` | The low bound, which is the first element of the selection, or if negative selects from the end. | | `high` (optional) | `integer` | An optional high bound. | #### Examples ```bloblang root.beginning = this.value.slice(0, 2) root.end = this.value.slice(4) # In: {"value":"foo bar"} # Out: {"beginning":"fo","end":"bar"} ``` A negative low index can be used, indicating an offset from the end of the sequence. If the low index is greater than the length of the sequence then an empty result is returned: ```bloblang root.last_chunk = this.value.slice(-4) root.the_rest = this.value.slice(0, -4) # In: {"value":"foo bar"} # Out: {"last_chunk":" bar","the_rest":"foo"} ``` ### slug Converts a string into a URL-friendly slug by replacing spaces with hyphens, removing special characters, and converting to lowercase. Supports multiple languages for proper transliteration of non-ASCII characters. #### Parameters | Name | Type | Description | | --- | --- | --- | | `lang` (optional) | `string` | Default: `"en"`. | #### Examples Create a URL-friendly slug from a string with special characters: ```bloblang root.slug = this.title.slug() # In: {"title":"Hello World! Welcome to Redpanda Connect"} # Out: {"slug":"hello-world-welcome-to-redpanda-connect"} ``` Create a slug preserving French language rules: ```bloblang root.slug = this.title.slug("fr") # In: {"title":"Café & Restaurant"} # Out: {"slug":"cafe-et-restaurant"} ``` ### split Splits a string into an array of substrings using a delimiter. Use for parsing CSV-like data, splitting paths, or breaking text into tokens. #### Parameters | Name | Type | Description | | --- | --- | --- | | `delimiter` | `string` | The delimiter to split with. | | `empty_as_null` (optional) | `bool` | To treat empty substrings as null values. Default: `false`. | #### Examples ```bloblang root.new_value = this.value.split(",") # In: {"value":"foo,bar,baz"} # Out: {"new_value":["foo","bar","baz"]} ``` ```bloblang root.new_value = this.value.split(",", true) # In: {"value":"foo,,qux"} # Out: {"new_value":["foo",null,"qux"]} ``` ```bloblang root.words = this.sentence.split(" ") # In: {"sentence":"hello world from bloblang"} # Out: {"words":["hello","world","from","bloblang"]} ``` ### strip_html Removes HTML tags from a string, returning only the text content. Useful for extracting plain text from HTML documents, sanitizing user input, or preparing content for text analysis. Optionally preserves specific HTML elements while stripping all others. #### Parameters | Name | Type | Description | | --- | --- | --- | | `preserve` (optional) | `unknown` | Optional array of HTML element names to preserve (e.g., \["strong", "em", "a"\]). All other HTML tags will be removed. | #### Examples Extract plain text from HTML content: ```bloblang root.plain_text = this.html_content.strip_html() # In: {"html_content":"

Welcome to Redpanda Connect!

"} # Out: {"plain_text":"Welcome to Redpanda Connect!"} ``` Preserve specific HTML elements while removing others: ```bloblang root.sanitized = this.html.strip_html(["strong", "em"]) # In: {"html":"

Some bold and italic text with a

"} # Out: {"sanitized":"Some bold and italic text with a "} ``` ### trim Removes leading and trailing characters from a string. Without arguments, removes whitespace. With a cutset argument, removes any characters in the cutset. Use for cleaning user input or normalizing strings. #### Parameters | Name | Type | Description | | --- | --- | --- | | `cutset` (optional) | `string` | An optional string of characters to trim from the target value. | #### Examples ```bloblang root.title = this.title.trim("!?") root.description = this.description.trim() # In: {"description":" something happened and its amazing! ","title":"!!!watch out!?"} # Out: {"description":"something happened and its amazing!","title":"watch out"} ``` ### trim_prefix Removes a specified prefix from the beginning of a string if present. If the string doesn’t start with the prefix, returns the string unchanged. Use for stripping known prefixes from identifiers or paths. #### Parameters | Name | Type | Description | | --- | --- | --- | | `prefix` | `string` | The leading prefix substring to trim from the string. | #### Examples ```bloblang root.name = this.name.trim_prefix("foobar_") root.description = this.description.trim_prefix("foobar_") # In: {"description":"unchanged","name":"foobar_blobton"} # Out: {"description":"unchanged","name":"blobton"} ``` ### trim_suffix Removes a specified suffix from the end of a string if present. If the string doesn’t end with the suffix, returns the string unchanged. Use for stripping file extensions or known suffixes. #### Parameters | Name | Type | Description | | --- | --- | --- | | `suffix` | `string` | The trailing suffix substring to trim from the string. | #### Examples ```bloblang root.name = this.name.trim_suffix("_foobar") root.description = this.description.trim_suffix("_foobar") # In: {"description":"unchanged","name":"blobton_foobar"} # Out: {"description":"unchanged","name":"blobton"} ``` ### unescape_html Converts HTML entities back to their original characters. Handles named entities (`&`, `<`), decimal (`á`), and hexadecimal (`&xE1;`) formats. Use for processing HTML content or decoding HTML-escaped data. #### Examples ```bloblang root.unescaped = this.value.unescape_html() # In: {"value":"foo & bar"} # Out: {"unescaped":"foo & bar"} ``` ```bloblang root.text = this.html.unescape_html() # In: {"html":"<p>Hello & goodbye</p>"} # Out: {"text":"

Hello & goodbye

"} ``` ### unescape_url_path Decodes URL path percent-encoding, converting `%20` to spaces and other percent-encoded characters to their original values. Use for parsing URL path segments. #### Examples ```bloblang root.unescaped = this.value.unescape_url_path() # In: {"value":"foo%20&%20bar"} # Out: {"unescaped":"foo & bar"} ``` ```bloblang root.filename = this.path.unescape_url_path() # In: {"path":"my%20document.pdf"} # Out: {"filename":"my document.pdf"} ``` ### unescape_url_query Decodes URL query parameter encoding, converting `+` to spaces and percent-encoded characters to their original values. Use for parsing URL query parameters. #### Examples ```bloblang root.unescaped = this.value.unescape_url_query() # In: {"value":"foo+%26+bar"} # Out: {"unescaped":"foo & bar"} ``` ```bloblang root.search = this.param.unescape_url_query() # In: {"param":"hello+world%21"} # Out: {"search":"hello world!"} ``` ### unicode_segments Splits text into segments based on Unicode text segmentation rules. Returns an array of strings representing individual graphemes (visual characters), words (including punctuation and whitespace), or sentences. Handles complex Unicode correctly, including emoji with skin tone modifiers and zero-width joiners. #### Parameters | Name | Type | Description | | --- | --- | --- | | `segmentation_type` | `string` | Type of segmentation: "grapheme", "word", or "sentence" | #### Examples Split text into sentences (preserves trailing spaces): ```bloblang root.sentences = this.text.unicode_segments("sentence") # In: {"text":"Hello world. How are you?"} # Out: {"sentences":["Hello world. ","How are you?"]} ``` Split text into grapheme clusters (handles complex emoji correctly): ```bloblang root.graphemes = this.emoji.unicode_segments("grapheme") # In: {"emoji":"👨‍👩‍👧‍👦❤️"} # Out: {"graphemes":["👨‍👩‍👧‍👦","❤️"]} ``` ### unquote Removes surrounding quotes and interprets escape sequences (`\n`, `\t`, etc.) to their literal characters. Use for parsing quoted string literals. #### Examples ```bloblang root.unquoted = this.thing.unquote() # In: {"thing":"\"foo\\nbar\""} # Out: {"unquoted":"foo\nbar"} ``` ```bloblang root.text = this.literal.unquote() # In: {"literal":"\"hello\\tworld\""} # Out: {"text":"hello\tworld"} ``` ### uppercase Converts all letters in a string to uppercase. Use for case-insensitive comparisons or formatting output. #### Examples ```bloblang root.foo = this.foo.uppercase() # In: {"foo":"hello world"} # Out: {"foo":"HELLO WORLD"} ``` ```bloblang root.code = this.product_code.uppercase() # In: {"product_code":"abc-123"} # Out: {"code":"ABC-123"} ``` ## Timestamp manipulation ### parse_duration Parses a Go-style duration string into nanoseconds. A duration string is a signed sequence of decimal numbers with unit suffixes like "300ms", "-1.5h", or "2h45m". Valid units: "ns", "us" (or "µs"), "ms", "s", "m", "h". #### Examples Parse microseconds to nanoseconds: ```bloblang root.delay_for_ns = this.delay_for.parse_duration() # In: {"delay_for":"50us"} # Out: {"delay_for_ns":50000} ``` Parse hours to seconds: ```bloblang root.delay_for_s = this.delay_for.parse_duration() / 1000000000 # In: {"delay_for":"2h"} # Out: {"delay_for_s":7200} ``` ### parse_duration_iso8601 > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Parses an ISO 8601 duration string into nanoseconds. Format: "P\[n\]Y\[n\]M\[n\]DT\[n\]H\[n\]M\[n\]S" or "P\[n\]W". Example: "P3Y6M4DT12H30M5S" means 3 years, 6 months, 4 days, 12 hours, 30 minutes, 5 seconds. Supports fractional seconds with full precision (not just one decimal place). #### Examples Parse complex ISO 8601 duration to nanoseconds: ```bloblang root.delay_for_ns = this.delay_for.parse_duration_iso8601() # In: {"delay_for":"P3Y6M4DT12H30M5S"} # Out: {"delay_for_ns":110839937000000000} ``` Parse hours to seconds: ```bloblang root.delay_for_s = this.delay_for.parse_duration_iso8601() / 1000000000 # In: {"delay_for":"PT2H"} # Out: {"delay_for_s":7200} ``` ### ts_add_iso8601 > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Adds an ISO 8601 duration to a timestamp with calendar-aware precision for years, months, and days. Useful when you need to add durations that account for variable month lengths or leap years. #### Parameters | Name | Type | Description | | --- | --- | --- | | `duration` | `string` | Duration in ISO 8601 format (e.g., "P1Y2M3D" for 1 year, 2 months, 3 days) | #### Examples Add one year to a timestamp: ```bloblang root.next_year = this.created_at.ts_add_iso8601("P1Y") # In: {"created_at":"2020-08-14T05:54:23Z"} # Out: {"next_year":"2021-08-14T05:54:23Z"} ``` Add a complex duration with multiple units: ```bloblang root.future_date = this.created_at.ts_add_iso8601("P1Y2M3DT4H5M6S") # In: {"created_at":"2020-01-01T00:00:00Z"} # Out: {"future_date":"2021-03-04T04:05:06Z"} ``` ### ts_format > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Formats a timestamp as a string using Go’s reference time format. Defaults to RFC 3339 if no format specified. The format uses "Mon Jan 2 15:04:05 -0700 MST 2006" as a reference. Accepts unix timestamps (with decimal precision) or RFC 3339 strings. Use ts_strftime for strftime-style formats. #### Parameters | Name | Type | Description | | --- | --- | --- | | `format` (optional) | `string` | The output format using Go’s reference time. Default: `"2006-01-02T15:04:05.999999999Z07:00"`. | | `tz` (optional) | `string` | Optional timezone (e.g., 'UTC', 'America/New_York'). Defaults to input timezone or local time for unix timestamps. | #### Examples Format timestamp with custom format: ```bloblang root.something_at = this.created_at.ts_format("2006-Jan-02 15:04:05") # In: {"created_at":"2020-08-14T11:50:26.371Z"} # Out: {"something_at":"2020-Aug-14 11:50:26"} ``` Format unix timestamp with timezone specification: ```bloblang root.something_at = this.created_at.ts_format(format: "2006-Jan-02 15:04:05", tz: "UTC") # In: {"created_at":1597405526} # Out: {"something_at":"2020-Aug-14 11:45:26"} ``` ### ts_parse > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Parses a timestamp string using Go’s reference time format and outputs a timestamp object. The format uses "Mon Jan 2 15:04:05 -0700 MST 2006" as a reference - show how this reference time would appear in your format. Use ts_strptime for strftime-style formats instead. #### Parameters | Name | Type | Description | | --- | --- | --- | | `format` | `string` | The format of the input string using Go’s reference time. | #### Examples Parse a date with abbreviated month name: ```bloblang root.doc.timestamp = this.doc.timestamp.ts_parse("2006-Jan-02") # In: {"doc":{"timestamp":"2020-Aug-14"}} # Out: {"doc":{"timestamp":"2020-08-14T00:00:00Z"}} ``` Parse a custom datetime format: ```bloblang root.parsed = this.timestamp.ts_parse("Jan 2, 2006 at 3:04pm (MST)") # In: {"timestamp":"Aug 14, 2020 at 5:54am (UTC)"} # Out: {"parsed":"2020-08-14T05:54:00Z"} ``` ### ts_round > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Rounds a timestamp to the nearest multiple of the specified duration. Halfway values round up. Accepts unix timestamps (seconds with optional decimal precision) or RFC 3339 formatted strings. #### Parameters | Name | Type | Description | | --- | --- | --- | | `duration` | `integer` | A duration measured in nanoseconds to round by. | #### Examples Round timestamp to the nearest hour: ```bloblang root.created_at_hour = this.created_at.ts_round("1h".parse_duration()) # In: {"created_at":"2020-08-14T05:54:23Z"} # Out: {"created_at_hour":"2020-08-14T06:00:00Z"} ``` Round timestamp to the nearest minute: ```bloblang root.created_at_minute = this.created_at.ts_round("1m".parse_duration()) # In: {"created_at":"2020-08-14T05:54:23Z"} # Out: {"created_at_minute":"2020-08-14T05:54:00Z"} ``` ### ts_strftime > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Formats a timestamp as a string using strptime format specifiers (like %Y, %m, %d). Accepts unix timestamps (with decimal precision) or RFC 3339 strings. Supports %f for microseconds. Use ts_format for Go-style reference time formats. #### Parameters | Name | Type | Description | | --- | --- | --- | | `format` | `string` | The output format using strptime specifiers. | | `tz` (optional) | `string` | Optional timezone. Defaults to input timezone or local time for unix timestamps. | #### Examples Format timestamp with strftime specifiers: ```bloblang root.something_at = this.created_at.ts_strftime("%Y-%b-%d %H:%M:%S") # In: {"created_at":"2020-08-14T11:50:26.371Z"} # Out: {"something_at":"2020-Aug-14 11:50:26"} ``` Format with microseconds using %f directive: ```bloblang root.something_at = this.created_at.ts_strftime("%Y-%b-%d %H:%M:%S.%f", "UTC") # In: {"created_at":"2020-08-14T11:50:26.371Z"} # Out: {"something_at":"2020-Aug-14 11:50:26.371000"} ``` ### ts_strptime > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Parses a timestamp string using strptime format specifiers (like %Y, %m, %d) and outputs a timestamp object. Use ts_parse for Go-style reference time formats instead. #### Parameters | Name | Type | Description | | --- | --- | --- | | `format` | `string` | The format string using strptime specifiers (e.g., %Y-%m-%d). | #### Examples Parse date with abbreviated month using strptime format: ```bloblang root.doc.timestamp = this.doc.timestamp.ts_strptime("%Y-%b-%d") # In: {"doc":{"timestamp":"2020-Aug-14"}} # Out: {"doc":{"timestamp":"2020-08-14T00:00:00Z"}} ``` Parse datetime with microseconds using %f directive: ```bloblang root.doc.timestamp = this.doc.timestamp.ts_strptime("%Y-%b-%d %H:%M:%S.%f") # In: {"doc":{"timestamp":"2020-Aug-14 11:50:26.371000"}} # Out: {"doc":{"timestamp":"2020-08-14T11:50:26.371Z"}} ``` ### ts_sub > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Calculates the duration in nanoseconds between two timestamps (t1 - t2). Returns a signed integer: positive if t1 is after t2, negative if t1 is before t2. Use .abs() for absolute duration. #### Parameters | Name | Type | Description | | --- | --- | --- | | `t2` | `timestamp` | The timestamp to subtract from the target timestamp. | #### Examples Calculate absolute duration between two timestamps: ```bloblang root.between = this.started_at.ts_sub("2020-08-14T05:54:23Z").abs() # In: {"started_at":"2020-08-13T05:54:23Z"} # Out: {"between":86400000000000} ``` Calculate signed duration (can be negative): ```bloblang root.duration_ns = this.end_time.ts_sub(this.start_time) # In: {"start_time":"2020-08-14T10:00:00Z","end_time":"2020-08-14T11:30:00Z"} # Out: {"duration_ns":5400000000000} ``` ### ts_sub_iso8601 > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Subtracts an ISO 8601 duration from a timestamp with calendar-aware precision for years, months, and days. Useful when you need to subtract durations that account for variable month lengths or leap years. #### Parameters | Name | Type | Description | | --- | --- | --- | | `duration` | `string` | Duration in ISO 8601 format (e.g., "P1Y2M3D" for 1 year, 2 months, 3 days) | #### Examples Subtract one year from a timestamp: ```bloblang root.last_year = this.created_at.ts_sub_iso8601("P1Y") # In: {"created_at":"2020-08-14T05:54:23Z"} # Out: {"last_year":"2019-08-14T05:54:23Z"} ``` Subtract a complex duration with multiple units: ```bloblang root.past_date = this.created_at.ts_sub_iso8601("P1Y2M3DT4H5M6S") # In: {"created_at":"2021-03-04T04:05:06Z"} # Out: {"past_date":"2020-01-01T00:00:00Z"} ``` ### ts_tz > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Converts a timestamp to a different timezone while preserving the moment in time. Accepts unix timestamps (seconds with optional decimal precision) or RFC 3339 formatted strings. #### Parameters | Name | Type | Description | | --- | --- | --- | | `tz` | `string` | The timezone to change to. Use "UTC" for UTC, "Local" for local timezone, or an IANA Time Zone database location name like "America/New_York". | #### Examples Convert timestamp to UTC timezone: ```bloblang root.created_at_utc = this.created_at.ts_tz("UTC") # In: {"created_at":"2021-02-03T17:05:06+01:00"} # Out: {"created_at_utc":"2021-02-03T16:05:06Z"} ``` Convert timestamp to a specific timezone: ```bloblang root.created_at_ny = this.created_at.ts_tz("America/New_York") # In: {"created_at":"2021-02-03T16:05:06Z"} # Out: {"created_at_ny":"2021-02-03T11:05:06-05:00"} ``` ### ts_unix > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Converts a timestamp to a unix timestamp (seconds since epoch). Accepts unix timestamps or RFC 3339 strings. Returns an integer representing seconds. #### Examples Convert RFC 3339 timestamp to unix seconds: ```bloblang root.created_at_unix = this.created_at.ts_unix() # In: {"created_at":"2009-11-10T23:00:00Z"} # Out: {"created_at_unix":1257894000} ``` Unix timestamp passthrough returns same value: ```bloblang root.timestamp = this.ts.ts_unix() # In: {"ts":1257894000} # Out: {"timestamp":1257894000} ``` ### ts_unix_micro > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Converts a timestamp to a unix timestamp with microsecond precision (microseconds since epoch). Accepts unix timestamps or RFC 3339 strings. Returns an integer representing microseconds. #### Examples Convert timestamp to microseconds since epoch: ```bloblang root.created_at_unix = this.created_at.ts_unix_micro() # In: {"created_at":"2009-11-10T23:00:00Z"} # Out: {"created_at_unix":1257894000000000} ``` Preserve microsecond precision from timestamp: ```bloblang root.precise_time = this.timestamp.ts_unix_micro() # In: {"timestamp":"2020-08-14T11:45:26.123456Z"} # Out: {"precise_time":1597405526123456} ``` ### ts_unix_milli > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Converts a timestamp to a unix timestamp with millisecond precision (milliseconds since epoch). Accepts unix timestamps or RFC 3339 strings. Returns an integer representing milliseconds. #### Examples Convert timestamp to milliseconds since epoch: ```bloblang root.created_at_unix = this.created_at.ts_unix_milli() # In: {"created_at":"2009-11-10T23:00:00Z"} # Out: {"created_at_unix":1257894000000} ``` Useful for JavaScript timestamp compatibility: ```bloblang root.js_timestamp = this.event_time.ts_unix_milli() # In: {"event_time":"2020-08-14T11:45:26.123Z"} # Out: {"js_timestamp":1597405526123} ``` ### ts_unix_nano > ⚠️ **CAUTION** > > This method is in beta. Its behavior might change in a future release. Converts a timestamp to a unix timestamp with nanosecond precision (nanoseconds since epoch). Accepts unix timestamps or RFC 3339 strings. Returns an integer representing nanoseconds. #### Examples Convert timestamp to nanoseconds since epoch: ```bloblang root.created_at_unix = this.created_at.ts_unix_nano() # In: {"created_at":"2009-11-10T23:00:00Z"} # Out: {"created_at_unix":1257894000000000000} ``` Preserve full nanosecond precision: ```bloblang root.precise_time = this.timestamp.ts_unix_nano() # In: {"timestamp":"2020-08-14T11:45:26.123456789Z"} # Out: {"precise_time":1597405526123456789} ``` ## Type coercion ### array Return an array containing the target value. If the value is already an array it is unchanged. #### Examples ```bloblang root.my_array = this.name.array() # In: {"name":"foobar bazson"} # Out: {"my_array":["foobar bazson"]} ``` ### bool Attempt to parse a value into a boolean. An optional argument can be provided, in which case if the value cannot be parsed the argument will be returned instead. If the value is a number then any non-zero value will resolve to `true`, if the value is a string then any of the following values are considered valid: `1, t, T, TRUE, true, True, 0, f, F, FALSE`. #### Parameters | Name | Type | Description | | --- | --- | --- | | `default` (optional) | `bool` | An optional value to yield if the target cannot be parsed as a boolean. | #### Examples ```bloblang root.foo = this.thing.bool() root.bar = this.thing.bool(true) ``` ### bytes Marshal a value into a byte array. If the value is already a byte array it is unchanged. #### Examples ```bloblang root.first_byte = this.name.bytes().index(0) # In: {"name":"foobar bazson"} # Out: {"first_byte":102} ``` ### not_empty Ensures that the given string, array or object value is not empty, and if so returns it, otherwise an error is returned. #### Examples ```bloblang root.a = this.a.not_empty() # In: {"a":"foo"} # Out: {"a":"foo"} # In: {"a":""} # Out: Error("failed assignment (line 1): field `this.a`: string value is empty") # In: {"a":["foo","bar"]} # Out: {"a":["foo","bar"]} # In: {"a":[]} # Out: Error("failed assignment (line 1): field `this.a`: array value is empty") # In: {"a":{"b":"foo","c":"bar"}} # Out: {"a":{"b":"foo","c":"bar"}} # In: {"a":{}} # Out: Error("failed assignment (line 1): field `this.a`: object value is empty") ``` ### not_null Ensures that the given value is not `null`, and if so returns it, otherwise an error is returned. #### Examples ```bloblang root.a = this.a.not_null() # In: {"a":"foobar","b":"barbaz"} # Out: {"a":"foobar"} # In: {"b":"barbaz"} # Out: Error("failed assignment (line 1): field `this.a`: value is null") ``` ### number Attempt to parse a value into a number. An optional argument can be provided, in which case if the value cannot be parsed into a number the argument will be returned instead. #### Parameters | Name | Type | Description | | --- | --- | --- | | `default` (optional) | `float` | An optional value to yield if the target cannot be parsed as a number. | #### Examples ```bloblang root.foo = this.thing.number() + 10 root.bar = this.thing.number(5) * 10 ``` ### string Converts any value to its string representation. Numbers, booleans, and objects are converted to strings; existing strings are unchanged. Use for type coercion or creating string representations. #### Examples ```bloblang root.nested_json = this.string() # In: {"foo":"bar"} # Out: {"nested_json":"{\"foo\":\"bar\"}"} ``` ```bloblang root.id = this.id.string() # In: {"id":228930314431312345} # Out: {"id":"228930314431312345"} ``` ### timestamp Attempt to parse a value into a timestamp. An optional argument can be provided, in which case if the value cannot be parsed into a timestamp the argument will be returned instead. #### Parameters | Name | Type | Description | | --- | --- | --- | | `default` (optional) | `timestamp` | An optional value to yield if the target cannot be parsed as a timestamp. | #### Examples ```bloblang root.foo = this.ts.timestamp() root.bar = this.none.timestamp(1234567890.timestamp()) ``` ### type Returns the type of a value as a string, providing one of the following values: `string`, `bytes`, `number`, `bool`, `timestamp`, `array`, `object` or `null`. #### Examples ```bloblang root.bar_type = this.bar.type() root.foo_type = this.foo.type() # In: {"bar":10,"foo":"is a string"} # Out: {"bar_type":"number","foo_type":"string"} ``` ```bloblang root.type = this.type() # In: "foobar" # Out: {"type":"string"} # In: 666 # Out: {"type":"number"} # In: false # Out: {"type":"bool"} # In: ["foo", "bar"] # Out: {"type":"array"} # In: {"foo": "bar"} # Out: {"type":"object"} # In: null # Out: {"type":"null"} ``` ```bloblang root.type = content().type() # In: foobar # Out: {"type":"bytes"} ``` ```bloblang root.type = this.ts_parse("2006-01-02").type() # In: "2022-06-06" # Out: {"type":"timestamp"} ``` ## Deprecated ### format_timestamp > ⚠️ **WARNING** > > This method is deprecated and will be removed in a future version. Formats a timestamp as a string using Go’s reference time format. Defaults to RFC 3339 if no format specified. The format uses "Mon Jan 2 15:04:05 -0700 MST 2006" as a reference. Accepts unix timestamps (with decimal precision) or RFC 3339 strings. Use ts_strftime for strftime-style formats. #### Parameters | Name | Type | Description | | --- | --- | --- | | `format` (optional) | `string` | The output format using Go’s reference time. Default: `"2006-01-02T15:04:05.999999999Z07:00"`. | | `tz` (optional) | `string` | Optional timezone (e.g., 'UTC', 'America/New_York'). Defaults to input timezone or local time for unix timestamps. | ### format_timestamp_strftime > ⚠️ **WARNING** > > This method is deprecated and will be removed in a future version. Formats a timestamp as a string using strptime format specifiers (like %Y, %m, %d). Accepts unix timestamps (with decimal precision) or RFC 3339 strings. Supports %f for microseconds. Use ts_format for Go-style reference time formats. #### Parameters | Name | Type | Description | | --- | --- | --- | | `format` | `string` | The output format using strptime specifiers. | | `tz` (optional) | `string` | Optional timezone. Defaults to input timezone or local time for unix timestamps. | ### format_timestamp_unix > ⚠️ **WARNING** > > This method is deprecated and will be removed in a future version. Converts a timestamp to a unix timestamp (seconds since epoch). Accepts unix timestamps or RFC 3339 strings. Returns an integer representing seconds. ### format_timestamp_unix_micro > ⚠️ **WARNING** > > This method is deprecated and will be removed in a future version. Converts a timestamp to a unix timestamp with microsecond precision (microseconds since epoch). Accepts unix timestamps or RFC 3339 strings. Returns an integer representing microseconds. ### format_timestamp_unix_milli > ⚠️ **WARNING** > > This method is deprecated and will be removed in a future version. Converts a timestamp to a unix timestamp with millisecond precision (milliseconds since epoch). Accepts unix timestamps or RFC 3339 strings. Returns an integer representing milliseconds. ### format_timestamp_unix_nano > ⚠️ **WARNING** > > This method is deprecated and will be removed in a future version. Converts a timestamp to a unix timestamp with nanosecond precision (nanoseconds since epoch). Accepts unix timestamps or RFC 3339 strings. Returns an integer representing nanoseconds. ### parse_timestamp > ⚠️ **WARNING** > > This method is deprecated and will be removed in a future version. Parses a timestamp string using Go’s reference time format and outputs a timestamp object. The format uses "Mon Jan 2 15:04:05 -0700 MST 2006" as a reference - show how this reference time would appear in your format. Use ts_strptime for strftime-style formats instead. #### Parameters | Name | Type | Description | | --- | --- | --- | | `format` | `string` | The format of the input string using Go’s reference time. | ### parse_timestamp_strptime > ⚠️ **WARNING** > > This method is deprecated and will be removed in a future version. Parses a timestamp string using strptime format specifiers (like %Y, %m, %d) and outputs a timestamp object. Use ts_parse for Go-style reference time formats instead. #### Parameters | Name | Type | Description | | --- | --- | --- | | `format` | `string` | The format string using strptime specifiers (e.g., %Y-%m-%d). | --- # Page 308: Bloblang Walkthrough **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/walkthrough.md --- # Bloblang Walkthrough Bloblang is the most advanced mapping language that you’ll learn from this walkthrough (probably). It is designed for readability, the power to shape even the most outrageous input documents, and to easily make erratic schemas bend to your will. Bloblang is the native mapping language of Redpanda Connect, but it has been designed as a general purpose technology ready to be adopted by other tools. In this walkthrough you’ll learn how to make new friends by mapping their documents, and lose old friends as they grow jealous and bitter of your mapping abilities. There are a few ways to execute Bloblang but the way we’ll do it in this guide is to pull a Redpanda Connect docker image and run the command `rpk connect blobl server`, which opens up an interactive Bloblang editor: ```sh docker pull docker.redpanda.com/redpandadata/connect:latest docker run -p 4195:4195 --rm docker.redpanda.com/redpandadata/connect blobl server --no-open --host 0.0.0.0 ``` Next, open your browser at `http://localhost:4195` and you should see an app with three panels, the top-left is where you paste an input document, the bottom is your Bloblang mapping and on the top-right is the output. ## Your first assignment The primary goal of a Bloblang mapping is to construct a brand new document by using an input document as a reference, which we achieve through a series of assignments. Bloblang is traditionally used to map JSON documents and that’s mostly what we’ll be doing in this walkthrough. The first mapping you’ll see when you open the editor is a single assignment: ```bloblang root = this # In: {"message":"hello world"} # Out: {"message":"hello world"} ``` On the left-hand side of the assignment is our assignment target, where `root` is a keyword referring to the root of the new document being constructed. On the right-hand side is a query which determines the value to be assigned, where `this` is a keyword that refers to the context of the mapping which begins as the root of the input document. As you can see the input document in the editor begins as a JSON object `{"message":"hello world"}`, and the output panel should show the result as: ```json { "message": "hello world" } ``` This output is a (neatly formatted) replica of the input document. This is the result of our mapping because we assigned the entire input document to the root of our new thing. Let’s create a brand new document by assigning a fresh object to the root: ```bloblang root = {} root.foo = this.message # In: {"message":"hello world"} # Out: {"foo":"hello world"} ``` Bloblang supports a bunch of [literal types](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/about/#literals), and the first line of this mapping assigns an empty object literal to the root. The second line then creates a new field `foo` on that object by assigning it the value of `message` from the input document. You should see that our output has changed to: ```json { "foo": "hello world" } ``` In Bloblang, when the path that we assign to contains fields that are themselves unset then they are created as empty objects. This rule also applies to `root` itself, which means the mapping: ```bloblang root.foo.bar = this.message root.foo."buz me".baz = "I like mapping" # In: {"message":"hello world"} # Out: {"foo":{"bar":"hello world","buz me":{"baz":"I like mapping"}}} ``` Will automatically create the objects required to produce the output document: ```json { "foo": { "bar": "hello world", "buz me": { "baz": "I like mapping" } } } ``` Also note that we can use quotes in order to express path segments that contain symbols or whitespace. Great, let’s move on quick before our self-satisfaction gets in the way of progress. ## Basic methods and functions Nothing is ever good enough for you, why should the input document be any different? Usually in our mappings it’s necessary to mutate values whilst we map them over, this is almost always done with methods, of which [there are many](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/). To demonstrate we’re going to change our mapping to [uppercase](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#uppercase) the field `message` from our input document: ```bloblang root.foo.bar = this.message.uppercase() root.foo."buz me".baz = "I like mapping" # In: {"message":"hello world"} # Out: {"foo":{"bar":"HELLO WORLD","buz me":{"baz":"I like mapping"}}} ``` As you can see the syntax for a method is similar to many languages, simply add a dot on the target value followed by the method name and arguments within brackets. With this method added our output document should look like this: ```json { "foo": { "bar": "HELLO WORLD", "buz me": { "baz": "I like mapping" } } } ``` Since the result of any Bloblang query is a value you can use methods on anything, including other methods. For example, we could expand our mapping of `message` to also replace `WORLD` with `EARTH` using the [`replace_all` method](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#replace_all): ```bloblang root.foo.bar = this.message.uppercase().replace_all("WORLD", "EARTH") root.foo."buz me".baz = "I like mapping" # In: {"message":"hello world"} # Out: {"foo":{"bar":"HELLO EARTH","buz me":{"baz":"I like mapping"}}} ``` As you can see this method required some arguments. Methods support both nameless (like above) and named arguments, which are often literal values but can also be queries themselves. For example try out the following mapping using both named style and a dynamic argument: ```bloblang root.foo.bar = this.message.uppercase().replace_all(old: "WORLD", new: this.message.capitalize()) root.foo."buz me".baz = "I like mapping" # In: {"message":"hello world"} # Out: {"foo":{"bar":"HELLO Hello World","buz me":{"baz":"I like mapping"}}} ``` Woah, I think that’s the plot to Inception, let’s move onto functions. Functions are just boring methods that don’t have a target, and there are [plenty of them as well](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/). Functions are often used to extract information unrelated to the input document, such as [environment variables](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/#env), or to generate data such as [timestamps](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/#now) or [UUIDs](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/#uuid_v4). Since we’re completionists let’s add one to our mapping: ```bloblang root.foo.bar = this.message.uppercase().replace_all("WORLD", "EARTH") root.foo."buz me".baz = "I like mapping" root.foo.id = uuid_v4() # In: {"message":"hello world"} ``` Now I can’t tell you what the output looks like since it will be different each time it’s mapped, how fun! ### Deletions Everything in Bloblang is an expression to be assigned, including deletions, which is a [function `deleted()`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/#deleted). To illustrate let’s create a field we want to delete by changing our input to the following: ```json { "name": "fooman barson", "age": 7, "opinions": ["trucks are cool","trains are cool","chores are bad"] } ``` If we wanted a full copy of this document without the field `name` then we can assign `deleted()` to it: ```bloblang root = this root.name = deleted() # In: {"name":"fooman barson","age":7,"opinions":["trucks are cool","trains are cool","chores are bad"]} # Out: {"age":7,"opinions":["trucks are cool","trains are cool","chores are bad"]} ``` And it won’t be included in the output: ```json { "age": 7, "opinions": [ "trucks are cool", "trains are cool", "chores are bad" ] } ``` An alternative way to delete fields is the [method `without`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#without), our above example could be rewritten as a single assignment `root = this.without("name")`. However, `deleted()` is generally more powerful and will come into play more later on. ## Variables Sometimes it’s necessary to capture a value for later, but we might not want it to be added to the resulting document. In Bloblang we can achieve this with variables which are created using the `let` keyword, and can be referenced within subsequent queries with a dollar sign prefix: ```bloblang let id = uuid_v4() root.id_sha1 = $id.hash("sha1").encode("hex") root.id_md5 = $id.hash("md5").encode("hex") # In: {} ``` Variables can be assigned any value type, including objects and arrays. ## Unstructured and binary data So far in all of our examples both the input document and our newly mapped document are structured, but this does not need to be so. Try assigning some literal value types directly to the `root`, such as a string `root = "hello world"`, or a number `root = 5`. You should notice that when a value type is assigned to the root the output is the raw value, and therefore strings are not quoted. This is what makes it possible to output data of any format, including encrypted, encoded or otherwise binary data. Unstructured mapping is not limited to the output. Rather than referencing the input document with `this`, where it must be structured, it is possible to reference it as a binary string with the [function `content`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/#content), try changing your mapping to: ```bloblang root = content().uppercase() # In: hello world # Out: HELLO WORLD ``` When you add content to the input panel, it should be the same in the output panel, but in all uppercase. ## Conditionals In order to play around with conditionals let’s set our input to something structured: ```json { "pet": { "type": "cat", "is_cute": true, "treats": 5, "toys": 3 } } ``` In Bloblang all conditionals are expressions, this is a core principal of Bloblang and will be important later on when we’re mapping deeply nested structures. ### If expression The simplest conditional is the `if` expression, where the boolean condition does not need to be in parentheses. Let’s create a map that modifies the number of treats our pet receives based on a field: ```bloblang root = this root.pet.treats = if this.pet.is_cute { this.pet.treats + 10 } # In: {"pet":{"type":"cat","is_cute":true,"treats":5,"toys":3}} # Out: {"pet":{"type":"cat","is_cute":true,"treats":15,"toys":3}} ``` Try that mapping out and you should see the number of treats in the output increased to 15. Now try changing the input field `pet.is_cute` to `false` and the output treats count should go back to the original 5. When a conditional expression doesn’t have a branch to execute then the assignment is skipped entirely, which means when the pet is not cute the value of `pet.treats` is unchanged (and remains the value set in the `root = this` assignment). We can add an `else` block to our `if` expression to remove treats entirely when the pet is not cute: ```bloblang root = this root.pet.treats = if this.pet.is_cute { this.pet.treats + 10 } else { deleted() } # In: {"pet":{"type":"cat","is_cute":true,"treats":5,"toys":3}} # Out: {"pet":{"type":"cat","is_cute":true,"treats":15,"toys":3}} ``` This is possible because field deletions are expressed as assigned values created with the `deleted()` function. ### If statement The `if` keyword can also be used as a statement in order to conditionally apply a series of mapping assignments, the previous example can be rewritten as: ```bloblang root = this if this.pet.is_cute { root.pet.treats = this.pet.treats + 10 } else { root.pet.treats = deleted() } # In: {"pet":{"type":"cat","is_cute":true,"treats":5,"toys":3}} # Out: {"pet":{"type":"cat","is_cute":true,"treats":15,"toys":3}} ``` Converting this mapping to use a statement has resulted in a more verbose mapping as we had to specify `root.pet.treats` multiple times as an assignment target. However, using `if` as a statement can be beneficial when multiple assignments rely on the same logic: ```bloblang root = this if this.pet.is_cute { root.pet.treats = this.pet.treats + 10 root.pet.toys = this.pet.toys + 10 } # In: {"pet":{"type":"cat","is_cute":true,"treats":5,"toys":3}} # Out: {"pet":{"type":"cat","is_cute":true,"treats":15,"toys":13}} ``` More treats _and_ more toys! Lucky Spot! ### Match expression Another conditional expression is `match` which allows you to list many branches consisting of a condition and a query to execute separated with `=>`, where the first condition to pass is the one that is executed: ```bloblang root = this root.pet.toys = match { this.pet.treats > 5 => this.pet.treats - 5, this.pet.type == "cat" => 3, this.pet.type == "dog" => this.pet.toys - 3, this.pet.type == "horse" => this.pet.toys + 10, _ => 0, } # In: {"pet":{"type":"cat","is_cute":true,"treats":5,"toys":3}} # Out: {"pet":{"type":"cat","is_cute":true,"treats":5,"toys":3}} ``` Try executing that mapping with different values for `pet.type` and `pet.treats`. Match expressions can also specify a new context for the keyword `this` which can help reduce some of the boilerplate in your boolean conditions. The following mapping is equivalent to the previous: ```bloblang root = this root.pet.toys = match this.pet { this.treats > 5 => this.treats - 5, this.type == "cat" => 3, this.type == "dog" => this.toys - 3, this.type == "horse" => this.toys + 10, _ => 0, } # In: {"pet":{"type":"cat","is_cute":true,"treats":5,"toys":3}} # Out: {"pet":{"type":"cat","is_cute":true,"treats":5,"toys":3}} ``` Your boolean conditions can also be expressed as value types, in which case the context being matched will be compared to the value: ```bloblang root = this root.pet.toys = match this.pet.type { "cat" => 3, "dog" => 5, "rabbit" => 8, "horse" => 20, _ => 0, } # In: {"pet":{"type":"cat","is_cute":true,"treats":5,"toys":3}} # Out: {"pet":{"type":"cat","is_cute":true,"treats":5,"toys":3}} ``` ## Error handling Bloblang can simplify handling errors. First, let’s take a look at what happens when errors _aren’t_ handled, change your input to the following: ```json { "palace_guards": 10, "angry_peasants": "I couldn't be bothered to ask them" } ``` And change your mapping to something simple like a number comparison: ```bloblang root.in_trouble = this.angry_peasants > this.palace_guards # In: {"palace_guards":10,"angry_peasants":"I couldn't be bothered to ask them"} ``` Uh oh! It looks like our canvasser was too lazy and our `angry_peasants` count was incorrectly set for this document. You should see an error in the output window that mentions something like `cannot compare types string (from field this.angry_peasants) and number (from field this.palace_guards)`, which means the mapping was abandoned. So what if we want to try and map something, but don’t care if it fails? In this case if we are unable to compare our angry peasants with palace guards then I would still consider us in trouble just to be safe. For that we have a special [method `catch`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#catch), which if we add to any query allows us to specify an argument to be returned when an error occurs. Since methods can be added to any query we can surround our arithmetic with brackets and catch the whole thing: ```bloblang root.in_trouble = (this.angry_peasants > this.palace_guards).catch(true) # In: {"palace_guards":10,"angry_peasants":"I couldn't be bothered to ask them"} # Out: {"in_trouble":true} ``` Now instead of an error we should see an output with `in_trouble` set to `true`. Try changing to value of `angry_peasants` to a few different values, including some numbers. One of the powerful features of `catch` is that when it is added at the end of a series of expressions and methods it will capture errors at any part of the series, allowing you to capture errors at any granularity. For example, the mapping: ```bloblang root.abort_mission = if this.mission.type == "impossible" { !this.user.motives.contains("must clear name") } else { this.mission.difficulty > 10 }.catch(false) # In: {"mission":{"type":"impossible","difficulty":5},"user":{"motives":["must clear name"]}} # Out: {"abort_mission":false} ``` Will catch errors caused by: - `this.mission.type` not being a string - `this.user.motives` not being an array - `this.mission.difficulty` not being a number But will always return `false` if any of those errors occur. Try it out with this input and play around by breaking some of the fields: ```json { "mission": { "type": "impossible", "difficulty": 5 }, "user": { "motives": ["must clear name"] } } ``` Now try out this mapping: ```bloblang root.abort_mission = if (this.mission.type == "impossible").catch(true) { !this.user.motives.contains("must clear name").catch(false) } else { (this.mission.difficulty > 10).catch(true) } # In: {"mission":{"type":"impossible","difficulty":5},"user":{"motives":["must clear name"]}} # Out: {"abort_mission":false} ``` This version is more granular and will capture each of the errors individually, with each error given a unique `true` or `false` fallback. ## Validation Sometimes errors are what we want. Failing a mapping with an error allows us to handle the bad document in other ways, such as routing it to a dead-letter queue or filtering it entirely. You can read about common Redpanda Connect error handling patterns for bad data in the [error handling guide](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/error_handling/), but the first step is to create the error. Luckily, Bloblang has a range of ways of creating errors under certain circumstances, which can be used in order to validate the data being mapped. There are [a few helper methods](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#type-coercion) that make validating and coercing fields nice and easy, try this mapping out: ```bloblang root.foo = this.foo.number() root.bar = this.bar.not_null() root.baz = this.baz.not_empty() # In: {"foo":5,"bar":"hello world","baz":[1,2,3]} # Out: {"foo":5,"bar":"hello world","baz":[1,2,3]} ``` With some of these sample inputs: ```json {"foo":"nope","bar":"hello world","baz":[1,2,3]} {"foo":5,"baz":[1,2,3]} {"foo":10,"bar":"hello world","baz":[]} ``` However, these methods don’t cover all use cases. The general purpose error throwing technique is the [`throw` function](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/functions/#throw), which takes an argument string that describes the error. When it’s called it will throw a mapping error that abandons the mapping. For example, we can check the type of a field with the [method `type`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#type), and then throw an error if it’s not the type we expected: ```bloblang root.foos = if this.user.foos.type() == "array" { this.user.foos } else { throw("foos must be an array, but it ain't, what gives?") } # In: {"user":{"foos":[1,2,3]}} ``` Try this mapping out with a few sample inputs: ```json {"user":{"foos":[1,2,3]}} {"user":{"foos":"1,2,3"}} ``` ## Context In Bloblang, when we refer to the context we’re talking about the value returned with the keyword `this`. At the beginning of a mapping the context starts off as a reference to the root of a structured input document, which is why the mapping `root = this` will result in the same document coming out as you put in. However, in Bloblang there are mechanisms whereby the context might change, we’ve already seen how this can happen within a `match` expression. Another useful way to change the context is by adding a bracketed query expression as a method to a query, which looks like this: ```bloblang root = this.foo.bar.(this.baz + this.buz) # In: {"foo":{"bar":{"baz":1,"buz":2}}} # Out: 3 ``` Within the bracketed query expression the context becomes the result of the query that it’s a method of, so within the brackets in the above mapping the value of `this` points to the result of `this.foo.bar`, and the mapping is therefore equivalent to: ```bloblang root = this.foo.bar.baz + this.foo.bar.buz # In: {"foo":{"bar":{"baz":1,"buz":2}}} # Out: 3 ``` With this handy trick the `throw` mapping from the validation section above could be rewritten as: ```bloblang root.foos = this.user.foos.(if this.type() == "array" { this } else { throw("foos must be an array, but it ain't, what gives?") }) # In: {"user":{"foos":[1,2,3]}} # Out: {"foos":[1,2,3]} ``` ### Naming the context Shadowing the keyword `this` with new contexts can look confusing in your mappings, and it also limits you to only being able to reference one context at any given time. As an alternative, Bloblang supports context capture expressions that look similar to lambda functions from other languages, where you can name the new context with the syntax ` -> `, which looks like this: ```bloblang root = this.foo.bar.(thing -> thing.baz + thing.buz) # In: {"foo":{"bar":{"baz":1,"buz":2}}} # Out: 3 ``` Within the brackets we now have a new field `thing`, which returns the context that would have otherwise been captured as `this`. This also means the value returned from `this` hasn’t changed and will continue to return the root of the input document. ## Coalescing Being able to open up bracketed query expressions on fields leads us onto another cool trick in Bloblang referred to as coalescing. It’s very common in the world of document mapping that due to structural deviations a value that we wish to obtain could come from one of multiple possible paths. To illustrate this problem change the input document to the following: ```json { "thing": { "article": { "id": "foo", "contents": "Some people did some stuff" } } } ``` Let’s say we wish to flatten this structure with the following mapping: ```bloblang root.contents = this.thing.article.contents # In: {"thing":{"article":{"id":"foo","contents":"Some people did some stuff"}}} # Out: {"contents":"Some people did some stuff"} ``` But articles are only one of many document types we expect to receive, where the field `contents` remains the same but the field `article` could instead be `comment` or `share`. In this case we could expand our map of `contents` to use a `match` expression where we check for the existence of `article`, `comment`, etc in the input document. However, a much cleaner way of approaching this is with the pipe operator (`|`), which in Bloblang can be used to join multiple queries, where the first to yield a non-null result is selected. Change your mapping to the following: ```bloblang root.contents = this.thing.article.contents | this.thing.comment.contents # In: {"thing":{"article":{"id":"foo","contents":"Some people did some stuff"}}} # Out: {"contents":"Some people did some stuff"} ``` And now try changing the field `article` in your input document to `comment`. You should see that the value of `contents` remains as `Some people did some stuff` in the output document. Now, rather than write out the full path prefix `this.thing` each time we can use a bracketed query expression to change the context, giving us more space for adding other fields: ```bloblang root.contents = this.thing.(this.article | this.comment | this.share).contents # In: {"thing":{"article":{"id":"foo","contents":"Some people did some stuff"}}} # Out: {"contents":"Some people did some stuff"} ``` And by the way, the keyword `this` within queries can be omitted and made implicit, which allows us to reduce this even further: ```bloblang root.contents = this.thing.(article | comment | share).contents # In: {"thing":{"article":{"id":"foo","contents":"Some people did some stuff"}}} # Out: {"contents":"Some people did some stuff"} ``` Finally, we can also add a pipe operator at the end to fallback to a literal value when none of our candidates exists: ```bloblang root.contents = this.thing.(article | comment | share).contents | "nothing" # In: {"thing":{"article":{"id":"foo","contents":"Some people did some stuff"}}} # Out: {"contents":"Some people did some stuff"} ``` Neat. ## Advanced methods What happens when you need to map all of the elements of an array? Or filter the keys of an object by their values? What if the fellowship just used the eagles to fly to mount doom? Bloblang offers a bunch of advanced methods for [manipulating structured data types](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#object-array-manipulation), let’s take a quick tour of some of the cooler ones. Set your input document to this list of things: ```json { "num_friends": 5, "things": [ { "name": "yo-yo", "quantity": 10, "is_cool": true }, { "name": "dish soap", "quantity": 50, "is_cool": false }, { "name": "scooter", "quantity": 1, "is_cool": true }, { "name": "pirate hat", "quantity": 7, "is_cool": true } ] } ``` Let’s say we wanted to reduce the `things` in our input document to only those that are cool and where we have enough of them to share with our friends. We can do this with a [`filter` method](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#filter): ```bloblang root = this.things.filter(thing -> thing.is_cool && thing.quantity > this.num_friends) # In: {"num_friends":5,"things":[{"name":"yo-yo","quantity":10,"is_cool":true},{"name":"dish soap","quantity":50,"is_cool":false},{"name":"scooter","quantity":1,"is_cool":true},{"name":"pirate hat","quantity":7,"is_cool":true}]} # Out: [{"name":"yo-yo","quantity":10,"is_cool":true},{"name":"pirate hat","quantity":7,"is_cool":true}] ``` Try running that mapping and you’ll see that the output is reduced. What is happening here is that the `filter` method takes an argument that is a query, and that query will be mapped for each individual element of the array (where the context is changed to the element itself). We have captured the context into a field `thing` which allows us to continue referencing the root of the input with `this`. The `filter` method requires the query parameter to resolve to a boolean `true` or `false`, and if it resolves to `true` the element will be present in the resulting array, otherwise it is removed. Being able to express a query argument to be applied to a range in this way is one of the more powerful features of Bloblang, and when mapping complex structured data these advanced methods will likely be a common tool that you’ll reach for. Another such method is [`map_each`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#map_each), which allows you to mutate each element of an array, or each value of an object. Change your input document to the following: ```json { "talking_heads": [ "1:E.T. is a bad film,Pokemon corrupted an entire generation", "2:Digimon ripped off Pokemon,Cats are boring", "3:I'm important", "4:Science is just made up,The Pokemon films are good,The weather is good" ] } ``` Here we have an array of talking heads, where each element is a string containing an identifer, a colon, and a comma separated list of their opinions. We wish to map each string into a structured object, which we can do with the following mapping: ```bloblang root = this.talking_heads.map_each(raw -> { "id": raw.split(":").index(0), "opinions": raw.split(":").index(1).split(",") }) # In: {"talking_heads":["1:E.T. is a bad film,Pokemon corrupted an entire generation","2:Digimon ripped off Pokemon,Cats are boring","3:I'm important","4:Science is just made up,The Pokemon films are good,The weather is good"]} # Out: [{"id":"1","opinions":["E.T. is a bad film","Pokemon corrupted an entire generation"]},{"id":"2","opinions":["Digimon ripped off Pokemon","Cats are boring"]},{"id":"3","opinions":["I'm important"]},{"id":"4","opinions":["Science is just made up","The Pokemon films are good","The weather is good"]}] ``` The argument to `map_each` is a query where the context is the element, which we capture into the field `raw`. The result of the query argument will become the value of the element in the resulting array, and in this case we return an object literal. In order to separate the identifier from opinions we perform a `split` by colon on the raw string element and get the first substring with the `index` method. We then do the split again and extract the remainder, and split that by comma in order to extract all of the opinions to an array field. However, one problem with this mapping is that the split by colon is written out twice and executed twice. A more efficient way of performing the same thing is with the bracketed query expressions we’ve played with before: ```bloblang root = this.talking_heads.map_each(raw -> raw.split(":").(split_string -> { "id": split_string.index(0), "opinions": split_string.index(1).split(",") })) # In: {"talking_heads":["1:E.T. is a bad film,Pokemon corrupted an entire generation","2:Digimon ripped off Pokemon,Cats are boring","3:I'm important","4:Science is just made up,The Pokemon films are good,The weather is good"]} # Out: [{"id":"1","opinions":["E.T. is a bad film","Pokemon corrupted an entire generation"]},{"id":"2","opinions":["Digimon ripped off Pokemon","Cats are boring"]},{"id":"3","opinions":["I'm important"]},{"id":"4","opinions":["Science is just made up","The Pokemon films are good","The weather is good"]}] ``` > 📝 **NOTE: Challenge!** > > Challenge! > > Try updating that map so that only opinions that mention Pokemon are kept To find more methods for manipulating structured data types check out the [methods page](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#object-array-manipulation). ## Reusable mappings Bloblang has cool methods, sure, but there’s nothing cooler than methods you’ve made yourself. When the going gets tough in the mapping world the best solution is often to create a named mapping, which you can do with the keyword `map`: ```bloblang map parse_talking_head { let split_string = this.split(":") root.id = $split_string.index(0) root.opinions = $split_string.index(1).split(",") } root = this.talking_heads.map_each(raw -> raw.apply("parse_talking_head")) # In: {"talking_heads":["1:E.T. is a bad film,Pokemon corrupted an entire generation","2:Digimon ripped off Pokemon,Cats are boring","3:I'm important","4:Science is just made up,The Pokemon films are good,The weather is good"]} # Out: [{"id":"1","opinions":["E.T. is a bad film","Pokemon corrupted an entire generation"]},{"id":"2","opinions":["Digimon ripped off Pokemon","Cats are boring"]},{"id":"3","opinions":["I'm important"]},{"id":"4","opinions":["Science is just made up","The Pokemon films are good","The weather is good"]}] ``` The body of a named map, encapsulated with squiggly brackets, is a totally isolated mapping where `root` now refers to a new value being created for each invocation of the map, and `this` refers to the root of the context provided to the map. Named maps are executed with the [method `apply`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#apply), which has a string parameter identifying the map to execute, this means it’s possible to dynamically select the target map. As you can see in the above example we were able to use a custom map in order to create our talking head objects without the object literal. Within a named map we can also create variables that exist only within the scope of the map. A nice feature of named mappings is that they can invoke themselves recursively, allowing you to define mappings that walk deeply nested structures. The following mapping will scrub all values from a document that contain the word "Voldemort" (case insensitive): ```bloblang map remove_naughty_man { root = match { this.type() == "object" => this.map_each(item -> item.value.apply("remove_naughty_man")), this.type() == "array" => this.map_each(ele -> ele.apply("remove_naughty_man")), this.type() == "string" => if this.lowercase().contains("voldemort") { deleted() }, this.type() == "bytes" => if this.lowercase().contains("voldemort") { deleted() }, _ => this, } } root = this.apply("remove_naughty_man") # In: {"summer_party":{"theme":"the woman in black","guests":["Emma Bunton","the seal I spotted in Trebarwith","Voldemort","The cast of Swiss Army Man","Richard"],"notes":{"lisa":"I don't think voldemort eats fish","monty":"Seals hate dance music"}},"crushes":["Richard is nice but he hates pokemon","Victoria Beckham but I think she's taken","Charlie but they're totally into Voldemort"]} ``` Try running that mapping with the following input document: ```json { "summer_party": { "theme": "the woman in black", "guests": [ "Emma Bunton", "the seal I spotted in Trebarwith", "Voldemort", "The cast of Swiss Army Man", "Richard" ], "notes": { "lisa": "I don't think voldemort eats fish", "monty": "Seals hate dance music" } }, "crushes": [ "Richard is nice but he hates pokemon", "Victoria Beckham but I think she's taken", "Charlie but they're totally into Voldemort" ] } ``` ## Unit testing Redpanda Connect has it’s own [unit testing capabilities](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/unit_testing/) that you can also use for your mappings. To start with save a mapping into a file called something like `naughty_man.blobl`, we can use the example above from the reusable mappings section: ```bloblang map remove_naughty_man { root = match { this.type() == "object" => this.map_each(item -> item.value.apply("remove_naughty_man")), this.type() == "array" => this.map_each(ele -> ele.apply("remove_naughty_man")), this.type() == "string" => if this.lowercase().contains("voldemort") { deleted() }, this.type() == "bytes" => if this.lowercase().contains("voldemort") { deleted() }, _ => this, } } root = this.apply("remove_naughty_man") ``` Next, we can define our unit tests in an accompanying YAML file in the same directory, let’s call this `naughty_man_test.yaml`: ```yaml tests: - name: test naughty man scrubber target_mapping: './naughty_man.blobl' environment: {} input_batch: - content: | { "summer_party": { "theme": "the woman in black", "guests": [ "Emma Bunton", "the seal I spotted in Trebarwith", "Voldemort", "The cast of Swiss Army Man", "Richard" ] } } output_batches: - - json_equals: { "summer_party": { "theme": "the woman in black", "guests": [ "Emma Bunton", "the dolphin I spotted in Trebarwith", "The cast of Swiss Army Man", "Richard" ] } } ``` As you can see we’ve defined a single test, where we point to our mapping file which will be executed in our test. We then specify an input message which is a reduced version of the document we tried out before, and finally we specify output predicates, which is a JSON comparison against the output document. We can execute these tests with `rpk connect test ./naughty_man_test.yaml`, Redpanda Connect will also automatically find our tests if you simply run `rpk connect test ./…​`. You should see an output something like: ```text Test 'naughty_man_test.yaml' failed Failures: --- naughty_man_test.yaml --- test naughty man scrubber [line 2]: batch 0 message 0: json_equals: JSON content mismatch { "summer_party": { "guests": [ "Emma Bunton", "the seal I spotted in Trebarwith" => "the dolphin I spotted in Trebarwith", "The cast of Swiss Army Man", "Richard" ], "theme": "the woman in black" } } ``` Because in actual fact our expected output is wrong, I’ll leave it to you to spot the error. Once the test is fixed you should see: ```text Test 'naughty_man_test.yaml' succeeded ``` And now our mapping, should we need to expand it in the future, is better protected against regressions. You can read more about the Redpanda Connect unit test specification, including alternative output predicates, in [this document](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/unit_testing/). --- # Page 309: Amazon Web Services **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/aws.md --- # Amazon Web Services There are many components within Redpanda Connect which utilize AWS services. You will find that each of these components contains a configuration section under the field `credentials`, of the format: ```yml credentials: profile: "" id: "" secret: "" token: "" role: "" role_external_id: "" ``` This section contains many fields and it isn’t immediately clear which of them are compulsory and which aren’t. This document aims to make it clear what each field is responsible for and how it might be used. ## Credentials By explicitly setting the credentials you are using at the component level it’s possible to connect to components using different accounts within the same Redpanda Connect process. If you are using long term credentials for your account you only need to set the fields `id` and `secret`: ```yml credentials: id: foo # aws_access_key_id secret: bar # aws_secret_access_key ``` If you are using short term credentials then you will also need to set the field `token`: ```yml credentials: id: foo # aws_access_key_id secret: bar # aws_secret_access_key token: baz # aws_session_token ``` ## Assume a role It’s also possible to configure Redpanda Connect to [assume a role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) using your credentials by setting the field `role` to your target role ARN. ```yml credentials: role: fooarn # Role ARN ``` This does NOT require explicit credentials, but it’s possible to use both. > 📝 **NOTE** > > Redpanda Cloud pipelines cannot assume roles through the default credential chain (IAM Roles for Service Accounts), and you cannot grant Redpanda-managed IAM roles permission to assume your roles. To assume a role from a Cloud pipeline, set explicit `id` and `secret` credentials for an IAM identity that you own and that has permission to assume the target role, and make sure the target role’s trust policy trusts that identity. Store these credentials as [secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/). If you need to assume a role owned by another organization they might require you to [provide an external ID](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html), in which case place it in the field `role_external_id`: ```yml credentials: role: fooarn # Role ARN role_external_id: bar_id ``` --- # Page 310: Ingest Real-Time Sensor Telemetry with the HTTP Gateway **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/gateway.md --- # Ingest Real-Time Sensor Telemetry with the HTTP Gateway In this guide, you’ll build a pipeline that uses the `gateway` input to receive real-time telemetry data from sensors over HTTP. Each incoming message is normalized, published to a Redpanda topic, and acknowledged back to the sender. This setup is ideal for IoT, mobile, and embedded systems that need to stream data to Redpanda Cloud without using a Kafka client. The `gateway` input exposes a secure HTTP endpoint, simplifying ingestion from devices. Because HTTP is universally supported, it’s easier to integrate on constrained devices, microcontrollers, or languages that don’t support Kafka natively. Additional benefits: - **Simplified security**: Devices authenticate with Redpanda Cloud API tokens (using Bearer headers). No need to embed Kafka credentials, manage TLS, or expose brokers publicly. - **Operational flexibility**: Devices are decoupled from Kafka internals like topics or schemas. You can evolve pipeline logic without touching device code. - **Automatic provisioning**: Redpanda Cloud generates a secure endpoint URL when you deploy the pipeline. ## Prerequisites - A Redpanda Cloud cluster (Serverless, Dedicated, or BYOC) - cURL or another compatible HTTP client ## Create a sensor user in Redpanda Cloud A sensor user is required to securely authenticate and manage access to the `sensor.telemetry` topic, ensuring that only authorized devices can produce messages to the topic. 1. [Log in to Redpanda Cloud](https://cloud.redpanda.com). 2. Go to **Topics** and create a topic named `sensor.telemetry`. This topic will be used to store incoming telemetry messages. 3. Go to **Security** and create a user with the following details: - **Username**: `sensor-sasl-user` - **Password**: `` (choose a secure password) - **SASL Mechanism**: `SCRAM-SHA-256` 4. Copy the password and save it securely for the next step. 5. Go to **Secrets Store** and create a new secret named `SENSOR_SASL_PASSWORD` with the value of the password you set for the user. - Set the scope of the secret to Redpanda Cluster and Redpanda Connect. 6. Go to **Security > ACLs** and create an access policy for the `sensor-sasl-user` user. This policy should allow the user to produce messages to the `sensor.telemetry` topic. ## Create a service account The service account is used to authenticate requests to the gateway endpoint. It provides a secure way to manage access to the gateway without embedding sensitive credentials in your devices. 1. [Create a new service account](https://cloud.redpanda.com/service-accounts/new) in Redpanda Cloud named `sensor-ingest` and give it a description like "Service account for sensor telemetry ingestion". 2. Copy the client ID and secret. 3. Request a new API token for the service account. This token will be used to authenticate requests to the gateway. ```bash curl --request POST \ --url 'https://auth.prd.cloud.redpanda.com/oauth/token' \ --header 'content-type: application/x-www-form-urlencoded' \ --data grant_type=client_credentials \ --data client_id= \ --data client_secret= \ --data audience=cloudv2-production.redpanda.cloud ``` Replace `` and `` with the values you copied from the service account. The request response provides an access token that remains **valid for one hour**. 4. Set the access token as an environment variable: ```bash export CLOUD_API_TOKEN= ``` ## Create a Redpanda Cloud pipeline 1. Go to **Connect** and click **Create Pipeline**. 2. Name the pipeline `sensor-telemetry-ingest` and give it a description like "Ingest real-time sensor telemetry data". 3. Paste the following pipeline configuration into the editor: ```yaml input: gateway: rate_limit: "limit" rate_limit_resources: - label: limit local: count: 100 interval: 1s pipeline: processors: - bloblang: | root.sensor_id = this.sensor_id root.type = this.type root.value = this.value root.unit = this.unit root.received_at = now() output: broker: pattern: fan_out_sequential outputs: - redpanda: seed_brokers: - ${REDPANDA_BROKERS} topic: sensor.telemetry tls: enabled: true sasl: - mechanism: SCRAM-SHA-256 username: sensor-sasl-user password: ${secrets.SENSOR_SASL_PASSWORD} - sync_response: processors: - mapping: | root = { "status": "ok", "received_at": now() } ``` This pipeline listens for incoming telemetry messages over HTTP and processes each one in real time. Here’s what each section does: - `input.gateway`: Defines the input source. It exposes a secure HTTP endpoint that devices can post to. The optional `rate_limit` named `limit` is applied to protect the pipeline from overload. - `rate_limit_resources.limit`: Limits traffic to 100 requests per second. If this rate is exceeded, HTTP requests are rejected with a 429 response. - `pipeline.processors.bloblang`: Normalizes the incoming message by copying fields and adding a `received_at` timestamp (using the current time). - `output.broker`: Uses a `fan_out_sequential` pattern to send each message to two outputs: - The first output publishes the normalized message to the `sensor.telemetry` Redpanda topic. - The second output sends a synchronous JSON response back to the sender confirming receipt. 4. Click **Start**. The pipeline starts deploying. When the state changes to "Running", the pipeline is ready to accept incoming messages. 5. Click the pipeline to view its details. When the pipeline is deployed, a URL is displayed. This is the HTTP endpoint to which you’ll post sensor data. 6. Copy the URL. ## Send sensor data Send test data using cURL. Replace `` with the URL provided by Redpanda Cloud when you deployed the pipeline. ```bash curl -X POST \ -H "Authorization: Bearer $CLOUD_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sensor_id": "thermo-42", "type": "temperature", "value": 21.7, "unit": "C" }' ``` Expected response: ```json { "received_at":"2025-06-17T09:48:50.986719231Z", "sensor_id":"thermo-42", "type":"temperature", "unit":"C", "value":21.7 } ``` You can verify that the message was successfully ingested by checking the `sensor.telemetry` topic in Redpanda Cloud. To verify that the rate limit is working, try sending more than 100 requests per second. You should receive a 429 response with a `Retry-After` header indicating when to retry. ```bash seq 1 300 | xargs -n1 -P50 -I{} curl -s -o /dev/null -w "%{http_code}\n" \ -X POST \ -H "Authorization: Bearer $CLOUD_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"sensor_id":"test", "value": 42}' ``` You should see a mixture of `200` and `429` responses, indicating that the rate limit is being enforced. ## Monitor the pipeline You can monitor the pipeline’s logs in the Redpanda Cloud UI. 1. Go to **Connect** and select the `sensor-telemetry-ingest` pipeline. 2. Click on the **Logs** tab to view real-time logs of the pipeline’s activity. You can see any errors that occur during processing. ## Next steps - Filter or enrich events with conditional Bloblang. - Route messages by `sensor.type` to different topics. ## Suggested reading - [`gateway` input reference](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gateway/) - [Bloblang functions](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/) - [Redpanda Cloud API authentication](https://docs.redpanda.com/api/doc/cloud-dataplane/authentication) --- # Page 311: Google Cloud Platform **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/gcp.md --- # Google Cloud Platform There are many components within Redpanda Connect which utilize Google Cloud Platform (GCP) services. You will find that each of these components require valid credentials. When running Redpanda Connect inside a Google Cloud environment that has a [default service account](https://cloud.google.com/iam/docs/service-accounts#default), it can automatically retrieve the service account credentials to call Google Cloud APIs through a library called Application Default Credentials (ADC). Otherwise, if your application runs outside Google Cloud environments that provide a default service account, you need to manually create one. Once you have a service account set up which has the required permissions, you can [create](https://console.cloud.google.com/apis/credentials/serviceaccountkey) a new Service Account Key and download it as a JSON file. Then all you need to do set the path to this JSON file in the `GOOGLE_APPLICATION_CREDENTIALS` environment variable. Please refer to [this document](https://cloud.google.com/docs/authentication/production) for details. --- # Page 312: Migrate to the Unified Redpanda Migrator **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/migrate-unified-redpanda-migrator.md --- # Migrate to the Unified Redpanda Migrator > ❗ **IMPORTANT** > > This page is about migrating to a newer version of Redpanda Connect. For information about migrating your data using Redpanda Migrator, see [Redpanda Migrator](https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/redpanda_migrator/). This guide explains how to migrate from legacy migrator components (`redpanda_migrator_bundle`, `legacy_redpanda_migrator` and `legacy_redpanda_migrator_offsets`) to the unified `redpanda_migrator` input/output pair introduced in Redpanda Connect 4.67.5+. The unified migrator consolidates all migration logic into a single input/output pair, simplifying configuration and improving reliability. ## Overview | | | | --- | --- | | **Available in** | Redpanda Connect 4.67.5+ | | **Legacy status** | Deprecated in 4.67.5, removed in 4.85.0 | | **Compatibility** | Not backward-compatible | | **Configuration model** | One `input` and one `output`, paired by label | | **Primary control** | All migration logic resides in the output component | Key concepts: - Components are paired by matching `label` values. - The input defines the source cluster and schema registry. - The output defines the destination cluster, schema registry, and migration behavior. - Topic mapping and consumer group migration are configured in the output. ## Architectural changes ### Legacy architecture A complex bundle (`redpanda_migrator_bundle`) that managed three subcomponents: - `redpanda_migrator`: Data transfer - `schema_registry`: Schema synchronization - `redpanda_migrator_offsets`: Consumer group offsets This design required complex internal routing and sequencing. ### Unified architecture A single `redpanda_migrator` input/output pair replaces the bundle: - **Input**: Consumes from the source Kafka cluster. - **Output**: Handles topic creation, schema synchronization, ACLs, and consumer group offsets. Benefits: - Simplified setup: all configuration consolidated in one output component. - Improved coordination: no internal routing or wrapper logic. - Enhanced control: fine-grained schema and topic options, improved offset handling. ## Migration steps Follow this checklist in order to ensure a safe, low-risk migration. - Back up your existing configurations. - Add new `input.redpanda_migrator` and `output.redpanda_migrator` components with matching labels. - Move source Kafka and Schema Registry settings to the input. - Move destination Kafka and Schema Registry settings to the output. - Replace `topic_prefix` with `topic` using interpolation syntax. - Move offset settings to `output.redpanda_migrator.consumer_groups`. - Remove deprecated fields. - Validate configuration with `rpk connect lint`. - Test using non-production topics first. - Monitor logs and performance during migration. - Remove legacy configuration after successful migration. ## Field mapping reference ### Bundle wrapper (`redpanda_migrator_bundle`) #### Input mapping | Legacy Field | New Location | Status | Notes | | --- | --- | --- | --- | | `redpanda_migrator` | `input.redpanda_migrator` | Moved | Source cluster connection | | `schema_registry` | `input.redpanda_migrator.schema_registry` | Moved | Source schema registry | | `migrate_schemas_before_data` | - | Removed | Controlled by output schema interval | | `consumer_group_offsets_poll_interval` | `output.redpanda_migrator.consumer_groups.interval` | Moved | Now controls sync frequency | #### Output mapping | Legacy Field | New Location | Status | Notes | | --- | --- | --- | --- | | `redpanda_migrator` | `output.redpanda_migrator` | Moved | Destination cluster configuration | | `schema_registry` | `output.redpanda_migrator.schema_registry` | Moved | Destination schema registry | | `translate_schema_ids` | `output.redpanda_migrator.schema_registry.translate_ids` | Moved | Schema ID translation | | `input_bundle_label` | `label` | Replaced | Input and output paired by label | ### Data migration fields | Legacy Field | New Location | Status | Notes | | --- | --- | --- | --- | | All (`*`) | `input.redpanda_migrator.*` | Moved | Direct mapping | | `topics` (explicit list) | `input.redpanda_migrator.topics` | Unchanged | Still supported for explicit lists | | `regexp_topics: true` | `input.redpanda_migrator.regexp_topics_include`, `regexp_topics_exclude` | Deprecated | Use include/exclude arrays for pattern-based selection | | `topic_prefix` | `output.redpanda_migrator.topic` | Replaced | Use interpolation, for example `'prefix_${! @kafka_topic }'` | | `replication_factor_override`, `replication_factor` | `output.redpanda_migrator.topic_replication_factor` | Replaced | Unified field | | `input_resource` | `label` | Replaced | Label pairing replaces internal routing | | - | `output.redpanda_migrator.provenance_header` | New | Optional header for tracking message source cluster | ### Schema migration fields | Legacy Field | New Location | Status | Notes | | --- | --- | --- | --- | | Connection fields | `input.redpanda_migrator.schema_registry.*` | Moved | Source schema registry | | `subject_filter` | `output.redpanda_migrator.schema_registry.include`, `exclude` | Replaced | Use regex lists for filtering | | `include_deleted` | `output.redpanda_migrator.schema_registry.include_deleted` | Moved | Configured on destination | | `backfill_dependencies` | `output.redpanda_migrator.schema_registry.versions` | Replaced | Choose `all` or `latest` | ### Consumer group offset migration The `redpanda_migrator_offsets` pair is replaced by the `consumer_groups` block in the output. | Legacy Component | New Location | Status | Notes | | --- | --- | --- | --- | | `redpanda_migrator_offsets` (input/output) | `output.redpanda_migrator.consumer_groups` | Replaced | Unified control block | ## Migration example The following example demonstrates a complete migration from legacy to unified components. Legacy configuration ```yaml input: label: "source_cluster" redpanda_migrator_bundle: legacy_redpanda_migrator: seed_brokers: [ "source-kafka:9092" ] topics: [ "orders", "payments" ] consumer_group: "migration_group" schema_registry: url: "http://source-registry:8081" migrate_schemas_before_data: false consumer_group_offsets_poll_interval: 30s output: redpanda_migrator_bundle: legacy_redpanda_migrator: seed_brokers: [ "destination-redpanda:9092" ] topic_prefix: "migrated_" schema_registry: url: "http://destination-registry:8081" translate_schema_ids: true input_bundle_label: "source_cluster" ``` Unified configuration ```yaml input: label: "migration_pipeline" (1) redpanda_migrator: # Source Kafka settings seed_brokers: [ "source-kafka:9092" ] # Pattern-based topic selection (for migrating all topics except system topics) # Note: You can still use explicit lists: topics: [ "orders", "payments" ] regexp_topics_include: [ '.' ] (2) regexp_topics_exclude: [ '^_' ] (3) consumer_group: "migration_group" # Source Schema Registry settings schema_registry: url: "http://source-registry:8081" output: label: "migration_pipeline" (4) redpanda_migrator: # Destination Redpanda settings seed_brokers: [ "destination-redpanda:9092" ] # Topic mapping (replaces topic_prefix) topic: 'migrated_${! @kafka_topic }' (5) # Add source cluster tracking header provenance_header: "x-source-cluster" (6) # Destination Schema Registry and migration settings schema_registry: url: "http://destination-registry:8081" translate_ids: true # Rename subjects subject: 'migrated_${! metadata("schema_registry_subject") }' # Consumer group migration settings consumer_groups: enabled: true interval: 30s (7) ``` 1. Labels are now used for pairing input and output. 2. Match all topics using regex pattern. 3. Exclude internal/system topics starting with underscore. 4. Matching label pairs the input and output components. 5. Use [interpolation](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/interpolation/) syntax to replicate `topic_prefix` behavior. 6. Adds a header to track which cluster messages originated from, useful for debugging and auditing. 7. Replaces `consumer_group_offsets_poll_interval`. ## Validation Before running, validate your configuration: ```bash rpk connect lint config.yaml ``` Then test on a small set of topics before running full migrations. ## Troubleshooting | Problem | Likely Cause | Solution | | --- | --- | --- | | Labels do not match | Input and output labels differ | Use identical, case-sensitive labels. | | Topic interpolation errors | Incorrect syntax | Use `topic: 'prefix_${! @kafka_topic }'` with quotes and `!`. | | Schema registry connection fails | Incorrect registry placement | The source registry must be in the input. The destination registry must be in the output. | | Consumer group migration not working | Missing `consumer_groups.enabled: true` | Ensure consumer group migration is explicitly enabled. | ## After migration After verifying that the new migrator works as expected: - Remove legacy configuration files. - Update internal documentation and runbooks. - Train your team on the new configuration model. - See the [`redpanda_migrator` output](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda_migrator/) reference for advanced configuration options. --- # Page 313: Synchronous Responses **URL**: https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/sync_responses.md --- # Synchronous Responses In a regular Redpanda Connect pipeline, messages flow in one direction and acknowledgements in the other: ```text ----------- Message -------------> Input (AMQP) -> Processors -> Output (AMQP) <------- Acknowledgement --------- ``` However, Redpanda Connect supports bidirectional protocols like HTTP and WebSocket, which allow responses to be returned directly from the pipeline. For example, HTTP is a request/response protocol, and inputs like `http_server` (Self-Managed) or `gateway` (Redpanda Cloud) support returning response payloads to the requester. ```text --------- Request Body --------> Input (HTTP) -> Processors -> Output (Sync Response) <--- Response Body (and ack) --- ``` ## Routing processed messages back To return a processed response, use the [`sync_response`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/sync_response/) output. Use the `gateway` input in Redpanda Cloud: ```yaml input: gateway: {} pipeline: processors: - mapping: | root = { city: json("location"), forecast: "Clear skies with light winds", temperature_c: 22 } output: sync_response: {} ``` Sending this request: ```json { "location": "Berlin" } ``` Returns: ```json { "city": "Berlin", "forecast": "Clear skies with light winds", "temperature_c": 22 } ``` ## Combine with other outputs You can route processed messages to storage and return a response using a [`broker`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/broker/) output. ```yaml input: gateway: {} output: broker: pattern: fan_out outputs: - redpanda: seed_brokers: - ${REDPANDA_BROKERS} topic: weather.requests tls: enabled: true sasl: - mechanism: SCRAM-SHA-256 username: ${secrets.USERNAME} password: ${secrets.PASSWORD} - sync_response: processors: - mapping: | root = { status: "received", received_at: now() } ``` ## Returning partially processed messages You can return a response before the message is fully processed by using the [`sync_response` processor](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/sync_response/). This allows continued processing after the response is set. ```yaml pipeline: processors: - mapping: root = "Received weather report for %s".format(json("location")) - sync_response: {} - mapping: root.reported_at = now() ``` This returns `"Received weather report for Berlin"` to the client, but continues modifying the message before storing or forwarding it. > 📝 **NOTE** > > Due to delivery guarantees, the response is not sent until all downstream processing and acknowledgements are complete. --- # Page 314: Consume Data **URL**: https://docs.redpanda.com/cloud-data-platform/develop/consume-data.md --- # Consume Data - [Consumer Offsets](https://docs.redpanda.com/cloud-data-platform/develop/consume-data/consumer-offsets/) Redpanda uses an internal topic, `__consumer_offsets`, to store committed offsets from each Kafka consumer that is attached to Redpanda. - [Follower Fetching](https://docs.redpanda.com/cloud-data-platform/develop/consume-data/follower-fetching/) Learn about follower fetching and how to configure a Redpanda consumer to fetch records from the closest replica. - [Paginate Messages in Redpanda Console](https://docs.redpanda.com/cloud-data-platform/develop/consume-data/paginate-messages-events/) Retrieve more than the default batch of messages in Redpanda Console by paging through larger result sets. --- # Page 315: Consumer Offsets **URL**: https://docs.redpanda.com/cloud-data-platform/develop/consume-data/consumer-offsets.md --- # Consumer Offsets In Redpanda, all messages are organized by [topic](https://docs.redpanda.com/home/glossary/#topic) and distributed across multiple partitions, based on a [partition strategy](https://www.redpanda.com/guides/kafka-tutorial-kafka-partition-strategy). For example, when using the round robin strategy, a producer writing to a topic with five partitions would distribute approximately 20% of the messages to each [partition](https://docs.redpanda.com/home/glossary/#partition). Within a partition, each message (once accepted and acknowledged by the partition leader) is permanently assigned a unique sequence number called an [offset](https://docs.redpanda.com/home/glossary/#offset). Offsets enable consumers to resume processing from a specific point, such as after an application outage. If an outage prevents your application from receiving events, you can use the consumer offset to retrieve only the events that occurred during the downtime. By default, the first message in a partition is assigned offset 0, the next is offset 1, and so on. You can manually specify a specific start value for offsets if needed. Once assigned, offsets are immutable, ensuring that the order of messages within a partition is preserved. ## How consumers use offsets As a consumer reads messages from Redpanda, it can save its progress by “committing the offset” (known as an [offset commit](https://docs.redpanda.com/home/glossary/#offset-commit)), an action initiated by the consumer, not Redpanda. Kafka client libraries provide an API for committing offsets, which communicates with Redpanda using the [consumer group](https://docs.redpanda.com/home/glossary/#consumer-group) API. Each committed offset is stored as a message in the `__consumer_offsets` topic, which is a private Redpanda topic that stores committed offsets from each Kafka consumer attached to Redpanda, allowing the consumer to resume processing from the last committed point. Redpanda exposes the `__consumer_offsets` key to enable the many tools in the Kafka ecosystem that rely on this value for their operation, providing greater ecosystem interoperability with environments and applications. When a consumer group works together to consume data from topics, the partitions are divided among the consumers in the group. For example, if a topic has 12 partitions, and there are two consumers, each consumer would be assigned six partitions to consume. If a new consumer starts later and joins this consumer group, a rebalance occurs, such that each consumer ends up with four partitions to consume. You specify a consumer group by setting the `group.id` property to a unique name for the group. Kafka tracks the maximum offset it has consumed in each partition and can commit offsets to ensure it can resume processing from the same point in the event of a restart. Kafka allows offsets for a consumer group to be stored on a designated broker, known as the group coordinator. All consumers in the group send their offset commits and fetch requests to this group coordinator. > 📝 **NOTE** > > More advanced consumers can read data from Redpanda without using a consumer group by requesting to read a specific topic, partition, and offset range. This pattern is often used by stream processing systems such as Apache Spark and Apache Flink, which have their own mechanisms for assigning work to consumers. Redpanda Console derives its consumer group lists and lag information from committed consumer group offsets, so these consumers appear in Console only if they also commit offsets to a consumer group. For example, Spark Structured Streaming does not commit offsets, so its consumers never appear. Flink commits offsets only when it is configured to do so on checkpoint completion. When the group coordinator receives an OffsetCommitRequest, it appends the request to the [compacted](https://kafka.apache.org/documentation/#compaction) Kafka topic `__consumer_offsets`. The broker sends a successful offset commit response to the consumer only after all the replicas of the offsets topic receive the offsets. If the offsets fail to replicate within a configurable timeout, the offset commit fails and the consumer may retry the commit after backing off. The brokers periodically compact the `__consumer_offsets` topic, because it only needs to maintain the most recent offset commit for each partition. The coordinator also caches the offsets in an in-memory table to serve offset fetches quickly. ## Commit strategies There are several strategies for managing offset commits: ### Automatic offset commit Auto commit is the default commit strategy, where the client automatically commits offsets at regular intervals. This is set with the `enable.auto.commit` property. The client then commits offsets every `auto.commit.interval.ms` milliseconds. The primary advantage of the auto commit approach is its simplicity. After it is configured, the consumer requires no additional effort. Commits are managed in the background. However, the consumer is unaware of what was committed or when. As a result, after an application restart, some messages may be reprocessed (since consumption resumes from the last committed offset, which may include already-processed messages). The strategy guarantees at-least-once delivery. > 📝 **NOTE** > > If your consume configuration is set up to consume and write to another data store, and the write to that datastore fails, the consumer might not recover when it is auto-committed. It may not only duplicate messages, but could also drop messages intended to be in another datastore. Make sure you understand the trade-off possibilities associated with this default behavior. ### Manual offset commit The manual offset commit strategy gives consumers greater control over when commits occur. This approach is typically used when a consumer needs to align commits with an external system, such as database transactions in an RDBMS. The main advantage of manual commits is that they allow you to decide exactly when a record is considered consumed. You can use two API calls for this: `commitSync` and `commitAsync`, which differ in their blocking behavior. #### Synchronous commit The advantage of synchronous commits is that consumers can take appropriate action before continuing to consume messages, albeit at the expense of increased latency (while waiting for the commit to return). The commit (`commitSync`) will also retry automatically, until it either succeeds or receives an unrecoverable error. The following example shows a synchronous commit: ```java consumer.subscribe(Arrays.asList("foo", "bar")); while (true) { ConsumerRecords records = consumer.poll(100); for (ConsumerRecord record : records) { // process records here ... // ... and at the appropriate point, call commit (not after every message) consumer.commitSync(); } } ``` #### Asynchronous commit The advantage of asynchronous commits is lower latency, because the consumer does not pause to wait for the commit response. However, there is no automatic retry of the commit (`commitAsync`) if it fails. There is also increased coding complexity (due to the asynchronous callbacks). The following example shows an asynchronous commit in which the consumer will not block. Instead, the commit call registers a callback, which is executed once the commit returns: ```java void callback() { // executed when the commit returns } consumer.subscribe(Arrays.asList("foo", "bar")); while (true) { ConsumerRecords records = consumer.poll(100); for (ConsumerRecord record : records) { // process records here ... // ... and at the appropriate point, call commit consumer.commitAsync(callback); } } ``` ### External offset management The external offset management strategy allows consumers to manage offsets independently of Redpanda. In this approach: - Consumers bypass the consumer group API and directly assign partitions instead of subscribing to a topic. - Offsets are not committed to Redpanda, but are instead stored in an external storage system. Because consumers that use this strategy do not commit offsets to Redpanda, they do not appear in the consumer group lists in Redpanda Console. This is expected behavior for systems such as Apache Spark Structured Streaming, which manages offsets entirely in its own checkpoint storage. Systems such as Apache Flink can also commit offsets to Kafka when a checkpoint completes. In that configuration, they follow the hybrid strategy described in the next section and do appear in Console. To implement an external offset management strategy: 1. Set `enable.auto.commit` to `false`. 2. Use `assign(Collection)` to assign partitions. 3. Use the offset provided with each ConsumerRecord to save your position. 4. Upon restart, use `seek(TopicPartition, long)` to restore the position of the consumer. ### Hybrid offset management The hybrid offset management strategy allows consumers to handle their own consumer rebalancing while still leveraging Redpanda’s offset commit functionality. In this approach: - Consumers bypass the consumer group API and directly assign partitions instead of subscribing to a topic. - Offsets are committed to Redpanda. ## Offset commit best practices Follow these best practices to optimize offset commits. ### Avoid over-committing The purpose of a commit is to save consumer progress. More frequent commits reduce the amount of data to re-read after an application restart, as the commit interval directly affects the recovery point objective (RPO). Because a lower RPO is desirable, application designers may believe that committing frequently is a good design choice. However, committing too frequently can result in adverse consequences. While individually small, each commit still results in a message being written to the `__consumer_offsets` topic, because the position of the consumer against every partition must be recorded. At high commit rates, this workload can become a bottleneck for both the client and the server. Additionally, many Kafka client implementations do not coalesce offset commits, meaning redundant commits in a backlog still need to be processed. In many Kafka client implementations, offset commits aren’t coalesced at the client; so if a backlog of commits forms (when using the asynchronous commit API), the earlier commits still need to be processed, even though they are effectively redundant. **Best practice**: Monitor commit latency to ensure commits are timely. If you notice performance issues, commit less frequently. ### Use unique consumer groups Like many topics, the consumer group topic has multiple partitions to help with performance. When writing commit messages, Redpanda groups all of the commits for a consumer group into a specific partition to maintain ordering. Reusing a consumer group across multiple applications, even for different topics, forces all commits to use a single partition, negating the benefits of partitioning. **Best practice**: Assign a unique consumer group to each application to distribute the commit load across all partitions. ### Tune the consumer group In highly parallel applications, frequent consumer group heartbeats can create unnecessary overhead. For example, 3,200 consumers checking every 500 milliseconds generate 6,400 heartbeats per second. You can optimize this behavior by increasing the `heartbeat.interval.ms` (along with `session.timeout.ms`). **Best practice**: Adjust heartbeat and session timeout settings to reduce unnecessary overhead in large-scale applications. --- # Page 316: Follower Fetching **URL**: https://docs.redpanda.com/cloud-data-platform/develop/consume-data/follower-fetching.md --- # Follower Fetching Learn about follower fetching and how to configure a Redpanda consumer to fetch records from the closest replica. ## About follower fetching **Follower fetching** enables a consumer to fetch records from the closest replica of a topic partition, regardless of whether it’s a leader or a follower. For a Redpanda cluster deployed across different data centers and availability zones (AZs), restricting a consumer to fetch only from the leader of a partition can incur greater costs and have higher latency than fetching from a follower that is geographically closer to the consumer. With follower fetching (proposed in [KIP-392](https://cwiki.apache.org/confluence/display/KAFKA/KIP-392%3A+Allow+consumers+to+fetch+from+closest+replica)), the fetch protocol is extended to support a consumer fetching from any replica. This includes [Remote Read Replicas](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/remote-read-replicas/). The first fetch from a consumer is processed by a Redpanda leader broker. The leader checks for a replica (itself or a follower) that has a rack ID that matches the consumer’s rack ID. If a replica with a matching rack ID is found, the fetch request returns records from that replica. Otherwise, the fetch is handled by the leader. ## Configure follower fetching Redpanda decides which replica a consumer fetches from. If the consumer configures its `client.rack` property, Redpanda by default selects a replica from the same rack as the consumer, if available. For each consumer, set the `client.rack` property to a rack ID. Rack awareness is pre-enabled for cloud-based clusters in multi-AZ environments. ## Suggested videos - [YouTube - Redpanda Office Hour: Follower Fetching (52 mins)](https://www.youtube.com/watch?v=wV6gH5_yVaw&ab_channel=RedpandaData) --- # Page 317: Paginate Messages in Redpanda Console **URL**: https://docs.redpanda.com/cloud-data-platform/develop/consume-data/paginate-messages-events.md --- # Paginate Messages in Redpanda Console By default, the **Messages** tab on a topic returns the number of records set in **Max results**. Enable **Continuous Pagination** when you need to inspect a topic beyond that cap. ## Browse all messages in a topic 1. Go to **Topics** and select a topic. 2. Open the **Messages** tab. 3. (Optional) Set **Start offset** and **Max results**, or apply filters, to narrow the records you want to inspect. See [Programmable Push Filters](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/programmable-push-filters/) and [Deserialization](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/record-deserialization/). 4. Enable the **Continuous Pagination** toggle. 5. Scroll the message list. Redpanda Cloud keeps loading records until you reach the end of the topic. When continuous pagination is on, the max results cap no longer limits the browsing session. ## Performance considerations Retrieving large result sets increases load on the Redpanda Cloud backend and the cluster. To keep responses fast: - Narrow the result set with filters or a bounded offset range before enabling continuous pagination. - Use [JavaScript push filters](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/programmable-push-filters/) to match only the records you need. - Leave continuous pagination off and rely on max results when you only need a sample. --- # Page 318: Data Transforms **URL**: https://docs.redpanda.com/cloud-data-platform/develop/data-transforms.md --- # Data Transforms - [How Data Transforms Work](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/how-transforms-work/) Learn how Redpanda data transforms work. - [Develop Data Transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/build/) Learn how to initialize a data transforms project and write transform functions in your chosen language. - [Configure Data Transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/configure/) Learn how to configure data transforms in Redpanda, including editing the `transform.yaml` file, environment variables, and memory settings. This topic covers both the configuration of transform functions and the WebAssembly (Wasm) engine's environment. - [Deploy Data Transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/deploy/) Learn how to build, deploy, share, and troubleshoot data transforms in Redpanda. - [Write Integration Tests for Transform Functions](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/test/) Learn how to write integration tests for data transform functions in Redpanda, including setting up unit tests and using testcontainers for integration tests. - [Monitor Data Transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/monitor/) This topic provides guidelines on how to monitor the health of your data transforms and view logs. - [Manage Data Transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/data-transforms/) You can monitor the status and performance metrics of your transform functions. You can also view detailed logs and delete transform functions when they are no longer needed. --- # Page 319: Develop Data Transforms **URL**: https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/build.md --- # Develop Data Transforms > 📝 **NOTE** > > Data transforms are supported on BYOC and Dedicated clusters running Redpanda version 24.3 and later. > 💡 **TIP: When to use Redpanda Connect instead** > > Data transforms do not access external networks or disks, and are best for lightweight data preparation (filtering, scrubbing, schema/format conversion). Use [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/) when you need any of the following: > > - External integration (HTTP services, databases, cloud storage) for enrichment or fan-out to third-party systems > > - Batching or windowed processing for grouping/aggregation > > - Prebuilt processors and connectors to reduce custom code Learn how to initialize a data transforms project and write transform functions in your chosen language. After reading this page, you will be able to: - Initialize a data transforms project using the rpk CLI - Build transform functions that process records and write to output topics - Implement multi-topic routing patterns with Schema Registry integration ## Prerequisites You must have the following development tools installed on your host machine: - The [`rpk` command-line client](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/) installed. - For Golang projects, you must have at least version 1.20 of [Go](https://go.dev/doc/install). - For Rust projects, you must have the latest stable version of [Rust](https://rustup.rs/). - For JavaScript and TypeScript projects, you must have the [latest long-term-support release of Node.js](https://nodejs.org/en/download/package-manager). ## Enable data transforms Data transforms are disabled on all clusters by default. Before you can deploy data transforms to a cluster, you must first enable the feature with the `rpk` command-line tool. To enable data transforms, set the [`data_transforms_enabled`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#data_transforms_enabled) cluster property to `true`: ```bash rpk cluster config set data_transforms_enabled true ``` > 📝 **NOTE** > > This property requires a rolling restart, and it can take several minutes for the update to complete. ## Initialize a data transforms project To initialize a data transforms project, use the following command to set up the project files in your current directory. This command adds the latest version of the [SDK](https://docs.redpanda.com/cloud-data-platform/reference/data-transforms/sdks/) as a project dependency: ```bash rpk transform init --language= --name= ``` If you do not include the `--language` flag, the command prompts you for the language. Supported languages include: - `tinygo-no-goroutines`: Go without support for [goroutines](https://golangdocs.com/goroutines-in-golang) or channels. Choose this option unless your code needs goroutines. - `tinygo-with-goroutines`: Go with support for goroutines and channels. This option builds with the TinyGo asyncify scheduler. In Redpanda benchmarks, the resulting transforms run about 10 times slower than with `tinygo-no-goroutines`. - `rust` - `javascript` - `typescript` For example, if you choose `tinygo-no-goroutines`, `rpk` creates the following project files: ``` . ├── go.mod ├── go.sum ├── README.md ├── transform.go └── transform.yaml ``` The `transform.go` file contains a boilerplate transform function. The `transform.yaml` file specifies the configuration settings for the transform function. See also: [Configure Data Transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/configure/) ## Build transform functions You can develop your transform logic with one of the available SDKs that allow your transform code to interact with a Redpanda cluster. #### Go All transform functions must register a callback with the `OnRecordWritten()` method. You should run any initialization steps in the `main()` function because it’s only run once when the transform function is first deployed. You can also use the standard predefined [`init()` function](https://go.dev/doc/effective_go#init). ```go package main import ( "github.com/redpanda-data/redpanda/src/transform-sdk/go/transform" ) func main() { // Register your transform function. // This is a good place to perform other setup too. transform.OnRecordWritten(myTransform) } // myTransform is where you read the record that was written, and then you can // output new records that will be written to the destination topic func myTransform(event transform.WriteEvent, writer transform.RecordWriter) error { return writer.Write(event.Record()) } ``` #### Rust All transform functions must register a callback with the `on_record_written()` method. You should run any initialization steps in the `main()` function because it’s only run once when the transform function is first deployed. ```rust use redpanda_transform_sdk::*; fn main() { // Register your transform function. // This is a good place to perform other setup too. on_record_written(my_transform); } // my_transform is where you read the record that was written, and then you can // return new records that will be written to the output topic fn my_transform(event: WriteEvent, writer: &mut RecordWriter) -> Result<(), Box> { writer.write(event.record)?; Ok(()) } ``` #### JavaScript All transform functions must register a callback with the `onRecordWritten()` method. You should run any initialization steps outside of the callback so that they are only run once when the transform function is first deployed. ```js // src/index.js import { onRecordWritten } from "@redpanda-data/transform-sdk"; // This is a good place to perform setup steps. // Register your transform function. onRecordWritten((event, writer) => { // This is where you read the record that was written, and then you can // output new records that will be written to the destination topic writer.write(event.record); }); ``` If you need to use Node.js standard modules in your transform function, you must configure the [`polyfillNode` plugin](https://github.com/cyco130/esbuild-plugin-polyfill-node) for [esbuild](https://esbuild.github.io/). This plugin allows you to polyfill Node.js APIs that are not natively available in the Redpanda JavaScript runtime environment. `esbuild.js` ```js import * as esbuild from 'esbuild'; import { polyfillNode } from 'esbuild-plugin-polyfill-node'; await esbuild.build({ plugins: [ polyfillNode({ globals: { buffer: true, // Allow a global Buffer variable if referenced. process: false, // Don't inject the process global, the Redpanda JavaScript runtime does that. }, polyfills: { crypto: true, // Enable crypto polyfill // Add other polyfills as needed }, }), ], }); ``` ### Error handling By distinguishing between recoverable and critical errors, you can ensure that your transform functions are both resilient and robust. Handling recoverable errors internally helps maintain continuous operation, while allowing critical errors to escape ensures that the system can address severe issues effectively. Redpanda tracks the offsets of records that transform functions have processed. If an error escapes the Wasm virtual machine (VM), the VM will fail. When the Wasm engine detects this failure and starts a new VM, the transform function retries processing the input topics from the last processed offset, potentially leading to repeated failures if the underlying issue is not resolved. Handling errors internally by logging them and continuing to process subsequent records can help maintain continuous operation. However, this approach can result in silently discarding problematic records, which may lead to unnoticed data loss if the logs are not monitored closely. #### Go ```go package main import ( "log" "github.com/redpanda-data/redpanda/src/transform-sdk/go/transform" ) func main() { transform.OnRecordWritten(myTransform) } func myTransform(event transform.WriteEvent, writer transform.RecordWriter) error { record := event.Record() if record.Key == nil { // Handle the error internally by logging it log.Println("Error: Record key is nil") // Skip this record and continue to process other records return nil } // Allow errors with writes to escape return writer.Write(record) } ``` #### Rust ```rust use redpanda_transform_sdk::*; use log::error; fn main() { // Set up logging env_logger::init(); on_record_written(my_transform); } fn my_transform(event: WriteEvent, writer: &mut RecordWriter) -> anyhow::Result<()> { let record = event.record; if record.key().is_none() { // Handle the error internally by logging it error!("Error: Record key is nil"); // Skip this record and continue to process other records return Ok(()); } // Allow errors with writes to escape return writer.write(record) } ``` #### JavaScript ```js import { onRecordWritten } from "@redpanda-data/transform-sdk"; // Register your transform function. onRecordWritten((event, writer) => { const record = event.record; if (!record.key) { // Handle the error internally by logging it console.error("Error: Record key is nil"); // Skip this record and continue to process other records return; } // Allow errors with writes to escape writer.write(record); }); ``` When you deploy this transform function, and produce a message without a key, you’ll get the following in the logs: ```js { "body": { "stringValue": "2024/06/20 08:17:33 Error: Record key is nil\n" }, "timeUnixNano": 1718871455235337000, "severityNumber": 13, "attributes": [ { "key": "transform_name", "value": { "stringValue": "test" } }, { "key": "node", "value": { "intValue": 0 } } ] } ``` You can view logs for transform functions using the `rpk transform logs ` command. To ensure that you are notified of any errors or issues in your data transforms, Redpanda provides metrics that you can use to monitor the state of your data transforms. See also: - [View logs for transform functions](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/monitor/#logs) - [Monitor data transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/monitor/) - [Configure transform logging](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/configure/#log) - [`rpk transform logs` reference](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-transform/rpk-transform-logs/) ### Avoid state management Relying on in-memory state across transform invocations can lead to inconsistencies and unpredictable behavior. Data transforms operate with at-least-once semantics, meaning a transform function might be executed more than once for a given record. Redpanda may also restart a transform function at any point, which causes its state to be lost. ### Access environment variables You can access both [built-in and custom environment variables](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/configure/#environment-variables) in your transform function. In this example, environment variables are checked once during initialization: #### Go ```go package main import ( "fmt" "os" "github.com/redpanda-data/redpanda/src/transform-sdk/go/transform" ) func main() { // Check environment variables before registering the transform function. outputTopic1, ok := os.LookupEnv("REDPANDA_OUTPUT_TOPIC_1") if ok { fmt.Printf("Output topic 1: %s\n", outputTopic1) } else { fmt.Println("Only one output topic is set") } // Register your transform function. transform.OnRecordWritten(myTransform) } func myTransform(event transform.WriteEvent, writer transform.RecordWriter) error { return writer.Write(event.Record()) } ``` #### Rust ```rust use redpanda_transform_sdk::*; use std::env; use log::error; fn main() { // Set up logging env_logger::init(); // Check environment variables before registering the transform function. match env::var("REDPANDA_OUTPUT_TOPIC_1") { Ok(output_topic_1) => println!("Output topic 1: {}", output_topic_1), Err(_) => println!("Only one output topic is set"), } // Register your transform function. on_record_written(my_transform); } fn my_transform(_event: WriteEvent, _writer: &mut RecordWriter) -> anyhow::Result<()> { Ok(()) } ``` #### JavaScript ```js import { onRecordWritten } from "@redpanda-data/transform-sdk"; // Check environment variables before registering the transform function. const outputTopic1 = process.env.REDPANDA_OUTPUT_TOPIC_1; if (outputTopic1) { console.log(`Output topic 1: ${outputTopic1}`); } else { console.log("Only one output topic is set"); } // Register your transform function. onRecordWritten((event, writer) => { return writer.write(event.record); }); ``` ### Write to specific output topics You can configure your transform function to write records to specific output topics based on message content, enabling powerful routing and fan-out patterns. This capability is useful for: - Filtering messages by criteria and routing to different topics - Fan-out patterns that distribute data from one input topic to multiple output topics - Event routing based on message type or schema - Data distribution for downstream consumers Wasm transforms provide a simpler alternative to external connectors like Kafka Connect for in-broker data routing, with lower latency and no additional infrastructure to manage. #### Basic JSON validation example The following example shows a filter that outputs only valid JSON from the input topic into the output topic. The transform writes invalid JSON to a different output topic. ##### Go ```go import ( "encoding/json" "github.com/redpanda-data/redpanda/src/transform-sdk/go/transform" ) func main() { transform.OnRecordWritten(filterValidJson) } func filterValidJson(event transform.WriteEvent, writer transform.RecordWriter) error { if json.Valid(event.Record().Value) { return writer.Write(event.Record()) } // Send invalid records to separate topic return writer.Write(event.Record(), transform.ToTopic("invalid-json")) } ``` ##### Rust ```rust use anyhow::Result; use redpanda_transform_sdk::*; fn main() { on_record_written(filter_valid_json); } fn filter_valid_json(event: WriteEvent, writer: &mut RecordWriter) -> Result<()> { let value = event.record.value().unwrap_or_default(); if serde_json::from_slice::(value).is_ok() { writer.write(event.record)?; } else { // Send invalid records to separate topic writer.write_with_options(event.record, WriteOptions::to_topic("invalid-json"))?; } Ok(()) } ``` ##### JavaScript The JavaScript SDK does not support writing records to a specific output topic. #### Multi-topic fan-out with Schema Registry This example shows how to route batched updates from a single input topic to multiple output topics based on a routing field in each message. Messages are encoded with the [Schema Registry wire format](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-overview/#wire-format) for validation against the output topic schema. Consider using this pattern with Iceberg-enabled topics to fan out data directly into lakehouse tables. Input message example ```json { "updates": [ {"table": "orders", "data": {"order_id": "123", "amount": 99.99}}, {"table": "inventory", "data": {"product_id": "P456", "quantity": 50}}, {"table": "customers", "data": {"customer_id": "C789", "name": "Jane"}} ] } ``` [Configure the transform](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/configure/) with multiple output topics: ```yaml name: event-router input_topic: events output_topics: - orders - inventory - customers ``` The transform extracts each update and routes it to the appropriate topic based on the `table` field. Schemas are registered dynamically in the `main()` function using the Schema Registry client, which returns the schema IDs needed for encoding messages in the wire format. > 📝 **NOTE** > > In this example, it is assumed that you have created the output topics and have the schema definitions ready. The transform registers the schemas dynamically on startup using the `{topic-name}-value` naming convention for schema subjects (for example, `orders-value`, `inventory-value`). ##### Go `go.mod` ```go module fanout-example go 1.20 require github.com/redpanda-data/redpanda/src/transform-sdk/go/transform v1.1.0 // v1.1.0+ required ``` `transform.go`: ```go package main import ( "encoding/binary" "encoding/json" "log" "github.com/redpanda-data/redpanda/src/transform-sdk/go/transform" "github.com/redpanda-data/redpanda/src/transform-sdk/go/transform/sr" ) // Input message structure with array of updates type BatchMessage struct { Updates []TableUpdate `json:"updates"` } // Individual table update with routing field type TableUpdate struct { Table string `json:"table"` // Routing field - determines output topic Data json.RawMessage `json:"data"` // The actual data to write } // Schema IDs for each output topic, registered dynamically at startup var schemaIDs = make(map[string]int) func main() { // Create Schema Registry client client := sr.NewClient() // Define schemas for each output topic schemas := map[string]string{ "orders": `{"type":"record","name":"Order","fields":[{"name":"order_id","type":"string"},{"name":"amount","type":"double"}]}`, "inventory": `{"type":"record","name":"Inventory","fields":[{"name":"product_id","type":"string"},{"name":"quantity","type":"int"}]}`, "customers": `{"type":"record","name":"Customer","fields":[{"name":"customer_id","type":"string"},{"name":"name","type":"string"}]}`, } // Register schemas and store their IDs for topic, schemaStr := range schemas { subject := topic + "-value" schema := sr.Schema{ Schema: schemaStr, Type: sr.TypeAvro, } result, err := client.CreateSchema(subject, schema) if err != nil { log.Fatalf("Failed to register schema for %s: %v", topic, err) } schemaIDs[topic] = result.ID log.Printf("Registered schema for %s with ID %d", topic, result.ID) } log.Printf("Starting fanout transform with schema IDs: %v", schemaIDs) transform.OnRecordWritten(routeUpdates) } func routeUpdates(event transform.WriteEvent, writer transform.RecordWriter) error { var batch BatchMessage if err := json.Unmarshal(event.Record().Value, &batch); err != nil { log.Printf("Failed to parse batch message: %v", err) return nil // Skip invalid records } // Process each update in the batch for i, update := range batch.Updates { schemaID, exists := schemaIDs[update.Table] if !exists { log.Printf("Unknown table in update %d: %s", i, update.Table) continue } if err := writeUpdate(update, schemaID, writer, event); err != nil { log.Printf("Failed to write update %d to %s: %v", i, update.Table, err) } } return nil } func writeUpdate(update TableUpdate, schemaID int, writer transform.RecordWriter, event transform.WriteEvent) error { // Create Schema Registry wire format: [magic_byte, schema_id (4 bytes BE), data...] value := make([]byte, 5) value[0] = 0 // magic byte binary.BigEndian.PutUint32(value[1:5], uint32(schemaID)) value = append(value, update.Data...) record := transform.Record{ Key: event.Record().Key, Value: value, } return writer.Write(record, transform.ToTopic(update.Table)) } ``` ##### Rust `Cargo.toml` ```toml [package] name = "fanout-rust-example" version = "0.1.0" edition = "2021" [dependencies] redpanda-transform-sdk = "1.1.0" # v1.1.0+ required for WriteOptions API redpanda-transform-sdk-sr = "1.1.0" serde = { version = "1", features = ["derive"] } serde_json = "1" log = "0.4" env_logger = "0.11" [profile.release] opt-level = "z" lto = true strip = true ``` `src/main.rs`: ```rust use redpanda_transform_sdk::*; use redpanda_transform_sdk_sr::{SchemaRegistryClient, Schema, SchemaFormat}; use serde::Deserialize; use std::collections::HashMap; use std::error::Error; use std::sync::OnceLock; use log::{info, error}; #[derive(Deserialize)] struct BatchMessage { updates: Vec, } #[derive(Deserialize)] struct TableUpdate { table: String, data: serde_json::Value, } // Schema IDs for each output topic, registered dynamically at startup static SCHEMA_IDS: OnceLock> = OnceLock::new(); fn main() { // Initialize logging env_logger::init(); // Create Schema Registry client let mut client = SchemaRegistryClient::new(); // Define schemas for each output topic let schemas = [ ("orders", r#"{"type":"record","name":"Order","fields":[{"name":"order_id","type":"string"},{"name":"amount","type":"double"}]}"#), ("inventory", r#"{"type":"record","name":"Inventory","fields":[{"name":"product_id","type":"string"},{"name":"quantity","type":"int"}]}"#), ("customers", r#"{"type":"record","name":"Customer","fields":[{"name":"customer_id","type":"string"},{"name":"name","type":"string"}]}"#), ]; let mut schema_ids = HashMap::new(); // Register schemas and store their IDs for (topic, schema_str) in schemas { let subject = format!("{}-value", topic); let schema = Schema::new(schema_str.to_string(), SchemaFormat::Avro, vec![]); match client.create_schema(&subject, schema) { Ok(result) => { let id = result.id(); // SchemaId type schema_ids.insert(topic.to_string(), id.0); // Extract i32 from SchemaId wrapper info!("Registered schema for {} with ID {}", topic, id.0); } Err(e) => { error!("Failed to register schema for {}: {}", topic, e); panic!("Schema registration failed"); } } } let _ = SCHEMA_IDS.set(schema_ids); info!("Starting fanout transform with schema IDs"); on_record_written(route_updates); } fn write_update( update: &TableUpdate, schema_id: i32, writer: &mut RecordWriter, event: &WriteEvent, ) -> Result<(), Box> { // Create Schema Registry wire format: [magic_byte, schema_id (4 bytes BE), data...] let mut value = vec![0u8; 5]; value[0] = 0; // magic byte value[1..5].copy_from_slice(&schema_id.to_be_bytes()); let data_bytes = serde_json::to_vec(&update.data)?; value.extend_from_slice(&data_bytes); let key = event.record.key().map(|k| k.to_vec()); let record = BorrowedRecord::new(key.as_deref(), Some(&value)); writer.write_with_options(record, WriteOptions::to_topic(&update.table))?; Ok(()) } fn route_updates(event: WriteEvent, writer: &mut RecordWriter) -> Result<(), Box> { let batch: BatchMessage = serde_json::from_slice(event.record.value().unwrap_or_default())?; let schema_ids = SCHEMA_IDS.get().unwrap(); for update in batch.updates.iter() { if let Some(&schema_id) = schema_ids.get(&update.table) { write_update(update, schema_id, writer, &event)?; } } Ok(()) } ``` ##### JavaScript The JavaScript SDK does not support writing records to specific output topics. For multi-topic fan-out, use the Go or Rust SDK. ### Connect to the Schema Registry You can use the Schema Registry client library to read and write schemas as well as serialize and deserialize records. This client library is useful when working with schema-based topics in your data transforms. See also: - [Redpanda Schema Registry](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-overview/) - [Go Schema Registry client reference](https://docs.redpanda.com/cloud-data-platform/reference/data-transforms/golang-sdk/) - [Rust Schema Registry client reference](https://docs.redpanda.com/cloud-data-platform/reference/data-transforms/rust-sdk/) - [JavaScript Schema Registry client reference](https://docs.redpanda.com/cloud-data-platform/reference/data-transforms/js/js-sdk-sr/) ## Next steps [Configure Data Transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/configure/) ## Suggested reading - [How Data Transforms Work](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/how-transforms-work/) - [Data Transforms SDKs](https://docs.redpanda.com/cloud-data-platform/reference/data-transforms/sdks/) - [`rpk transform` commands](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-transform/rpk-transform/) --- # Page 320: Configure Data Transforms **URL**: https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/configure.md --- # Configure Data Transforms Learn how to configure data transforms in Redpanda, including editing the `transform.yaml` file, environment variables, and memory settings. This topic covers both the configuration of transform functions and the WebAssembly (Wasm) engine’s environment. ## Configure transform functions This section covers how to configure transform functions using the `transform.yaml` configuration file, command-line overrides, and environment variables. ### Transform configuration file When you [initialize](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/build/#init) a data transforms project, a `transform.yaml` file is generated in the provided directory. You can use this configuration file to configure the transform function with settings, including input and output topics, the language used for the data transform, and any environment variables. - `name`: The name of the transform function. - `description`: A description of what the transform function does. - `input-topic`: The topic from which data is read. - `output-topics`: A list of up to eight topics to which the transformed data is written. - `language`: The language used for the transform function. The language is set to the one you defined during [initialization](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/build/#init). - `env`: A dictionary of custom environment variables that are passed to the transform function. Do not prefix keys with `REDPANDA_`. Check the list of all [limitations](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/how-transforms-work/#limitations). Here is an example of a transform.yaml file: ```yaml name: redpanda-example description: | This transform function is an example to demonstrate how to configure data transforms in Redpanda. input-topic: example-input-topic output-topics: - example-output-topic-1 - example-output-topic-2 language: tinygo-no-goroutines env: DATA_TRANSFORMS_ARE_AWESOME: 'true' ``` ### Override configurations with command-line options You can set the name of the transform function, environment variables, and input and output topics on the command-line when you deploy the transform. These command-line settings take precedence over those specified in the `transform.yaml` file. See [Deploy Data Transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/deploy/) ### Built-In environment variables As well as custom environment variables set in either the [command-line](#cl) or the [configuration file](#config-file), Redpanda makes some built-in environment variables available to your transform functions. These variables include: - `REDPANDA_INPUT_TOPIC`: The input topic specified. - `REDPANDA_OUTPUT_TOPIC_0..REDPANDA_OUTPUT_TOPIC_N`: The output topics in the order specified on the command line or in the configuration file. For example, `REDPANDA_OUTPUT_TOPIC_0` is the first variable, `REDPANDA_OUTPUT_TOPIC_1` is the second variable, and so on. Transform functions are isolated from the broker’s internal environment variables to maintain security and encapsulation. Each transform function only uses the environment variables explicitly provided to it. ## Configure the Wasm engine This section covers how to configure the Wasm engine environment using Redpanda cluster configuration properties. ### Enable data transforms To use data transforms, you must enable it for a Redpanda cluster using the [`data_transforms_enabled`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#data_transforms_enabled) property. ### Configure transform logging The following properties configure logging for data transforms: - [`data_transforms_logging_line_max_bytes`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#data_transforms_logging_line_max_bytes): Increase this value if your log messages are frequently truncated. Setting this value too low may truncate important log information. ## Next steps [Deploy Data Transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/deploy/) --- # Page 321: Manage Data Transforms **URL**: https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/data-transforms.md --- # Manage Data Transforms You can monitor the status and performance metrics of your transform functions. You can also view detailed logs and delete transform functions when they are no longer needed. ## Prerequisites Before you begin, ensure that you have the following: - [Data transforms enabled](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/configure/#enable-transforms) in your Redpanda cluster. - At least one transform function deployed to your Redpanda cluster. ## Monitor transform functions To monitor transform functions: 1. Navigate to the **Transforms** menu. 2. Click the name of a transform function to view detailed information: - The partitions that the function is running on - The broker (node) ID - Any lag (the amount of pending records on the input topic that have yet to be processed by the transform) ## View logs To view logs for a transform function: 1. Navigate to the **Transforms** menu. 2. Click on the name of a transform function. 3. Click the **Logs** tab to see the logs. Redpanda Cloud displays a limited number of logs for transform functions. To view the full history of logs, use the [`rpk` command-line tool](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/monitor/#logs). ## Delete transform functions To delete a transform function: 1. Navigate to the **Transforms** menu. 2. Find the transform function you want to delete from the list. 3. Click the delete icon at the end of the row. 4. Confirm the deletion when prompted. Deleting a transform function will remove it from the cluster and stop any further processing. ## Suggested reading - [How Data Transforms Work](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/how-transforms-work/) - [Deploy Data Transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/deploy/) - [Monitor Data Transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/monitor/) --- # Page 322: Deploy Data Transforms **URL**: https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/deploy.md --- # Deploy Data Transforms Learn how to build, deploy, share, and troubleshoot data transforms in Redpanda. ## Prerequisites Before you begin, ensure that you have the following: - [Data transforms enabled](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/configure/#enable-transforms) in your Redpanda cluster. - The [`rpk` command-line client](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/). - A [data transform](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/build/) project. ## Build the Wasm binary To build a Wasm binary: 1. Ensure your project directory contains a `transform.yaml` file. 2. Build the Wasm binary using the [`rpk transform build`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-transform/rpk-transform-build/) command. ```bash rpk transform build ``` You should now have a Wasm binary named `.wasm`, where `` is the name specified in your `transform.yaml` file. This binary is your data transform function, ready to be deployed to a Redpanda cluster or hosted on a network for others to use. ## Deploy the Wasm binary You can deploy your transform function using the [`rpk transform deploy`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-transform/rpk-transform-deploy/) command. 1. Validate your setup against the pre-deployment checklist: - Do you meet the [Prerequisites](#prerequisites)? - Does your transform function access any environment variables? If so, make sure to set them in the `transform.yaml` file or in the command-line when you deploy the binary. - Do your configured input and output topics already exist? Input and output topics must exist in your Redpanda cluster before you deploy the Wasm binary. 2. Deploy the Wasm binary: ```bash rpk transform deploy ``` When the transform function reaches Redpanda, it starts processing new records that are written to the input topic. ### Reprocess records In some cases, you may need to reprocess records from an input topic that already contains data. Processing existing records can be useful, for example, to process historical data into a different format for a new consumer, to re-create lost data from a deleted topic, or to resolve issues with a previous version of a transform that processed data incorrectly. To reprocess records, you can specify the starting point from which the transform function should process records in each partition of the input topic. The starting point can be either a partition offset or a timestamp. > 📝 **NOTE** > > The `--from-offset` flag is only effective the first time you deploy a transform function. On subsequent deployments of the same function, Redpanda resumes processing from the last committed offset. To reprocess existing records using an existing function, [delete the function](#delete) and redeploy it with the `--from-offset` flag. To deploy a transform function and start processing records from a specific partition offset, use the following syntax: ```bash rpk transform deploy --from-offset +/- ``` In this example, the transform function will start processing records from the beginning of each partition of the input topic: ```bash rpk transform deploy --from-offset +0 ``` To deploy a transform function and start processing records from a specific timestamp, use the following syntax: ```bash rpk transform deploy --from-timestamp @ ``` In this example, the transform function will start processing from the first record in each partition of the input topic that was committed after the given timestamp: ```bash rpk transform deploy --from-timestamp @1617181723 ``` ### Share Wasm binaries You can also deploy data transforms on a Redpanda cluster by providing an addressable path to the Wasm binary. This is useful for sharing transform functions across multiple clusters or teams within your organization. For example, if the Wasm binary is hosted at `https://my-site/my-transform.wasm`, use the following command to deploy it: ```bash rpk transform deploy --file=https://my-site/my-transform.wasm ``` ## Edit existing transform functions To make changes to an existing transform function: 1. [Make your changes to the code](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/build/). 2. [Rebuild](#build) the Wasm binary. 3. [Redeploy](#deploy) the Wasm binary to the same Redpanda cluster. When you redeploy a Wasm binary with the same name, it will resume processing from the last offset it had previously processed. If you need to [reprocess existing records](#reprocess), you must delete the transform function, and redeploy it with the `--from-offset` flag. Redpanda rejects a redeploy that changes the input topic or output topics of an existing transform function. To change the topics, [delete the transform function](#delete) and deploy it again with the new topics. Deploy-time configuration overrides must be provided each time you redeploy a Wasm binary. Otherwise, they will be overwritten by default values or the configuration file’s contents. ## Delete a transform function To delete a transform function, use the following command: ```bash rpk transform delete ``` For more details about this command, see [rpk transform delete](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-transform/rpk-transform-delete/). > 💡 **TIP** > > You can also delete transform functions in Redpanda Cloud. ## Troubleshoot This section provides guidance on how to diagnose and troubleshoot issues with building or deploying data transforms. ### Invalid transform environment This error means that one or more of your configured custom environment variables are invalid. Check your custom environment variables against the list of [limitations](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/how-transforms-work/#limitations). ### Invalid WebAssembly This error indicates that the binary is missing a required callback function: ``` Invalid WebAssembly - the binary is missing required transform functions. Check the broker support for the version of the data transforms SDK being used. ``` All transform functions must register a callback with the `OnRecordWritten()` method. For more details, see [Develop Data Transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/build/). ## Next steps [Set up monitoring](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/monitor/) for data transforms. --- # Page 323: How Data Transforms Work **URL**: https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/how-transforms-work.md --- # How Data Transforms Work > 📝 **NOTE** > > Data transforms are supported on BYOC and Dedicated clusters running Redpanda version 24.3 and later. Redpanda provides the framework to build and deploy inline transformations (data transforms) on data written to Redpanda topics, delivering processed and validated data to consumers in the format they expect. Redpanda does this directly inside the broker, eliminating the need to manage a separate stream processing environment or use third-party tools. ![Data transforms in a broker](https://docs.redpanda.com/cloud-data-platform/shared/_images/wasm1.png) Data transforms let you run common data streaming tasks, like filtering, scrubbing, and transcoding, within Redpanda. For example, you may have consumers that require you to redact credit card numbers or convert JSON to Avro. Data transforms can also interact with the Redpanda Schema Registry to work with encoded data types. To learn how to build and deploy data transforms, see [How Data Transforms Work](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/how-transforms-work/). ## Data transforms with WebAssembly Data transforms use [WebAssembly](https://webassembly.org/) (Wasm) engines inside a Redpanda broker, allowing Redpanda to control the entire transform lifecycle. For example, Redpanda can stop and start transforms when partitions are moved or to free up system resources for other tasks. Data transforms take data from an input topic and map it to one or more output topics. For each topic partition, a leader is responsible for handling the data. Redpanda runs a Wasm virtual machine (VM) on the same CPU core (shard) as these partition leaders to execute the transform function. Transform functions are the specific implementations of code that carry out the transformations. They read data from input topics, apply the necessary processing logic, and write the transformed data to output topics. To execute a transform function, Redpanda uses just-in-time (JIT) compilation to compile the bytecode in memory, write it to an executable space, then run the directly translated machine code. This JIT compilation ensures efficient execution of the machine code, as it is tailored to the specific hardware it runs on. When you deploy a data transform to a Redpanda broker, it stores the Wasm bytecode and associated metadata, such as input and output topics and environment variables. The broker then replicates this data across the cluster using internal Kafka topics. When the data is distributed, each shard runs its own instance of the transform function. This process includes several resource management features: - Each shard can run only one instance of the transform function at a time to ensure efficient resource utilization and prevent overload. - CPU time is dynamically allocated to the Wasm runtime to ensure that the code does not run forever and cannot block the broker from handling traffic or doing other work, such as Tiered Storage uploads. ## Flow of data transforms When a shard becomes the leader of a given partition on the input topic of one or more active transforms, Redpanda does the following: 1. Spins up a Wasm VM using the JIT-compiled Wasm module. 2. Pushes records from the input partition into the Wasm VM. 3. Writes the output. The output partition may exist on the same broker or on another broker in the cluster. Within Redpanda, a single Raft controller manages cluster information, including data transforms. On every shard, Redpanda knows what data transforms exist in the cluster, as well as metadata about the transform function, such as input and output topics and environment variables. ![Wasm architecture in Redpanda](https://docs.redpanda.com/cloud-data-platform/shared/_images/wasm_architecture.png) Each transform function reads from a specified input topic and writes to a specified output topic. The transform function processes every record produced to an input topic and returns zero or more records that are then produced to the specified output topic. Data transforms are applied to all partitions on an input topic. A record is processed after it has been successfully written to disk on the input topic. Because the transform happens in the background after the write finishes, the transform doesn’t affect the original produced record, doesn’t block writes to the input topic, and doesn’t block produce and consume requests. A new transform function reads the input topic from the latest offset. That is, it only reads new data produced to the input topic: it does not read records produced to the input topic before the transform was deployed. If a partition leader moves from one broker to another, then the instance of the transform function assigned to that partition moves with it. When a partition replica [loses leadership](https://docs.redpanda.com/cloud-data-platform/get-started/architecture/#partition-leadership-elections), the broker hosting that partition replica stops the instance of the transform function running on the same shard. The broker that is now hosting the partition’s new leader starts the transform function on the same shard as that leader, and the transform function resumes from the last committed offset. If the previous instance of the transform function failed to commit its latest offsets before moving with the partition leader (for example, if the broker crashed), then it’s likely that the new instance will reprocess some events. For broker failures, transform functions have at-least-once semantics, because records are retried from the committed last offset, and offsets are committed periodically. For more information, see [How Data Transforms Work](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/how-transforms-work/). ## Limitations This section outlines the limitations of data transforms. These constraints are categorized into general limitations affecting the overall functionality and specific limitations related to giving data transforms access to custom environment variables. ### General - **No external access**: Transform functions have no external access to disk or network resources. - **Single message transforms**: Only single record transforms are supported, but multiple output records from a single input record are supported. For aggregations, joins, or complex transformations, consider using [Redpanda Connect](https://docs.redpanda.com/connect/get-started/about/) or [Apache Flink](https://flink.apache.org/). - **Output topic limit**: Up to eight output topics are supported. - **No cycles**: A transform’s output topics must not lead back to its input topic, either directly or through other transforms. Redpanda rejects a deploy that would create a cycle. - **Delivery semantics**: Transform functions have at-least-once delivery. - **Transactions API**: When clients use the Kafka Transactions API on partitions of an input topic, transform functions process only committed records. ### JavaScript - **No native extensions**: Native Node.js extensions are not supported. Packages that require compiling native code or interacting with low-level system features cannot be used. - **Limited Node.js standard modules**: Only modules that can be polyfilled by the [esbuild plugin](https://www.npmjs.com/package/esbuild-plugin-polyfill-node#implemented-polyfills) can be used. Even if a module can be polyfilled, certain functionalities, such as network connections, will not work because the necessary browser APIs are not exposed in the Redpanda JavaScript runtime environment. For example, while the plugin can provide stubs for some Node.js modules such as `http` and `process`, these stubs will not work in the Redpanda JavaScript runtime environment. - **No write options**: The JavaScript SDK does not support write options, such as specifying which output topic to write to. ### Environment variables - **Maximum number of variables**: You can set up to 128 custom environment variables. - **Reserved prefix**: Variable keys must not start with `REDPANDA_`. This prefix is reserved for [built-in environment variables](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/configure/#built-in). - **Key length**: Each key can be up to 128 bytes in length. - **Value length**: Each value can be up to 2 KiB (2048 bytes) in length. This limit applies to each value separately. - **No empty keys or values**: Every variable must have a key and a value. Redpanda rejects empty keys and empty values. - **Encoding**: All keys and values must be encoded in UTF-8. - **Control characters**: Keys and values must not contain any control characters, such as null bytes. ## Suggested reading - [Golang SDK for Data Transforms](https://docs.redpanda.com/cloud-data-platform/reference/data-transforms/golang-sdk/) - [Rust SDK for Data Transforms](https://docs.redpanda.com/cloud-data-platform/reference/data-transforms/rust-sdk/) - [`rpk transform` commands](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-transform/rpk-transform/) --- # Page 324: Monitor Data Transforms **URL**: https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/monitor.md --- # Monitor Data Transforms This topic provides guidelines on how to monitor the health of your data transforms and view logs. ## Prerequisites [Set up monitoring](https://docs.redpanda.com/cloud-data-platform/manage/monitor-cloud/) for your cluster. ## Performance You can identify performance bottlenecks by monitoring latency and CPU usage: - [`redpanda_transform_execution_latency_sec`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_transform_execution_latency_sec) - [`redpanda_wasm_engine_cpu_seconds_total`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_wasm_engine_cpu_seconds_total) If latency is high, investigate the transform logic for inefficiencies or consider scaling the resources. High CPU usage might indicate the need for optimization in the code or an increase in [allocated CPU resources](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/configure/). ## Reliability Tracking execution errors and error states helps in maintaining the reliability of your data transforms: - [`redpanda_transform_execution_errors`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_transform_execution_errors) - [`redpanda_transform_failures`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_transform_failures) - [`redpanda_transform_state`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_transform_state) Make sure to [implement robust error handling and logging](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/build/#errors) within your transform functions to help with troubleshooting. ## Resource usage Monitoring memory usage metrics and total execution time ensures that the Wasm engine does not exceed allocated resources, helping in efficient resource management: - [`redpanda_wasm_engine_memory_usage`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_wasm_engine_memory_usage) - [`redpanda_wasm_engine_max_memory`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_wasm_engine_max_memory) - [`redpanda_wasm_binary_executable_memory_usage`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_wasm_binary_executable_memory_usage) If memory usage is consistently high or exceeds the maximum allocated memory: - Review and optimize your transform functions to reduce memory consumption. This step can involve optimizing data structures, reducing memory allocations, and ensuring efficient handling of records. ## Throughput Keeping track of read and write bytes and processor lag helps in understanding the data flow through your transforms, enabling better capacity planning and scaling: - [`redpanda_transform_read_bytes`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_transform_read_bytes) - [`redpanda_transform_write_bytes`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_transform_write_bytes) - [`redpanda_transform_lag`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_transform_lag) If there is a significant lag or low throughput, investigate potential bottlenecks in the data flow or consider scaling your infrastructure to handle higher throughput. ## View logs for data transforms Runtime logs for transform functions are written to an internal topic called `_redpanda.transform_logs`. You can read these logs by using the [`rpk transform logs`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-transform/rpk-transform-logs/) command. ```bash rpk transform logs ``` Replace `` with the [configured name](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/configure/) of the transform function. > 💡 **TIP** > > You can also view logs in the UI. By default, Redpanda provides several settings to manage logging for data transforms, such as buffer capacity, flush interval, and maximum log line length. These settings ensure that logging operates efficiently without overwhelming the system. However, you may need to adjust these settings based on your specific requirements and workloads. For information on how to configure logging, see the [Configure transform logging](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/configure/#log) section of the configuration guide. ## Suggested reading - [Data transforms metrics](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#data_transform_metrics) --- # Page 325: Write Integration Tests for Transform Functions **URL**: https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/test.md --- # Write Integration Tests for Transform Functions Learn how to write integration tests for data transform functions in Redpanda, including setting up unit tests and using testcontainers for integration tests. This guide covers how to write both unit tests and integration tests for your transform functions. While unit tests focus on testing individual components in isolation, integration tests verify that the components work together as expected in a real environment. ## Unit tests You can create unit tests for transform functions by mocking the interfaces injected into the transform function and asserting that the input and output work correctly. This typically includes mocking the `WriteEvent` and `RecordWriter` interfaces. ```go package main import ( "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/redpanda-data/redpanda/src/transform-sdk/go/transform" ) // MockWriteEvent is a mock implementation of the WriteEvent interface. type MockWriteEvent struct { mock.Mock } func (m *MockWriteEvent) Record() transform.Record { args := m.Called() return args.Get(0).(transform.Record) } // MockRecordWriter is a mock implementation of the RecordWriter interface. type MockRecordWriter struct { mock.Mock } func (m *MockRecordWriter) Write(record transform.Record) error { args := m.Called(record) return args.Error(0) } // copyRecord copies the record to the output topic. func copyRecord(event transform.WriteEvent, writer transform.RecordWriter) error { record := event.Record() return writer.Write(record) } // TestCopyRecord tests the copyRecord function. func TestCopyRecord(t *testing.T) { // Create mocks for the WriteEvent and RecordWriter event := new(MockWriteEvent) writer := new(MockRecordWriter) // Set up the expected behavior record := transform.Record{Value: []byte("test")} event.On("Record").Return(record) writer.On("Write", record).Return(nil) // Call the function under test err := copyRecord(event, writer) // Assert that no error occurred and that the expectations were met assert.NoError(t, err) event.AssertExpectations(t) writer.AssertExpectations(t) } ``` To run your unit tests, use the following command: ```bash go test ``` This will execute all tests in the current directory. ## Integration tests Integration tests verify that your transform functions work correctly in a real Redpanda environment. You can use [testcontainers](https://github.com/testcontainers/testcontainers-go/tree/main) to set up and manage a Redpanda instance for testing. For more detailed examples and helper code for setting up integration tests, refer to the SDK integration tests on [GitHub](https://github.com/redpanda-data/redpanda/tree/dev/src/transform-sdk/tests). --- # Page 326: Use Redpanda with the HTTP Proxy API **URL**: https://docs.redpanda.com/cloud-data-platform/develop/http-proxy.md --- # Use Redpanda with the HTTP Proxy API Redpanda HTTP Proxy (`pandaproxy`) allows access to your data through a REST API. For example, you can list topics or brokers, get events, produce events, subscribe to events from topics using consumer groups, and commit offsets for a consumer. See the [HTTP Proxy API reference](https://docs.redpanda.com/api/doc/http-proxy/) for a full list of available endpoints. > 📝 **NOTE** > > The HTTP Proxy API is supported for BYOC and Dedicated clusters only. ## Prerequisites ### Start Redpanda To log in to your Redpanda Cloud account, run `rpk cloud login`. HTTP Proxy is enabled by default on port 30082. For clusters with private connectivity (AWS PrivateLink, GCP Private Service Connect, and Azure Private Link) enabled, the default seed port for HTTP Proxy is 30282. You can find the HTTP Proxy endpoint on the **How to connect** section of the cluster overview in the Cloud UI. > 📝 **NOTE** > > The rest of this guide assumes that the HTTP Proxy port is `30082`. ## Authenticate with HTTP Proxy HTTP Proxy supports authentication using SCRAM credentials or OIDC tokens. The authentication method depends on the cluster’s [`http_authentication`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#http_authentication) settings. ### SCRAM Authentication If HTTP Proxy is configured to support SASL, you can provide the SCRAM username and password as part of the Basic Authentication header in your request. For example, to list topics as an authenticated user: #### curl ```bash curl -s -u ":" "http://:30082/topics" ``` #### NodeJS ```javascript let options = { auth: { username: "", password: "" }, }; axios .get("http://:30082/topics", options) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` #### Python ```python auth = ("", "") res = requests.get("http://:30082/topics", auth=auth).json() pretty(res) ``` ### OIDC Authentication If HTTP Proxy is configured to support OIDC, you can provide an OIDC token in the Authorization header. For example: #### curl ```bash curl -s -H "Authorization: Bearer " "http://:30082/topics" ``` #### NodeJS ```javascript let options = { headers: { Authorization: `Bearer ` }, }; axios .get("http://:30082/topics", options) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` #### Python ```python headers = {"Authorization": "Bearer "} res = requests.get("http://:30082/topics", headers=headers).json() pretty(res) ``` ## Set up libraries You need an app that calls the HTTP Proxy endpoint. This app can be curl (or a similar CLI), or it could be your own custom app written in any language. Below are curl, JavaScript and Python examples. > 📝 **NOTE** > > In the examples, `` refers to your Redpanda cluster’s hostname or IP address. All following examples use a `base_uri` variable that combines the protocol, host, and port for consistency across curl, JavaScript, and Python examples. ### curl Curl is likely already installed on your system. If not, see [curl download instructions](https://curl.se/download.html). Set the base URI for your HTTP Proxy: ```bash base_uri="http://:30082" ``` ### NodeJS > 📝 **NOTE** > > This is based on the assumption that you’re in the root directory of an existing NodeJS project. See [Build a Chat Room Application with Redpanda and Node.js](https://docs.redpanda.com/labs/clients/docker-nodejs/) for an example of a NodeJS project. In a terminal window, run: ```bash npm install axios ``` Import the library into your code: ```javascript const axios = require('axios'); const base_uri = 'http://:30082'; ``` ### Python In a terminal window, run: ```bash pip install requests ``` Import the library into your code: ```python import requests import json def pretty(text): print(json.dumps(text, indent=2)) base_uri = "http://:30082" ``` ## Create a topic To create a test topic for this guide, use [`rpk`](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/). You can configure `rpk` for your Redpanda deployment, using [profiles](https://docs.redpanda.com/cloud-data-platform/manage/rpk/config-rpk-profile/), flags, or [environment variables](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-x-options/#environment-variables). To create a topic named `test_topic` with three partitions, run: ```bash rpk topic create test_topic -p 3 ``` For more information, see the [rpk topic create](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-topic/rpk-topic-create/) reference. ## Access your data Here are some sample commands to produce and consume streams: ### Get list of topics #### curl ```bash curl -s "$base_uri/topics" ``` #### NodeJS ```javascript axios .get(`${base_uri}/topics`) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` Run the application. If your file name is `index.js` for example, you would run the following command: ```bash node index.js ``` #### Python ```python res = requests.get(f"{base_uri}/topics").json() pretty(res) ``` Expected output: ```bash ["test_topic"] ``` ### Send events to a topic Use POST to send events in the REST endpoint query. The header must include the following line: ``` Content-Type:application/vnd.kafka.json.v2+json ``` The following commands show how to send events to `test_topic`: #### curl ```bash curl -s \ -X POST \ "$base_uri/topics/test_topic" \ -H "Content-Type: application/vnd.kafka.json.v2+json" \ -d '{ "records":[ { "value":"Redpanda", "partition":0 }, { "value":"HTTP proxy", "partition":1 }, { "value":"Test event", "partition":2 } ] }' ``` #### NodeJS ```javascript let payload = { records: [ { "value":"Redpanda", "partition": 0 }, { "value":"HTTP proxy", "partition": 1 }, { "value":"Test event", "partition": 2 } ]}; let options = { headers: { "Content-Type" : "application/vnd.kafka.json.v2+json" }}; axios .post(`${base_uri}/topics/test_topic`, payload, options) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` Run the application: ```bash node index.js ``` #### Python ```python res = requests.post( url=f"{base_uri}/topics/test_topic", data=json.dumps( dict(records=[ dict(value="Redpanda", partition=0), dict(value="HTTP Proxy", partition=1), dict(value="Test Event", partition=2) ])), headers={"Content-Type": "application/vnd.kafka.json.v2+json"}).json() pretty(res) ``` Expected output (may be formatted differently depending on the chosen application): ```bash {"offsets":[{"partition":0,"offset":0},{"partition":2,"offset":0},{"partition":1,"offset":0}]} ``` ### Get events from a topic After events have been sent to the topic, you can retrieve these same events. #### curl ```bash curl -s \ "$base_uri/topics/test_topic/partitions/0/records?offset=0&timeout=1000&max_bytes=100000"\ -H "Accept: application/vnd.kafka.json.v2+json" ``` #### NodeJS ```javascript let options = { headers: { accept: "application/vnd.kafka.json.v2+json" }, params: { offset: 0, timeout: "1000", max_bytes: "100000", }, }; axios .get(`${base_uri}/topics/test_topic/partitions/0/records`, options) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` Run the application: ```bash node index.js ``` #### Python ```python res = requests.get( url=f"{base_uri}/topics/test_topic/partitions/0/records", params={"offset": 0, "timeout":1000,"max_bytes":100000}, headers={"Accept": "application/vnd.kafka.json.v2+json"}).json() pretty(res) ``` Expected output: ```bash [{"topic":"test_topic","key":null,"value":"Redpanda","partition":0,"offset":0}] ``` ### Get list of brokers #### curl ```bash curl "$base_uri/brokers" ``` #### NodeJS ```javascript axios .get(`${base_uri}/brokers`) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` #### Python ```python res = requests.get(f"{base_uri}/brokers").json() pretty(res) ``` Expected output: ```bash {brokers: [0]} ``` ### Create a consumer To retrieve events from a topic using consumers, you must create a consumer and a consumer group, and then subscribe the consumer instance to a topic. Each action involves a different endpoint and method. The first endpoint is: `/consumers/`. For this REST call, the payload is the group information. #### curl ```bash curl -s \ -X POST \ "$base_uri/consumers/test_group" \ -H "Content-Type: application/vnd.kafka.v2+json" \ -d '{ "format":"json", "name":"test_consumer", "auto.offset.reset":"earliest", "auto.commit.enable":"false", "fetch.min.bytes": "1", "consumer.request.timeout.ms": "10000" }' ``` #### NodeJS ```javascript let payload = { "name": "test_consumer", "format": "json", "auto.offset.reset": "earliest", "auto.commit.enable": "false", "fetch.min.bytes": "1", "consumer.request.timeout.ms": "10000" }; let options = { headers: { "Content-Type": "application/vnd.kafka.v2+json" }}; axios .post(`${base_uri}/consumers/test_group`, payload, options) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` Run the application: ```bash node index.js ``` #### Python ```python res = requests.post( url=f"{base_uri}/consumers/test_group", data=json.dumps({ "name": "test_consumer", "format": "json", "auto.offset.reset": "earliest", "auto.commit.enable": "false", "fetch.min.bytes": "1", "consumer.request.timeout.ms": "10000" }), headers={"Content-Type": "application/vnd.kafka.v2+json"}).json() pretty(res) ``` Expected output: ```bash {"instance_id":"test_consumer","base_uri":"http://:30082/consumers/test_group/instances/test_consumer"} ``` > 📝 **NOTE** > > - Consumers expire after five minutes of inactivity. To prevent this from happening, try consuming events within a loop. If the consumer has expired, you can create a new one with the same name. > > - The output `base_uri` is the full URL path for this specific consumer instance and differs from the `base_uri` variable used in the code examples. ### Subscribe to the topic After creating the consumer, subscribe to the topic that you created. #### curl ```bash curl -s -o /dev/null -w "%{http_code}" \ -X POST \ "$base_uri/consumers/test_group/instances/test_consumer/subscription"\ -H "Content-Type: application/vnd.kafka.v2+json" \ -d '{ "topics": [ "test_topic" ] }' ``` #### NodeJS ```javascript let payload = { topics: ["test_topic"]}; let options = { headers: { "Content-Type": "application/vnd.kafka.v2+json" }}; axios .post(`${base_uri}/consumers/test_group/instances/test_consumer/subscription`, payload, options) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` Run the application: ```bash node index.js ``` #### Python ```python res = requests.post( url=f"{base_uri}/consumers/test_group/instances/test_consumer/subscription", data=json.dumps({"topics": ["test_topic"]}), headers={"Content-Type": "application/vnd.kafka.v2+json"}) ``` Expected response is an HTTP 204, without a body. Now you can get the events from `test_topic`. ### Retrieve events Retrieve the events from the topic: #### curl ```bash curl -s \ "$base_uri/consumers/test_group/instances/test_consumer/records?timeout=1000&max_bytes=100000"\ -H "Accept: application/vnd.kafka.json.v2+json" ``` #### NodeJS ```javascript let options = { headers: { Accept: "application/vnd.kafka.json.v2+json" }, params: { timeout: "1000", max_bytes: "100000", }, }; axios .get(`${base_uri}/consumers/test_group/instances/test_consumer/records`, options) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` Run the application: ```bash node index.js ``` #### Python ```python res = requests.get( url=f"{base_uri}/consumers/test_group/instances/test_consumer/records", params={"timeout":1000,"max_bytes":100000}, headers={"Accept": "application/vnd.kafka.json.v2+json"}).json() pretty(res) ``` Expected output: ```bash [{"topic":"test_topic","key":null,"value":"Redpanda","partition":0,"offset":0},{"topic":"test_topic","key":null,"value":"HTTP proxy","partition":1,"offset":0},{"topic":"test_topic","key":null,"value":"Test event","partition":2,"offset":0}] ``` ### Get offsets from consumer #### curl ```bash curl -s \ -X 'GET' \ curl -s -o /dev/null -w "%{http_code}" \ -X 'POST' \ "$base_uri/consumers/test_group/instances/test_consumer/offsets" \ -H 'accept: application/vnd.kafka.v2+json' \ -H 'accept: application/vnd.kafka.v2+json' \ -H 'Content-Type: application/vnd.kafka.v2+json' \ -d '{ "partitions": [ { "topic": "test_topic", "partition": 0 }, { "topic": "test_topic", "partition": 1 }, { "topic": "test_topic", "partition": 2 } ] }' ``` #### Python ```python res = requests.get( url=f"{base_uri}/consumers/test_group/instances/test_consumer/offsets", data=json.dumps( dict(partitions=[ dict(topic="test_topic", partition=p) for p in [0, 1, 2] ])), headers={"Content-Type": "application/vnd.kafka.v2+json"}).json() pretty(res) ``` Expected output: ```bash { "offsets": [{ "topic": "test_topic", "partition": 0, "offset": 0, "metadata": "" },{ "topic": "test_topic", "partition": 1, "offset": 0, "metadata": "" }, { "topic": "test_topic", "partition": 2, "offset": 0, "metadata": "" }] } ``` ### Commit offsets for consumer After events have been handled by a consumer, the offsets can be committed, so that the consumer group won’t retrieve them again. #### curl ```bash curl -s -o /dev/null -w "%{http_code}" \ -X 'POST' \ "$base_uri/consumers/test_group/instances/test_consumer/offsets" \ -H 'accept: application/vnd.kafka.v2+json' \ -H 'Content-Type: application/vnd.kafka.v2+json' \ -d '{ "partitions": [ { "topic": "test_topic", "partition": 0, "offset": 0 }, { "topic": "test_topic", "partition": 1, "offset": 0 }, { "topic": "test_topic", "partition": 2, "offset": 0 } ] }' ``` #### NodeJS ```javascript let options = { headers: { accept: "application/vnd.kafka.v2+json", "Content-Type": "application/vnd.kafka.v2+json", } }; let payload = { partitions: [ { topic: "test_topic", partition: 0, offset: 0 }, { topic: "test_topic", partition: 1, offset: 0 }, { topic: "test_topic", partition: 2, offset: 0 }, ]}; axios .post(`${base_uri}/consumers/test_group/instances/test_consumer/offsets`, payload, options) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` Run the application: ```bash node index.js ``` #### Python ```python res = requests.post( url=f"{base_uri}/consumers/test_group/instances/test_consumer/offsets", data=json.dumps( dict(partitions=[ dict(topic="test_topic", partition=p, offset=0) for p in [0, 1, 2] ])), headers={"Content-Type": "application/vnd.kafka.v2+json"}) ``` Expected output: none. ### Delete a consumer To remove a consumer from a group, send a DELETE request as shown below: #### curl ```bash curl -s -o /dev/null -w "%{http_code}" \ -X 'DELETE' \ "$base_uri/consumers/test_group/instances/test_consumer" \ -H 'Content-Type: application/vnd.kafka.v2+json' ``` #### NodeJS ```javascript let options = { headers: { "Content-Type": "application/vnd.kafka.v2+json" }}; axios .delete(`${base_uri}/consumers/test_group/instances/test_consumer`, options) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` #### Python ```python res = requests.delete( url=f"{base_uri}/consumers/test_group/instances/test_consumer", headers={"Content-Type": "application/vnd.kafka.v2+json"}) ``` ## Authenticate with HTTP Proxy HTTP Proxy supports authentication using SCRAM credentials or OIDC tokens. The authentication method depends on the cluster’s [`http_authentication`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#http_authentication) settings. ### SCRAM Authentication If HTTP Proxy is configured to support SASL, you can provide the SCRAM username and password as part of the Basic Authentication header in your request. For example, to list topics as an authenticated user: #### curl ```bash curl -s -u ":" ":8082/topics" ``` #### NodeJS ```javascript let options = { auth: { username: "", password: "" }, }; axios .get(`${base_uri}/topics`, options) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` #### Python ```python auth = ("", "") res = requests.get(f"{base_uri}/topics", auth=auth).json() pretty(res) ``` ### OIDC Authentication If HTTP Proxy is configured to support OIDC, you can provide an OIDC token in the Authorization header. For example: #### curl ```bash curl -s -H "Authorization: Bearer " ":8082/topics" ``` #### NodeJS ```javascript let options = { headers: { Authorization: `Bearer ` }, }; axios .get(`${base_uri}/topics`, options) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` #### Python ```python headers = {"Authorization": "Bearer "} res = requests.get(f"{base_uri}/topics", headers=headers).json() pretty(res) ``` ## Use Swagger with HTTP Proxy You can use Swagger UI to test and interact with Redpanda HTTP Proxy endpoints. Use Docker to start Swagger UI: ```bash docker run -p 80:8080 -d swaggerapi/swagger-ui ``` Verify that the Swagger container is available: ```bash docker ps ``` Verify that the Docker container has been added and is running: `swaggerapi/swagger-ui` with `Up…` status In a browser, enter `` in the address bar to open the Swagger console. Change the URL to `http://:30082/v1`, and click `Explore` to update the page with Redpanda HTTP Proxy endpoints. You can call the endpoints in any application and language that supports web interactions. --- # Page 327: Kafka Compatibility **URL**: https://docs.redpanda.com/cloud-data-platform/develop/kafka-clients.md --- # Kafka Compatibility Apache Kafka® clients developed for Kafka protocol version 0.11 or later work with Redpanda with minimal or no changes to your application. This page identifies which clients are validated and calls out any exceptions. Use this reference to: - Identify which Kafka clients are validated with Redpanda - Identify unsupported Kafka features when integrating with Redpanda ## Kafka client compatibility Redpanda validates the Apache Kafka Java client and a set of widely used non-Java clients, at their current versions that support Kafka 4.x, using the ducktape and chaos test suites. Validation confirms connectivity and correctness across core Kafka APIs, such as produce, consume, and transaction operations, at current client versions. Modern clients auto-negotiate protocol versions or use an earlier protocol version accepted by Redpanda brokers. > 💡 **TIP** > > Always use the latest supported version of a Kafka client. The following clients have been validated with Redpanda. | Language | Client | | --- | --- | | Java | [Apache Kafka Java Client](https://github.com/apache/kafka) | | C/C++ | [librdkafka](https://github.com/confluentinc/librdkafka) | | Go | - [franz-go](https://github.com/twmb/franz-go)
- [confluent-kafka-go](https://github.com/confluentinc/confluent-kafka-go)
- [Sarama](https://github.com/IBM/sarama) | | Python | - [kafka-python](https://github.com/dpkp/kafka-python)
- [confluent-kafka-python](https://github.com/confluentinc/confluent-kafka-python) | | Rust | [kafka-rust](https://github.com/kafka-rust/kafka-rust) | | Node.js | - [KafkaJS](https://kafka.js.org)
- [confluent-kafka-javascript](https://github.com/confluentinc/confluent-kafka-javascript) | Clients that have not been validated by Redpanda Data, but use the Kafka protocol, remain compatible with Redpanda subject to the limitations in the next section (particularly those based on librdkafka, such as confluent-kafka-dotnet). If you find a client that does not work with Redpanda, reach out in the [Redpanda community on GitHub](https://github.com/redpanda-data/community). ## Compatibility exceptions Redpanda is compatible with the Kafka protocol, with the following exceptions: - Multiple SCRAM mechanisms simultaneously for SASL users are not supported. For example, a user cannot have both a `SCRAM-SHA-256` and a `SCRAM-SHA-512` credential. Redpanda supports only one SASL/SCRAM mechanism per user: either `SCRAM-SHA-256` or `SCRAM-SHA-512`. For details, see [Authentication](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/). - HTTP Proxy (`pandaproxy`): Unlike other REST proxy implementations in the Kafka ecosystem, Redpanda HTTP Proxy does not support topic and ACLs CRUD through the HTTP Proxy. HTTP Proxy is designed for clients producing and consuming data that do not perform administrative functions. - The `delete.retention.ms` topic configuration in Kafka is not supported for Tiered Storage topics. Cloud Topics and local storage topics support Tombstone marker deletion using `delete.retention.ms`, but in Tiered Storage topics, Tombstone markers are only removed in accordance with normal topic retention, and only if the cleanup policy is `delete` or `compact, delete`. - The Kafka request rate quota (`request_percentage`), which limits the share of broker request-handling capacity a client can consume, is not supported. Redpanda supports byte-rate (`producer_byte_rate`, `consumer_byte_rate`) and topic-mutation (`controller_mutation_rate`) quotas, which you can apply [per user, per client, or per client group](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/manage-throughput/#client-throughput-limits). - Redpanda accepts some Kafka topic configurations so that Kafka tools and clients work unchanged, but they have no effect. Setting one when you create or alter a topic succeeds without changing the topic. Most of them control Kafka mechanisms that Redpanda doesn’t have. For example, Redpanda doesn’t use `min.insync.replicas`. With [`acks=all`](https://docs.redpanda.com/cloud-data-platform/develop/produce-data/configure-producers/#acksall), Redpanda acknowledges a write after a majority of the partition’s replicas have it, whatever `min.insync.replicas` is set to. These configurations are: - `min.insync.replicas` - `unclean.leader.election.enable` - `message.downconversion.enable` - `message.format.version` - `message.timestamp.difference.max.ms` - `segment.index.bytes` - `segment.jitter.ms` - `index.interval.bytes` - `flush.messages` - `file.delete.delay.ms` - `preallocate` - `leader.replication.throttled.replicas` - `follower.replication.throttled.replicas` - [KIP-890](https://cwiki.apache.org/confluence/display/KAFKA/KIP-890:+Transactions+Server-Side+Defense) (Transactions Server-Side Defense): Redpanda does not implement the server-side portion of KIP-890, which addresses transaction errors specific to Kafka’s replication model. Redpanda’s implementation of transactions is not susceptible to this class of errors. When connecting to Redpanda, Kafka 4.x clients detect that Transactions V2 is unsupported and fall back to the original transaction protocol (per-transaction epoch bumping is part of V2 and does not apply). If you find an unsupported feature or incompatibility, [file an issue](https://github.com/redpanda-data/redpanda/issues/new) with the Redpanda team. --- # Page 328: Kafka Connect **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors.md --- # Kafka Connect Use Kafka Connect to integrate your Redpanda data with different data systems. As managed solutions, connectors offer a simpler way to integrate your data than manually creating a solution with the Kafka API. You can set up and manage these connectors for BYOC and Dedicated clusters in the Redpanda Cloud UI or Cloud API. Kafka Connect is not available on Serverless clusters, and it is disabled by default. > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. Each connector is either a source or a sink: - A source connector imports data from a source system into a Redpanda cluster. The source connector’s main task is to fetch data from these sources and convert them into a format suitable for Redpanda. - A sink connector exports data from a Redpanda cluster and pushes it into a target system. Sink connectors read the data from Redpanda and transform it into a format that the target system can use. These sources and sinks work together to create a data pipeline that can move and transform data from one system to another. > ⚠️ **WARNING** > > Modifying the properties of topics that are created and managed by Redpanda applications can cause unexpected errors. This may lead to connector and cluster failures. - [Converters and Serialization](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/converters-and-serialization/) Use converters to handle the serialization and deserialization of data between a Redpanda topic and an external system with Kafka Connect. - [Monitor Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/monitor-connectors/) Use metrics to monitor the health of Kafka Connect. - [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/) Learn how to disable Kafka Connect using the Cloud API. - [Single Message Transforms](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/transforms/) Single Message Transforms (SMTs) let you modify the data and its characteristics as it passes through a connector. - [Sizing Connectors](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/sizing-connectors/) How to choose number of tasks to set for a connector. - [Create an S3 Sink Connector](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-s3-sink-connector/) Use the Redpanda Cloud UI to create an AWS S3 Sink Connector. - [Create a Google BigQuery Sink Connector](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-gcp-bigquery-connector/) Use the Redpanda Cloud UI to create a Google BigQuery Sink Connector. - [Create a GCS Sink Connector](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-gcs-connector/) Use the Redpanda Cloud UI to create a GCS Sink Connector. - [Create an Iceberg Sink Connector](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-iceberg-sink-connector/) Use the Redpanda Cloud UI to create an Iceberg Sink Connector. - [Create a JDBC Sink Connector](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-jdbc-sink-connector/) Use the Redpanda Cloud UI to create a JDBC Sink Connector. - [Create a JDBC Source Connector](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-jdbc-source-connector/) Use the Redpanda Cloud UI to create a JDBC Source Connector. - [Create a MirrorMaker2 Source Connector](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-mmaker-source-connector/) Use the Redpanda Cloud UI to create a MirrorMaker2 Source Connector. - [Create a MirrorMaker2 Checkpoint Connector](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-mmaker-checkpoint-connector/) Use the Redpanda Cloud UI to create a MirrorMaker2 Checkpoint Connector. - [Create a MirrorMaker2 Heartbeat Connector](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-mmaker-heartbeat-connector/) Use the Redpanda Cloud UI to create a MirrorMaker2 Heartbeat Connector. - [Create a MongoDB Sink Connector](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-mongodb-sink-connector/) Use the Redpanda Cloud UI to create a MongoDB Sink Connector. - [Create a MongoDB Source Connector](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-mongodb-source-connector/) Use the Redpanda Cloud UI to create a MongoDB Source Connector. - [Create a MySQL (Debezium) Source Connector](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-mysql-source-connector/) Use the Redpanda Cloud UI to create a MySQL (Debezium) Source Connector. - [Create a PostgreSQL (Debezium) Source Connector](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-postgresql-connector/) Use the Redpanda Cloud UI to create a PostgreSQL (Debezium) Source Connector. - [Create a SQL Server (Debezium) Source Connector](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-sqlserver-connector/) Use the Redpanda Cloud UI to create a SQL Server (Debezium) Source Connector. - [Create a Snowflake Sink Connector](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-snowflake-connector/) Use the Redpanda Cloud UI to create a Snowflake Sink Connector. --- # Page 329: Converters and Serialization **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/converters-and-serialization.md --- # Converters and Serialization > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. Connectors are a translation layer working between Redpanda and the remote system. For **sink** connectors the translation happens in the following phases: 1. Converter deserializes data from Redpanda message format (for example JSON or Avro) to a universal in-memory connect data format. 2. The in-memory connect data structure is translated by the connector to the data model of the remote system. For **source** connectors it is vice versa, the phases are: 1. Connector translates the data model from remote system format to the in-memory connect data structure. 2. Converter serializes the data from a universal in-memory connect format to a Redpanda message. Each Redpanda message is a key and value record. Record key and value converters are configured separately with the `Redpanda message key format` and `Redpanda message value format` properties. Key and value converters can be different. > 📝 **NOTE** > > If an external system requires structured data (like BigQuery or a SQL database), then you must provide data with a schema. Use the Avro, Protobuf, or JSON converter with a schema. ## ByteArray converter The ByteArray converter is the most primitive and high-throughput converter. Schema is ignored. This is the default converter type for managed connectors. To use the converter, select the `ByteArray` option as a key or value message format. ## String converter The String converter is a high-throughput converter. Schema is ignored. All data is converted to a string. To use the converter, select the `String` option as a key or value message format. ## JSON converter The JSON converter supports a JSON schema embedded in the message, where each message contains a schema. It results in a bigger message size. The connector needs a message schema to check message format. To use the converter, select the `JSON` option as a key or value message format. Example JSON message with embedded schema: ```json { "schema": { "type": "struct", "fields": [ { "type": "int64", "optional": false, "field": "person_id" }, { "type": "string", "optional": false, "field": "name" } ] }, "payload": { "person_id": 1, "name": "Redpanda" } } ``` If you consume JSON data with no message schema, the schema check for the connector must be disabled with the `Message key JSON contains schema` or `Message value JSON contains schema` option. ## Avro converter The Avro converter requires a schema in Schema Registry. Avro supports primitive types and complex types, like records, enums, arrays, maps, and unions. To specify a timestamp in an Avro schema for use with Kafka Connect, use: ```json { "name": "time1", "type": [ "null", { "type": "long", "connect.version": 1, "connect.name": "org.apache.kafka.connect.data.Timestamp", "logicalType": "timestamp-millis" } ], "default": null } ``` See also: - [Redpanda Schema Registry](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-overview/) - [Avro specification](https://avro.apache.org/docs/1.11.1/specification) ## CloudEvents converter The CloudEvents converter is specific to Debezium PostgreSQL and MySQL source connectors. See also: [CloudEvents Converter documentation](https://debezium.io/documentation/reference/stable/integrations/cloudevents.html) ## Protobuf converter ![Beta](https://img.shields.io/badge/Beta-red.svg) The Protobuf converter requires a schema in Schema Registry. The converter only supports sink connectors. Source connectors are not supported. To use the converter, select the `Protobuf` option as a key or value message format. See also: [Redpanda Schema Registry](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-overview/) ## Set property keys Kafka Connect connectors use a set of `=` to set up properties. For example if you want to set the property `topic.creation.enable` to `true`, use `topic.creation.enable=true` in the property settings page. --- # Page 330: Create a Google BigQuery Sink Connector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-gcp-bigquery-connector.md --- # Create a Google BigQuery Sink Connector > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. The Google BigQuery Sink connector enables you to stream any structured data from Redpanda to BigQuery for advanced analytics. ## Prerequisites Before you can create a Google BigQuery Sink connector in the Redpanda Cloud, you must: 1. Create a [Google Cloud](https://cloud.google.com/) account. 2. In the **Google home** page: 1. [Select an existing project](https://cloud.google.com/resource-manager/docs/creating-managing-projects#get_an_existing_project) or [create a new one](https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project). 2. [Create a new dataset](https://cloud.google.com/bigquery/docs/datasets) for the project. 3. (_Optional if your data has a schema_) After creating the dataset, [create a new table](https://cloud.google.com/bigquery/docs/tables) to hold the data you intend to stream from Redpanda Cloud topics. Specify a structure for the table using schema values that align with your Redpanda topic data. > 📝 **NOTE** > > This step is mandatory only if the data in Redpanda does not have a schema. If the data in Redpanda includes a schema, then the connector automatically creates the tables in BigQuery. 3. Create a [custom role](https://cloud.google.com/iam/docs/creating-custom-roles). The role must have the following permissions: ``` bigquery.datasets.get bigquery.tables.create bigquery.tables.get bigquery.tables.getData bigquery.tables.list bigquery.tables.update bigquery.tables.updateData ``` 4. Create a [service account](https://cloud.google.com/iam/docs/service-accounts-create). 5. [Add the custom role to your service account](https://cloud.google.com/iam/docs/granting-changing-revoking-access). 6. [Create a service account key](https://cloud.google.com/iam/docs/keys-create-delete), and then download it. ## Limitations The Google BigQuery Sink connector doesn’t support schemas with recursion. ## Create a Google BigQuery Sink connector To create the Google BigQuery Sink connector: 1. In Redpanda Cloud, click **Connectors** in the navigation menu, and then click **Create Connector**. 2. Select **Export to Google BigQuery**. 3. On the **Create Connector** page, specify the following required connector configuration options: | Property name | Property key | Description | | --- | --- | --- | | `Topics to export` | `topics` | A comma-separated list of the cluster topics you want to replicate to Google BigQuery. | | `Topics regex` | `topics.regex` | A Java regular expression of topics to replicate. For example: specify `.*` to replicate all available topics in the cluster. Applicable only when **Use regular expressions** is selected. | | `Credentials JSON` | `keyfile` | A JSON key with BigQuery service account credentials. | | `Project` | `project` | The BigQuery project to which topic data will be written. | | `Default dataset` | `defaultDataset` | The default Google BigQuery dataset to be used. | | `Kafka message value format` | `value.converter` | The format of the value in the Redpanda topic. The default is `JSON`. | | `Max Tasks` | `tasks.max` | Maximum number of tasks to use for this connector. The default is `1`. Each task replicates exclusive set of partitions assigned to it. | | `Connector name` | `name` | Globally-unique name to use for this connector. | 4. Click **Next**. Review the connector properties specified, then click **Create**. ### Advanced Google BigQuery Sink connector configuration In most instances, the preceding basic configuration properties are sufficient. If you require any additional property settings (for example, automatically create BigQuery tables or map topics to tables), then specify any of the following _optional_ advanced connector configuration properties by selecting **Show advanced options** on the **Create Connector** page: | Property name | Property key | Description | | --- | --- | --- | | `Auto create tables` | `autoCreateTables` | Automatically create BigQuery tables if they don’t already exist. If the table does not exist, then it is created based on the record schema. | | `Topic to table map` | `topic2TableMap` | Map of topics to tables. Format: comma-separated tuples, for example `topic1:table1,topic2:table2`. | | `Allow new BigQuery fields` | `allowNewBigQueryFields` | If true, new fields can be added to BigQuery tables during subsequent schema updates. | | `Allow BigQuery required field relaxation` | `allowBigQueryRequiredFieldRelaxation` | If true, fields in the BigQuery schema can be changed from `REQUIRED` to `NULLABLE`. | | `Upsert enabled` | `upsertEnabled` | Enables upsert functionality on the connector. | | `Delete enabled` | `deleteEnabled` | Enable delete functionality on the connector. | | `Kafka key field name` | `kafkaKeyFieldName` | The name of the BigQuery table field for the Kafka key. Must be set when upsert or delete is enabled. | | `Time partitioning type` | `timePartitioningType` | The time partitioning type to use when creating tables. | | `BigQuery retry attempts` | `bigQueryRetry` | The number of retry attempts made for each BigQuery request that fails with a backend or quota exceeded error. | | `BigQuery retry attempts interval` | `bigQueryRetryWait` | The minimum amount of time, in milliseconds, to wait between BigQuery backend or quota exceeded error retry attempts. | | `Error tolerance` | `errors.tolerance` | Error tolerance response during connector operation. Default value is `none` and signals that any error will result in an immediate connector task failure. Value of `all` changes the behavior to skip over problematic records. | | `Dead letter queue topic name` | `errors.deadletterqueue.topic.name` | The name of the topic to be used as the dead letter queue (DLQ) for messages that result in an error when processed by this sink connector, its transformations, or converters. The topic name is blank by default, which means that no messages are recorded in the DLQ. | | `Dead letter queue topic replication factor` | `errors.deadletterqueue.topic .replication.factor` | Replication factor used to create the dead letter queue topic when it doesn’t already exist. | | `Enable error context headers` | `errors.deadletterqueue.context .headers.enable` | When `true`, adds a header containing error context to the messages written to the dead letter queue. To avoid clashing with headers from the original record, all error context header keys, start with `__connect.errors`. | ## Map data Use the appropriate key or value converter (input data format) for your data as follows: - `JSON` (`org.apache.kafka.connect.json.JsonConverter`) when your messages are JSON-encoded. Select `Message JSON contains schema`, with the `schema` and `payload` fields. If your messages do not contain schema, manually create tables in BigQuery. - `AVRO` (`io.confluent.connect.avro.AvroConverter`) when your messages contain AVRO-encoded messages, with schema stored in the Schema Registry. ## Topic name to table name mapping By default, the table name is the name of the topic. Use the `Topic to table map` (`topic2TableMap`) configuration property to remap topic names. For example, `topic1:table1,topic2:table2`. ## Test the connection After the connector is created, go to your BigQuery worksheets and query your table: ```sql SELECT * FROM `project.dataset.table` ``` It may take a couple of minutes for the records to be visible in BigQuery. ## Troubleshoot Google credentials are checked for validity during connector creation, upon clicking **Finish**. In cases where there are invalid credentials, the connector is not created. Other issues are reported using a failed task error message. Select **Show Logs** to view error details. | Message | Action | | --- | --- | | **Not found: Project invalid-project-name** | Check to make sure `Project` contains a valid BigQuery project. | | **Not found: Dataset project:invalid-dataset** | Check to make sure `Default dataset` contains a valid BigQuery dataset. | | **An unexpected error occurred while validating credentials for BigQuery: Failed to create credentials from input stream** | The credentials given as a JSON file in the `Credentials JSON` property are incorrect. Copy a valid key from the Google Cloud service account. | | **JsonConverter with schemas.enable requires "schema" and "payload" fields** | The connector encountered an incorrect message format when reading from a topic. | | **JsonParseException: Unrecognized token 'test': was expecting JSON** | During reading from a topic the connector encountered a message that is invalid JSON. | | **Streaming to metadata partition of column-based partitioning table {table_name} is disallowed.** | Check to confirm that the `bigQueryPartitionDecorator` property is set to `false`. You can check the property in the connector configuration JSON view. | | **Caused by: table: GenericData{classInfo=…​ insertion failed for the following rows:…​ no such field:** | The Redpanda message contains a property that does not exist in a BigQuery table schema. | | **BigQueryConnectException …​ insertion failed for the following rows: …​ \[row index 0\] (location fieldname\[0\], reason: invalid): This field: fieldname is not a record.** | The Redpanda message contains an array of records, but the BigQuery table expects an array of strings. | | **BigQueryConnectException: Failed to unionize schemas of records for the table…​ Could not convert to BigQuery schema with a batch of tombstone records.** | The Redpanda message does not contain a schema, so the connector cannot create a BigQuery table. Create the BigQuery table manually. | --- # Page 331: Create a GCS Sink Connector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-gcs-connector.md --- # Create a GCS Sink Connector > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. The Google Cloud Storage (GCS) Sink connector stores Redpanda messages in a Google Cloud Storage bucket. ## Prerequisites Before you can create a GCS Sink connector in the Redpanda Cloud, you must: 1. Create a [Google Cloud](https://cloud.google.com/) account. 2. [Create a service account](https://cloud.google.com/iam/docs/service-accounts-create) that will be used to connect to the GCS service. 3. [Create a service account key](https://cloud.google.com/iam/docs/keys-create-delete) and download it. 4. Create a [custom role](https://cloud.google.com/iam/docs/creating-custom-roles), which must have the following permissions: - `storage.objects.create` to create items in the GCS bucket - `storage.objects.delete` to overwrite items in the GCS bucket 5. [Create a GCS bucket](https://cloud.google.com/storage/docs/creating-buckets) to which to send data. 6. [Grant permissions](https://cloud.google.com/storage/docs/access-control/using-iam-permissions) to the bucket your created for your service account. Use the role created in step 4. ## Limitations The GCS Sink connector has the following limitations: - You can use only the `STRING` and `BYTES` input formats for `CSV` output format. - You can use only the `PARQUET` format when your messages contain schema. ## Create a GCS Sink connector To create the GCS Sink connector: 1. In Redpanda Cloud, click **Connectors** in the navigation menu, and then click **Create Connector**. 2. Select **Export to Google Cloud Storage**. 3. On the **Create Connector** page, specify the following required connector configuration options: | Property name | Property key | Description | | --- | --- | --- | | `Topics to export` | `topics` | Comma-separated list of the cluster topics you want to replicate to GCS. | | `Topics regex` | `topics.regex` | Java regular expression of topics to replicate. For example: specify `.*` to replicate all available topics in the cluster. Applicable only when **Use regular expressions** is selected. | | `GCS Credentials JSON` | `gcs.credentials.json` | JSON object with GCS credentials. | | `GCS bucket name` | `gcs.bucket.name` | Name of an existing GCS bucket to store output files in. | | `Kafka message key format` | `key.converter` | Format of the key in the Redpanda topic. Use `BYTES` for no conversion. | | `Kafka message value format` | `value.converter` | Format of the value in the Redpanda topic. Use `BYTES` for no conversion. | | `GCS file format` | `format.output.type` | Format of the files created in GCS: `CSV` (the default), `JSON`, `JSONL AVRO`, or `PARQUET`. You can use the `CSV` format output only with `BYTES` and `STRING`. | | `Avro codec` | `avro.codec` | The Avro compression codec to be used for Avro output files. Available values: `null` (the default), `deflate`, `snappy`, and `bzip2`. | | `Max Tasks` | `tasks.max` | Maximum number of tasks to use for this connector. The default is `1`. Each task replicates exclusive set of partitions assigned to it. | | `Connector name` | `name` | Globally-unique name to use for this connector. | 4. Click **Next**. Review the connector properties specified, then click **Create**. ### Advanced GCS Sink connector configuration In most instances, the preceding basic configuration properties are sufficient. If you require any additional property settings, then specify any of the following _optional_ advanced connector configuration properties by selecting **Show advanced options** on the **Create Connector** page: | Property name | Property key | Description | | --- | --- | --- | | `File name template` | `file.name.template` | The template for file names on GCS. Supports `{{ variable }}` placeholders for substituting variables. Supported placeholders are:
- `topic`
- `partition`
- `start_offset` (the offset of the first record in the file)
- `timestamp:unit=yyyy\|MM\|dd\|HH` (the timestamp of the record)
- `key` (when used, other placeholders are not substituted) | | `File name prefix` | `file.name.prefix` | The prefix to be added to the name of each file put in GCS. | | `Output fields` | `format.output.fields` | Fields to place into output files. Supported values are: 'key', 'value', 'offset', 'timestamp', and 'headers'. | | `Value field encoding` | `format.output.fields.value.encoding` | The type of encoding to be used for the value field. Supported values are: 'none' and 'base64'. | | `Envelope for primitives` | `format.output.envelope` | Specifies whether or not to enable additional JSON object wrapping of the actual value. | | `Output file compression` | `file.compression.type` | The compression type to be used for files put into GCS. Supported values are: 'none', 'gzip', 'snappy', and 'zstd'. | | `Max records per file` | `file.max.records` | The maximum number of records to put in a single file. Must be a non-negative number. 0 is interpreted as "unlimited", which is the default. In this case files are only flushed after `file.flush.interval.ms`. | | `File flush interval milliseconds` | `file.flush.interval.ms` | The time interval to periodically flush files and commit offsets. Value specified must be a non-negative number. Default is 60 seconds. 0 indicates that it is disabled. In this case, files are only flushed after reaching `file.max.records` record size. | | `GCS bucket check` | `gcs.bucket.check` | If set to `true`, the connector will attempt to put a test file to the GCS bucket to validate access. Default is `true`. | | `GCS retry backoff initial delay milliseconds` | `gcs.retry.backoff.initial.delay.ms` | Initial retry delay in milliseconds. The default value is 1000. | | `GCS retry backoff max delay milliseconds` | `gcs.retry.backoff.max.delay.ms` | Maximum retry delay in milliseconds. The default value is 32000. | | `GCS retry backoff delay multiplier` | `gcs.retry.backoff.delay.multiplier` | Retry delay multiplier. The default value is 2.0. | | `GCS retry backoff max attempts` | `gcs.retry.backoff.max.attempts` | Retry max attempts. The default value is 6. | | `GCS retry backoff total timeout milliseconds` | `gcs.retry.backoff.total.timeout.ms` | Retry total timeout in milliseconds. The default value is 50000. | | `Retry back-off` | `kafka.retry.backoff.ms` | Retry backoff in milliseconds. In case of transient exceptions, useful for performing recovery. Maximum value is 86400000 (24 hours). | | `Error tolerance` | `errors.tolerance` | Error tolerance response during connector operation. Default value is `none` and signals that any error will result in an immediate connector task failure. Value of `all` changes the behavior to skip over problematic records. | | `Dead letter queue topic name` | `errors.deadletterqueue.topic.name` | The name of the topic to be used as the dead letter queue (DLQ) for messages that result in an error when processed by this sink connector, its transformations, or converters. The topic name is blank by default, which means that no messages are recorded in the DLQ. | | `Dead letter queue topic replication factor` | `errors.deadletterqueue.topic .replication.factor` | Replication factor used to create the dead letter queue topic when it doesn’t already exist. | | `Enable error context headers` | `errors.deadletterqueue.context .headers.enable` | When `true`, adds a header containing error context to the messages written to the dead letter queue. To avoid clashing with headers from the original record, all error context header keys, start with `__connect.errors`. | ## Map data Use the appropriate key or value converter (input data format) for your data as follows: - `JSON` (`org.apache.kafka.connect.json.JsonConverter`) when your messages are JSON-encoded. Select `Message JSON contains schema`, with the `schema` and `payload` fields. - `AVRO` (`io.confluent.connect.avro.AvroConverter`) when your messages contain AVRO-encoded messages, with schema stored in the Schema Registry. - `STRING` (`org.apache.kafka.connect.storage.StringConverter`) when your messages contain textual data. - `BYTES` (`org.apache.kafka.connect.converters.ByteArrayConverter`) when your messages contain arbitrary data. You can also select the output data format for your GCS files as follows: - `CSV` to produce data in the `CSV` format. For `CSV` only, you can set `STRING` and `BYTES` input formats. - `JSON` to produce data in the `JSON` format as an array of record objects. - `JSONL` to produce data in the `JSON` format, each message as a separate JSON, one per line. - `PARQUET` to produce data in the `PARQUET` format when your messages contain schema. - `AVRO` to produce data in the `AVRO` format when your messages contain schema. ## Test the connection After the connector is created, check the GCS bucket for a new file. Files should appear after the file flush interval (default is 60 seconds). ## Troubleshoot If there are any connection issues, an error message is returned. Depending on the `GCS bucket check` property value, the error results in a failed connector (`GCS bucket check = true`) or a failed task (`GCS bucket check = false`). Select **Show Logs** to view error details. Additional errors and corrective actions follow. | Message | Action | | --- | --- | | **Failed to read credentials from JSON string** | The credentials given as JSON file in the `GCS credentials JSON` property are incorrect. Copy a valid key from the Google Cloud service account. | | **The specified bucket does not exist** | Create the bucket if the bucket does not exist, or correct the bucket name if the bucket exists, but the specified `GCS bucket name` value is incorrect. | | **No files in the GCS bucket** | Be sure to wait until the connector performs the first file flush (default is 60 seconds). | --- # Page 332: Create an Iceberg Sink Connector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-iceberg-sink-connector.md --- # Create an Iceberg Sink Connector > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. You can use the Iceberg Sink connector to accomplish the following: - Write data into Iceberg tables - Commit coordination for centralized Iceberg commits - Exactly-once delivery semantics - Multi-table fan-out - Row mutations (update/delete rows), upsert mode - Automatic table creation and schema evolution - Field name mapping via Iceberg’s column mapping functionality ## Prerequisites Before you can create an Iceberg Sink connector in Redpanda Cloud, you must: 1. [Set up an Iceberg catalog](https://iceberg.apache.org/docs/latest/configuration/#catalog-properties). 2. Create the Iceberg connector control topic, which cannot be used by other connectors. For details, see [Create a Topic](https://docs.redpanda.com/cloud-data-platform/develop/topics/create-topic/). ## Limitations - Each Iceberg sink connector must have its own control topic, which you should create before creating the connector. ## Create an Iceberg Sink connector To create the Iceberg Sink connector: 1. In Redpanda Cloud, click **Connectors** in the navigation menu and then click **Create Connector**. 2. Select **Export to Iceberg**. 3. On the **Create Connector** page, specify the following required connector configuration options: | Property name | Property key | Description | | --- | --- | --- | | `Topics to export` | `topics` | Comma-separated list of the cluster topics you want to replicate. | | `Topics regex` | `topics.regex` | Java regular expression of topics to replicate. For example: specify `.*` to replicate all available topics in the cluster. Applicable only when **Use regular expressions** is selected. | | `Iceberg control topic` | `iceberg.control.topic` | The name of the control topic. You must create this topic before creating the Iceberg connector. It cannot be used by other Iceberg connectors. | | `Iceberg catalog type` | `iceberg.catalog.type` | The type of Iceberg catalog. Allowed options are: `REST`, `HIVE`, `HADOOP`. | | `Iceberg tables` | `iceberg.tables` | Comma-separated list of Iceberg table names, which are specified using the format `{namespace}.{table}`. | 4. Click **Next**. Review the connector properties specified, then click **Create**. ### Advanced Iceberg Sink connector configuration In most instances, the preceding basic configuration properties are sufficient. If you require additional property settings, then specify any of the following _optional_ advanced connector configuration properties by selecting **Show advanced options** on the **Create Connector** page: | Property name | Property key | Description | | --- | --- | --- | | `Iceberg commit timeout` | `iceberg.control.commit.timeout-ms` | Commit timeout interval in ms. The default is 30000 (30 sec). | | `Iceberg tables route field` | `iceberg.tables.route-field` | For multi-table fan-out, the name of the field used to route records to tables. | | `Iceberg tables CDC field` | `iceberg.tables.cdc-field` | Name of the field containing the CDC operation, `I`, `U`, or `D`. Default is none. | ## Map data Use the appropriate key or value converter (input data format) for your data as follows: - `JSON` when your messages are JSON-encoded. Select `Message JSON contains schema` with the `schema` and `payload` fields. If your messages do not contain schema, create Iceberg tables manually. - `AVRO` when your messages contain AVRO-encoded messages, with schema stored in the Schema Registry. An Iceberg table’s schema is a list of named columns. All data types are either primitives or nested types, which are maps, lists, or structs. A table schema is also a struct type. See also: [Schemas and Data Types](https://iceberg.apache.org/spec/#schemas-and-data-types) ## Sinking data produced by Debezium source connector Debezium connectors produce data in CDC format. The message structure can be flattened by using Debezium built-in New Record State Extraction Single Message Transformation (SMT). Add the following properties to the Debezium connector configuration to make it produce flat messages: ```json { ... "transforms", "unwrap", "transforms.unwrap.type", "io.debezium.transforms.ExtractNewRecordState", "transforms.unwrap.drop.tombstones", "false", ... } ``` Depending on your particular use case, you can apply the SMT to a Debezium connector, or to a sink connector that consumes messages that the Debezium connector produces. To enable Apache Kafka to retain the Debezium change event messages in their original format, configure the SMT for a sink connector. See also: [Debezium New Record State Extraction SMT](https://debezium.io/documentation/reference/stable/transformations/event-flattening.html) ## Use analytical tools with Iceberg Iceberg serves as a single storage solution for analytical data. It is inexpensive to read from various tools such as AWS Athena, Snowflake, or Apache Spark. Traditionally, data import involved pushing data to every tool, incurring high costs for data transfer and storage. Alternatively, you could use plain S3 buckets with Avro or CSV files, but this struggles with schema evolution. [Apache Iceberg](https://iceberg.apache.org) addresses all of these challenges: cost of data transfer, multiple data copies in storage, and support for schema evolution. ![Iceberg sink connector diagram](https://docs.redpanda.com/cloud-data-platform/shared/_images/iceberg_sink_connector_diagram.png) The following example uses: - Iceberg REST catalog - AWS S3 bucket as the storage for Iceberg files - Apache Spark, which reads the Iceberg data from an S3 bucket ```yaml version: '3' services: redpanda: image: docker.redpanda.com/redpandadata/redpanda:latest command: - redpanda start - --smp 1 - --overprovisioned - --node-id 0 - --reserve-memory 0M - --check=false - --set redpanda.auto_create_topics_enabled=false - --kafka-addr PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092 - --advertise-kafka-addr PLAINTEXT://redpanda:29092,OUTSIDE://localhost:9092 - --pandaproxy-addr 0.0.0.0:8082 - --advertise-pandaproxy-addr localhost:8082 ports: - 8081:8081 - 8082:8082 - 9092:9092 - 9644:9644 - 29092:29092 console: image: docker.redpanda.com/redpandadata/console:latest restart: on-failure entrypoint: /bin/sh command: -c "echo \"$$CONSOLE_CONFIG_FILE\" > /tmp/config.yml; /app/console" environment: CONFIG_FILEPATH: /tmp/config.yml CONSOLE_CONFIG_FILE: | kafka: brokers: ["redpanda:29092"] schemaRegistry: enabled: true urls: ["http://redpanda:8081"] connect: enabled: true clusters: - name: connectors url: http://connect:8083 ports: - "8090:8080" depends_on: - redpanda connect: image: docker.redpanda.com/redpandadata/connectors:latest hostname: connect depends_on: - redpanda - spark-iceberg ports: - "8083:8083" - "9404:9404" environment: CONNECT_CONFIGURATION: | key.converter=org.apache.kafka.connect.converters.ByteArrayConverter value.converter=org.apache.kafka.connect.converters.ByteArrayConverter group.id=connectors-cluster offset.storage.topic=_internal_connectors_offsets config.storage.topic=_internal_connectors_configs status.storage.topic=_internal_connectors_status config.storage.replication.factor=-1 offset.storage.replication.factor=-1 status.storage.replication.factor=-1 producer.linger.ms=1 producer.batch.size=131072 config.providers=file config.providers.file.class=org.apache.kafka.common.config.provider.FileConfigProvider CONNECT_BOOTSTRAP_SERVERS: redpanda:29092 SCHEMA_REGISTRY_URL: http://redpanda:8081 CONNECT_GC_LOG_ENABLED: "false" CONNECT_HEAP_OPTS: -Xms512M -Xmx512M CONNECT_LOG_LEVEL: info CONNECT_TOPIC_LOG_ENABLED: "true" CONNECT_PLUGIN_PATH: "/opt/kafka/connect-plugins" spark-iceberg: image: tabulario/spark-iceberg:3.4.1_1.3.1 build: spark/ depends_on: - rest volumes: - ./warehouse:/home/iceberg/warehouse environment: - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} - AWS_REGION=${AWS_REGION} ports: - 8888:8888 - 8080:8080 - 10000:10000 - 10001:10001 rest: image: tabulario/iceberg-rest:0.6.0 ports: - 8181:8181 environment: - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} - AWS_REGION=${AWS_REGION} - CATALOG_WAREHOUSE=s3://bucket-name/ - CATALOG_IO__IMPL=org.apache.iceberg.aws.s3.S3FileIO ``` Use Spark-SQL to: - List databases: ```none spark-sql ()> show databases; testdb ``` - Show tables in database: ```none spark-sql ()> show tables in testdb; testtable ``` - Select data from table: ```none spark-sql ()> select * from testdb.testtable; ``` ## Use with AWS Glue Data Catalog and AWS Lake Formation The connector can be used with the AWS Glue Data Catalog and the AWS Lake Formation service. AWS Lake Formation only lets you use the role form of authentication. The connectors UI does not support Lake Formation-specific properties. Use the JSON editor instead. Sample configuration: ```json { ... "iceberg.catalog.client.assume-role.region": "the-region", "iceberg.catalog.client.assume-role.arn": "arn:aws:iam::account-number:role/role-name", "iceberg.catalog.glue.account-id": "NNN", "iceberg.catalog.catalog-impl": "org.apache.iceberg.aws.glue.GlueCatalog", "iceberg.catalog.client.assume-role.tags.LakeFormationAuthorizedCaller": "iceberg-connect", "iceberg.catalog.io-impl": "org.apache.iceberg.aws.s3.S3FileIO", "iceberg.catalog": "catalog_name", "iceberg.catalog.warehouse": "s3://bucket-name/my/data", "iceberg.catalog.s3.path-style-access": "true" } ``` ## Test the connection After the connector is created, execute SELECT query on the Iceberg table to verify data. It may take a couple of minutes for the records to be visible in Iceberg. Check connector state and logs for errors. ## Troubleshoot Iceberg connection settings are checked for validity during first data processing. The connector can be successfully created with incorrect configuration and fail only when there are messages in source topic to process. | Message | Action | | --- | --- | | **NoSuchTableException: Table does not exist** | Make sure Iceberg table exists and the connector iceberg.tables configuration contains correct table name in `{namespace}.{table}` format. | | **UnknownHostException: incorrectcatalog: Name or service not known** | Cannot connect to Iceberg catalog. Check if Iceberg catalog URI is correct and accessible. | | **DataException: An error occurred converting record, topic: topicName, partition, 0, offset: 0** | The connector cannot read the message format. Ensure the connector mapping configuration and data format are correct. | | **NullPointerException: Cannot invoke "java.lang.Long.longValue()" because "value" is null** | The connector cannot read the message format. Ensure the connector mapping configuration and data format are correct. | ## Suggested reading - For details about the Iceberg Sink connector configuration properties, see [Iceberg-Kafka-Connect](https://github.com/tabular-io/iceberg-kafka-connect) - For details about the Iceberg Sink connector internals, see [Iceberg-Kafka-Connect documentation](https://github.com/tabular-io/iceberg-kafka-connect/tree/main/docs) --- # Page 333: Create a JDBC Sink Connector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-jdbc-sink-connector.md --- # Create a JDBC Sink Connector > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. You can use a JDBC Sink connector to export structured data from Redpanda to a relational database. ## Prerequisites Before you can create a JDBC Sink connector in the Redpanda Cloud, you must have a: - Relational database instance that is accessible from the JDBC Sink connector instance - Database user ## Limitations The JDBC Sink connector has the following limitations: - Only `JSON` or `AVRO` formats can be used as a value converter. - Only the following databases are supported: - MySQL 5.7 and 8.0 - PostgreSQL 8.2 and higher using the version 3.0 of the PostgreSQL® protocol - SQLite - SQL Server - Microsoft SQL versions: Azure SQL Database, Azure Synapse Analytics, Azure SQL Managed Instance, SQL Server 2014, SQL Server 2016, SQL Server 2017, SQL Server 2019 ## Create a JDBC Sink connector To create the JDBC Sink connector: 1. In Redpanda Cloud, click **Connectors** in the navigation menu, and then click **Create Connector**. 2. Select **Export to JDBC**. 3. On the **Create Connector** page, specify the following required connector configuration options: | Property name | Property key | Description | | --- | --- | --- | | `Topics to export` | `topics` | Comma-separated list of the cluster topics you want to replicate. | | `Topics regex` | `topics.regex` | Java regular expression of topics to replicate. For example: specify `.*` to replicate all available topics in the cluster. Applicable only when **Use regular expressions** is selected. | | `JDBC URL` | `connection.url` | The database connection JDBC URL. | | `User` | `connection.user` | Name of the database user to be used when connecting to the database. | | `Password` | `connection.password` | Password of the database user to be used when connecting to the database. | | `Redpanda message key format` | `key.converter` | Format of the key in the Redpanda topic. `BYTES` is the default. | | `Redpanda message value format` | `value.converter` | Format of the value in the Redpanda topic. `JSON` is the default. | | `Auto-create` | `auto.create` | When enabled, automatically creates the destination table (if it is missing) based on the record schema (issues a `CREATE`). The default is disabled. | | `Max Tasks` | `tasks.max` | Maximum number of tasks to use for this connector. The default is `1`. Each task replicates exclusive set of partitions assigned to it. | | `Connector name` | `name` | Globally-unique name to use for this connector. | 4. Click **Next**. Review the connector properties specified, then click **Create**. ### Advanced JDBC Sink connector configuration In most instances, the preceding basic configuration properties are sufficient. If you require additional property settings, then specify any of the following _optional_ advanced connector configuration properties by selecting **Show advanced options** on the **Create Connector** page: | Property name | Property key | Description | | --- | --- | --- | | `Include fields` | `fields.whitelist` | List of comma-separated record value field names. If the value of this property is empty, the connector uses all fields from the record to migrate to a database. Otherwise, the connector uses only the record fields that are specified (in a comma-separated format). Note that `Primary Key Fields` is applied independently in the context of which fields form the primary key columns in the destination database, while this configuration is applicable for the other columns. | | `Topics to tables mapping` | `topics.to.tables.mapping` | Kafka topics to database tables mapping. Comma-separated list of topic to table mapping in the format: `topic_name:table_name`. If the destination table is found in the mapping, then it overrides the generated one defined in `table.name.format`. | | `Table name format` | `table.name.format` | A format string for the destination table name, which may contain `${topic}` as a placeholder for the original topic name. For example, `kafka_${topic}` for the topic orders maps to the table name `kafka_orders`. The default is `${topic}`. | | `Table name normalize` | `table.name.normalize` | Specifies whether or not to normalize destination table names for topics. When enabled, the alphanumeric characters `(a-z, A-Z, 0-9)` and _remain as is, others (such as `.`) are replaced with_ . By default, is disabled. | | `Quote SQL identifiers` | `sql.quote.identifiers` | Specifies whether or not to delimit (in most databases, a quote with double quotation marks) identifiers (for example, table names and column names) in SQL statements. By default, enabled. | | `Auto-evolve` | `auto.evolve` | Whether to automatically add columns in the table schema when found to be missing relative to the record schema by issuing `ALTER`. | | `Batch size` | `batch.size` | Specifies how many records to attempt to batch together for insertion into the destination table, when possible. The default is `3000`. | | `DB time zone` | `db.timezone` | Name of the JDBC timezone that should be used in the connector when querying with time-based criteria. Default is `UTC`. | | `Insert mode` | `insert.mode` | The insertion mode to use. The supported modes are:
- `INSERT`: standard SQL `INSERT` statements
- `MULTI`: multi-row `INSERT` statements
- `UPSERT`: use the appropriate upsert semantics for the target database if it is supported by the connector; for example, `INSERT .. ON CONFLICT .. DO UPDATE SET ..`
- `UPDATE`: use the appropriate update semantics for the target database if it is supported by the connector; for example, `UPDATE`. | | `Primary key mode` | `pk.mode` | The primary key mode to use. Supported modes are:
- `NONE`: no keys utilized
- `kafka`: Kafka coordinates (the topic, partition, and offset) are used as the primary key
- `RECORD_KEY`: fields from the record key are used, which may be a primitive or a struct
- `RECORD_VALUE`: fields from the record value are used, which must be a struct. | | `Primary key fields` | `pk.fields` | Comma-separated list of primary key field names. The runtime interpretation of this configuration depends on the `pk.mode`. Supported modes are:
- `none`: ignored because no fields are used as primary key in this mode.
- `kafka`: must be a trio representing the Kafka coordinates (the topic, partition, and offset). Defaults to `connect_topic,connect_partition,__connect_offset` if empty.
- `record_key`: if empty, all fields from the key struct will be used, otherwise used to extract the desired fields. For primitive key, only a single field name must be configured.
- `record_value`: if empty, all fields from the value struct will be used, otherwise used to extract the desired fields. | | `Maximum retries` | `max.retries` | The maximum number of times to retry on errors before failing the task. The default is `10`. | | `Retry backoff (ms)` | `retry.backoff.ms` | The time in milliseconds to wait before a retry attempt is made following an error. The default is `3000`. | | `Database dialect` | `dialect.name` | The name of the database dialect that should be used for this connector. By default. the connector automatically determines the dialect based upon the JDBC connection URL. Use if you want to override that behavior and specify a specific dialect. | | `Error tolerance` | `errors.tolerance` | Error tolerance response during connector operation. Default value is `none` and signals that any error will result in an immediate connector task failure. Value of `all` changes the behavior to skip over problematic records. | | `Dead letter queue topic name` | `errors.deadletterqueue.topic.name` | The name of the topic to be used as the dead letter queue (DLQ) for messages that result in an error when processed by this sink connector, its transformations, or converters. The topic name is blank by default, which means that no messages are recorded in the DLQ. | | `Dead letter queue topic replication factor` | `errors.deadletterqueue.topic .replication.factor` | Replication factor used to create the dead letter queue topic when it doesn’t already exist. | | `Enable error context headers` | `errors.deadletterqueue.context .headers.enable` | When `true`, adds a header containing error context to the messages written to the dead letter queue. To avoid clashing with headers from the original record, all error context header keys, start with `__connect.errors`. | ## Map data Use the appropriate key or value converter (input data format) for your data as follows: - Use the default `Redpanda message value format` = `JSON` (`org.apache.kafka.connect.json.JsonConverter`) property in your configuration. - Topics should contain data in JSON format with a defined JSON schema. For example: ```json { "schema": { "type": "struct", "fields": [ ] }, "payload": { } } ``` ## Test the connection After the connector is created, ensure that: - There are no errors in logs and in Redpanda Console. - Database tables contain data from Redpanda topics. ## Troubleshoot JDBC Sink connector issues are reported as failed tasks. Select **Show Logs** to view error details. | Message | Action | | --- | --- | | **PSQLException: FATAL: database "invalid-database" does not exist** | Make sure the `JDBC URL` specifies an existing database name. | | **UnknownHostException: invalid-host** | Make sure the `JDBC URL` specifies a valid database host name. | | **PSQLException: Connection to postgres:1234 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections** | Make sure the `JDBC URL` specifies a valid database host name and port, and that the port is accessible. | | **PSQLException: FATAL: password authentication failed for user "postgres"** | Verify that the `User` and `Password` are correct. | | **ConnectException: topic_name.Value (STRUCT) type doesn’t have a mapping to the SQL database column type** | The JDBC Sink connector is not compatible with the Debezium PostgreSQL Source connector. Kafka Connect JSON produced by the Debezium Connector is not compatible with what the JDBC Sink Connector is expecting. Try changing a topic name. The JDBC Source connector is compatible with the JDBC Sink connector, and can be used as an alternative for a Debezium PostgreSQL source connector. | --- # Page 334: Create a JDBC Source Connector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-jdbc-source-connector.md --- # Create a JDBC Source Connector > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. You can use a JDBC Source connector to import batches of rows from MySQL, PostgreSQL, SQLite, and SQL Server relational databases into Redpanda topics. ## Prerequisites - Relational database instance that is accessible from the JDBC Source connector instance. - Database user has been created. ## Limitations The JDBC Source connector has the following limitations: - Only `JSON` or `AVRO` formats can be used as a value converter. - Only the following databases are supported: - MySQL 5.7 and 8.0 - PostgreSQL 8.2 and higher using the version 3.0 of the PostgreSQL® protocol - SQLite - SQL Server - Microsoft SQL versions: Azure SQL Database, Azure Synapse Analytics, Azure SQL Managed Instance, SQL Server 2014, SQL Server 2016, SQL Server 2017, SQL Server 2019 ## Create a JDBC Source connector To create the JDBC Source connector: 1. In Redpanda Cloud, click **Connectors** in the navigation menu, and then click **Create Connector**. 2. Select **Import from JDBC**. 3. On the **Create Connector** page, specify the following required connector configuration options: | Property name | Property key | Description | | --- | --- | --- | | `Topic prefix` | `topic.prefix` | Prefix to prepend to table names to generate the name of the Kafka topic to which to publish data, or in the case of a custom query, the full name of the topic to publish to. | | `JDBC URL` | `connection.url` | The database connection JDBC URL. | | `User` | `connection.user` | Name of the database user to be used when connecting to the database. | | `Password` | `connection.password` | Password of the database user to be used when connecting to the database. | | `Redpanda message value format` | `value.converter` | Format of the value in the Redpanda topic. `JSON` is the default. | | `Max Tasks` | `tasks.max` | Maximum number of tasks to use for this connector. The default is `1`. Each task replicates an exclusive set of partitions assigned to it. | | `Connector name` | `name` | Globally-unique name to use for this connector. | 4. Click **Next**. Review the connector properties specified, then click **Create**. ### Advanced JDBC Source connector configuration In most instances, the preceding basic configuration properties are sufficient. If you require additional property settings, then specify any of the following _optional_ advanced connector configuration properties by selecting **Show advanced options** on the **Create Connector** page: | Property name | Property key | Description | | --- | --- | --- | | `JDBC connection attempts` | `connection.attempts` | Maximum number of attempts to retrieve a valid JDBC connection. The default is `3`. | | `JDBC connection backoff (ms))` | `connection.backoff.ms` | Backoff time between connection attempts. The default is `10000`. | | `Kafka message key format` | `key.converter` | Format of the key in the Redpanda topic. `BYTES` is the default. | | `Kafka message headers format` | `header.converter` | Format of the headers in the Kafka topic. The default is `SIMPLE`. | | `Include tables` | `table.whitelist` | List of tables to include when copying. If specified, you cannot specify the `Exclude Tables` property. | | `Exclude tables` | `table.blacklist` | List of tables to exclude when copying. If specified, you cannot specify the `Include Tables` property. | | `Qualify table names` | `table.names.qualify` | Specifies whether or not to use fully-qualified table names when querying the database. If disabled, queries are performed with unqualified table names. This property may be useful if the database has been configured with a search path that automatically directs unqualified queries to the correct table when there are multiple tables available with the same unqualified name. | | `Catalog pattern` | `catalog.pattern` | Catalog pattern used to fetch table metadata from the database. `null` (default) means that the catalog name is not to be used to narrow the search to fetch all table metadata, regardless of the catalog. \`""\`retrieves those without a catalog. | | `Schema pattern` | `schema.pattern` | Schema pattern used to fetch table metadata from the database: `* ""` retrieves those without a schema. `* null` (default) specifies that the schema name is not to be used to narrow the search, so that all table metadata is fetched, regardless of the schema. | | `DB time zone` | `db.timezone` | Name of the JDBC timezone that should be used in the connector when querying with time-based criteria. Default is `UTC`. | | `Max rows per batch` | `batch.max.rows` | Maximum number of rows to include in a single batch when polling for new data. You can use this property to limit the amount of data buffered internally in the connector. The default is `100`. | | `Incrementing column name` | `incrementing.column.name` | The name of the strictly incrementing column to use to detect new rows. An empty value indicates the column should be autodetected by looking for an auto-incrementing column. This column cannot not be nullable. | | `Incrementing column initial value` | `incrementing.initial` | For the incrementing column, consider only the rows that have a value greater than this. Specify if you need to pick up rows with negative or zero value, or if you want to skip rows. The default is `-1`. To avoid excessive memory usage leading to a large data set, carefully select the initial value. | | `Table loading mode` | `mode` | The mode for updating a table each time it is polled. Options include:
- `bulk`: perform a bulk load of the entire table each time it is polled.
- `incrementing`: use a strictly incrementing column on each table to detect only new rows. Note that this does not detect modifications or deletions of existing rows.
- `timestamp`: use a timestamp (or timestamp-like) column to detect new and modified rows. Based on the assumption that the column is updated with each write, and that values are monotonically incrementing, but not necessarily unique.
- `timestamp+incrementing`: use two columns, a timestamp column that detects new and modified rows, and a strictly incrementing column, which provides a globally unique ID for updates so that each row can be assigned a unique stream offset. | | `Map Numeric Values, Integral or Decimal, By Precision and Scale` | `numeric.mapping` | Map `NUMERIC` values by precision and optionally scale to integral or decimal types:
- `none` (default): use if all `NUMERIC` columns are to be represented by Connect’s `DECIMAL` logical type. This may lead to serialization issues with Avro because Connect’s DECIMAL type is mapped to its binary representation
- `best_fit`: use if `NUMERIC` columns should be cast to Connect’s `INT8`, `INT16`, `INT32`, `INT64`, or `FLOAT64` based upon the column’s precision and scale. Is often preferred because it maps to the most appropriate primitive type.
- `precision_only`: use to map NUMERIC columns based only on the column’s precision (assuming that column’s scale is `0`). | | `Poll interval (ms)` | `poll.interval.ms` | Frequency used to poll for new data in each table. The default is `5000`. | | `Query` | `query` | Specifies the query to use to select new or updated rows. Use to join tables, select subsets of columns in a table, or to filter data. When specified, this connector will only copy data using this query, and whole-table copying will be disabled. Different query modes may still be used for incremental updates, but to properly construct the incremental query, it must be possible to append a `WHERE` clause to this query (that is, no `WHERE` clauses can be used). If you use a `WHERE` clause, it must handle incremental queries itself. | | `Quote SQL identifiers` | `sql.quote.identifiers` | Specifies whether or not to delimit (in most databases, a quote with double quotation marks) identifiers (for example, table names and column names) in SQL statements. | | `Metadata change monitoring interval (ms)` | `table.poll.interval.ms` | Frequency to poll for new or removed tables, which may result in updated task configurations to start polling for data in added tables, or stop polling for data in removed tables. The default is `60000`. | | `Table types` | `table.types` | By default, the JDBC connector only detects tables with type TABLE from the source Database. This property allows a command separated list of table types to extract. Options include: `TABLE` (default) `VIEW` `SYSTEM TABLE` `GLOBAL TEMPORARY` `LOCAL TEMPORARY` `ALIAS` `SYNONYM`. In most cases, it is best to specify `TABLE` or `VIEW`. | | `Timestamp column name` | `timestamp.column.name` | Comma separated list of one or more timestamp columns to detect new or modified rows using the `COALESCE SQL` function. Rows whose first non-null timestamp value is greater than the largest previous timestamp value seen aare discovered with each poll. At least one column should not be nullable. | | `Delay interval (ms)` | `timestamp.delay.interval.ms` | The amount of time to wait after a row with a certain timestamp appears before including it in the result. You can add a delay to allow transactions with earlier timestamp to complete. The first execution fetches all available records (that is, starting at a timestamp greater than `0`) until current time minus the delay. Every following execution will get data from the last time fetched until the current time, minus the delay. | | `Initial timestamp (ms) since epoch` | `timestamp.initial.ms` | The initial value of the timestamp when selecting records. Value can be negative. The records having a timestamp greater than the value are included in the result. To avoid excessive memory usage leading to a large data set, carefully select the initial timestamp. | | `Validate non null` | `validate.non.null` | By default, the JDBC connector validates that all incrementing and timestamp tables have `NOT NULL` set for the columns being used as their ID/timestamp. If the tables don’t, then the JDBC connector will fail to start. Setting to false disables these checks. | | `Database dialect` | `dialect.name` | The name of the database dialect that should be used for this connector. By default. the connector automatically determines the dialect based upon the JDBC connection URL. Use if you want to override that behavior and specify a specific dialect. | | `Topic creation enabled` | `topic.creation.enable` | Specifies whether or not to allow automatic creation of topics. Default is enabled. | | `Topic creation partitions` | `topic.creation.default. partitions` | Specifies the number of partitions for the created topics. The default is `1`. | | `Topic creation replication factor` | `topic.creation.default. replication.factor` | Specifies the replication factor for the created topics. The default is `-1`. | ## Map data Use the appropriate key or value converter (input data format) for your data as follows: - You can use Schema Registry as an alternative to the JSON schema. - Use `Kafka message value format` = `AVRO` (`io.confluent.connect.avro.AvroConverter`) to use Schema Registry with `AvroConverter`. Use the following properties to select the database data set to read from: - `Include tables` - `Exclude tables` - `Catalog pattern` - `Schema pattern` ## Test the connection After the connector is created, check to ensure that: - There are no errors in logs and in Redpanda Console. - Redpanda topics contain data from relational database tables. ## Troubleshoot Most JDBC Source connector issues are identified in the connector creation phase. Invalid `Include tables` are reported in logs. Select **Show Logs** to view error details. | Message | Action | | --- | --- | | **PSQLException: FATAL: database "invalid-database" does not exist** | Make sure the `JDBC URL` specifies an existing database name. | | **PSQLException: The connection attempt failed. for configuration Couldn’t open connection / PSQLException: Connection to postgres:1234 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections** | Make sure the `JDBC URL` specifies a valid database host name and port, and that the port is accessible. | | **PSQLException: FATAL: password authentication failed for user "postgres"** | Verify that the `User` and `Password` are correct. | | **IllegalArgumentException: Number of groups must be positive.** | 1. Make sure `Include tables` contains a valid tables list.
2. `Include tables` setting is case-sensitive, even though the underlying database isn’t. Revise `Include tables = tablename` to `Include Tables`: `tableName`.
3. Postgres occasionally refuses a connection for the first time. Retry creating the connector. | --- # Page 335: Create a MirrorMaker2 Checkpoint Connector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-mmaker-checkpoint-connector.md --- # Create a MirrorMaker2 Checkpoint Connector > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. You can use the MirrorMaker2 Checkpoint connector to import consumer group offsets from other Kafka clusters. ## Prerequisites - The external Kafka cluster is accessible. - A service account with read-only access to the external cluster is available. - The Kafka cluster topics connector is running for the same source cluster, with a matching configuration. ## Limitations The MirrorMaker2 Checkpoint connector does not migrate consumer group offsets that are lower than the highest offsets synced by the MirrorMaker2 Source connector by the time the MirrorMaker2 Checkpoint connector is started. ## Create a MirrorMaker2 Checkpoint connector To create the MirrorMaker2 Checkpoint connector: 1. In Redpanda Cloud, click **Connectors** in the navigation menu, and then click **Create Connector**. 2. Select **Import from Kafka cluster offsets**. 3. On the **Create Connector** page, specify the following required connector configuration options: | Property name | Property key | Description | | --- | --- | --- | | `Topics to replicate` | `topics` | Comma-separated topic names and regexes you want to replicate. | | `Source cluster broker list` | `source.cluster.bootstrap.servers` | A comma-separated list of host/port pairs to use for establishing the initial connection to the Kafka cluster. The client will make use of all servers regardless of which servers are specified here for bootstrapping. | | `Source cluster security protocol` | `source.cluster.security.protocol` | The protocol used to communicate with source brokers. The default is `PLAINTEXT`. | | `Source cluster SASL mechanism` | `source.cluster.sasl.mechanism` | SASL mechanism used for connections to source cluster. Default is `PLAIN`. | | `Source cluster SASL username` | `source.cluster.sasl.username` | SASL username used for connections to source cluster. | | `Source cluster SASL password` | `source.cluster.sasl.password` | SASL password used for connections to source cluster. | | `Groups` | `groups` | Consumer groups to replicate. Supports comma-separated group IDs and regexes. | | `Connector name` | `name` | Globally-unique name to use for this connector. | 4. Click **Next**. Review the connector properties specified, then click **Create**. ### Advanced MirrorMaker2 Checkpoint connector configuration In most instances, the preceding basic configuration properties are sufficient. If you require additional property settings, then specify any of the following _optional_ advanced connector configuration properties by selecting **Show advanced options** on the **Create Connector** page: | Property name | Property key | Description | | --- | --- | --- | | `Source cluster SSL custom certificate` | `source.cluster.ssl.truststore.certificates` | Trusted certificates in the PEM format. | | `Source cluster SSL keystore key` | `source.cluster.ssl.keystore.key` | Private key in the PEM format. | | `Source cluster SSL keystore certificate chain` | `source.cluster.ssl.keystore.certificate.chain` | Certificate chain in the PEM format. | | `Topics exclude` | `topics.exclude` | Excluded topics. Supports comma-separated topic names and regexes. | | `Source cluster alias` | `source.cluster.alias` | When using DefaultReplicationPolicy, topic names will be prefixed with it. | | `Replication policy class` | `replication.policy.class` | Class that defines the remote topic naming convention. Use IdentityReplicationPolicy to preserve topic names. DefaultReplicationPolicy prefixes the topic with the source cluster alias. | | `Emit checkpoints interval seconds` | `emit.checkpoints.interval.seconds` | Frequency of checkpoints. The default is `60`. | | `Sync group offsets enabled` | `sync.group.offsets.enabled` | Specifies whether or not to periodically write the translated offsets to the \_\_consumer_offsets topic in the target cluster, as long as no active consumers in that group are connected to the target cluster. | | `Sync group offsets interval seconds` | `sync.group.offsets.interval.seconds` | Frequency of consumer group offset sync. The default is `60`. | | `Refresh groups interval seconds` | `refresh.groups.interval.seconds` | Frequency of group refreshes. The default is `600`. | | `Offset-Syncs topic location` | `offset-syncs.topic.location` | The location (`source` or `target`) of the offset-syncs topic. The default is `source`. | | `Checkpoints topic replication factor` | `checkpoints.topic.replication.factor` | Replication factor for checkpoints topic. The default is `-1`. | ## Test the connection After the connector is created: - Ensure that there are no errors in logs and in Redpanda Console. - Wait for the Kafka cluster topics connector to catch up. Then check to confirm that the consumer groups are replicated. ## Use the Connectors API When using the Connectors API, instead of specifying a value for `source.cluster.sasl.username` and `source.cluster.sasl.password`, you can specify a value for `source.cluster.sasl.jaas.config`. ## Troubleshoot Most MirrorMaker2 Checkpoint connector issues are reported as a failed task at the time of creation. Select **Show Logs** to view error details. | Message | Action | | --- | --- | | **Connection to node -1 (/127.0.0.1:9092) could not be established. Broker may not be available. / LOGS: Timed out while checking for or creating topic 'mm2-offset-syncs.target.internal'. This could indicate a connectivity issue / TimeoutException: Timed out waiting for a node assignment** | Make sure broker URLs are correct and that the source cluster security protocol is correct. | | **SaslAuthenticationException: SASL authentication failed: security: Invalid credentials** | Check to confirm that the username and password specified are correct. | | **java.lang.IllegalArgumentException: No serviceName defined in either JAAS or Kafka config** | Check to confirm that the username and password specified are correct. | | **Client SASL mechanism 'PLAIN' not enabled in the server, enabled mechanisms are \[SCRAM-SHA-256, SCRAM-SHA-512\]** | Check to confirm that the respective `Source cluster SASL mechanism` is correct. | | **SaslAuthenticationException: SASL authentication failed: security: Invalid credentials** | Make sure the respective `Source cluster SASL mechanism` is correct (for example, SCRAM-SHA-256 instead of SCRAM-SHA-512). | | **terminated during authentication. This may happen due to any of the following reasons: (1) Authentication failed due to invalid credentials with brokers older than 1.0.0, (2) Firewall blocking Kafka TLS traffic (eg it may only allow HTTPS traffic), (3) Transient network issue** | Enable the SSL using `Source cluster security protocol` (specify `SSL` or `SASL_SSL`). | --- # Page 336: Create a MirrorMaker2 Heartbeat Connector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-mmaker-heartbeat-connector.md --- # Create a MirrorMaker2 Heartbeat Connector > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. You can use a MirrorMaker2 Heartbeat connector to generate heartbeat messages to a local cluster’s `heartbeat` topic. There are no prerequisites or limitations associated with this connector. ## Create a MirrorMaker2 Heartbeat connector To create the MirrorMaker2 Heartbeat connector: 1. In Redpanda Cloud, click **Connectors** in the navigation menu, and then click **Create Connector**. 2. Select **Import from Heartbeat**. 3. On the **Create Connector** page, specify the following required connector configuration options: | Property name | Property key | Description | | --- | --- | --- | | `Emit heartbeats interval seconds` | `emit.heartbeats.interval.seconds` | Frequency of heartbeats. The default is `1`. | | `Connector name` | `name` | Globally-unique name to use for this connector. | 4. Click **Next**. Review the connector properties specified, then click **Create**. ### Advanced MirrorMaker2 Heartbeat connector configuration In most instances, the preceding basic configuration properties are sufficient. If you require additional property settings, then specify any of the following _optional_ advanced connector configuration properties by selecting **Show advanced options** on the **Create Connector** page: | Property name | Property key | Description | | --- | --- | --- | | `Source cluster alias` | `source.cluster.alias` | Used to generate the heartbeat topic key. The default is `source`. | | `Target cluster alias` | `target.cluster.alias` | Used to generate the heartbeat topic key. The default is `target`. | | `Heartbeats topic replication factor` | `heartbeats.topic.replication.factor` | Replication factor for heartbeats topic. The default is `-1`. | ## Test the connection After the connector is created, check to ensure that: - There are no errors in logs and in Redpanda Console. - Check to confirm the `heartbeat` topic has heartbeat messages. --- # Page 337: Create a MirrorMaker2 Source Connector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-mmaker-source-connector.md --- # Create a MirrorMaker2 Source Connector > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. You can use a MirrorMaker2 Source connector to import messages from another Kafka cluster. You can also use it to: - Replicate messages from an external Kafka or Redpanda cluster. - Create topics on the local cluster, with a configuration matching external topics. - Replicate topic access-control lists (ACLs). ## Prerequisites - The external Kafka cluster must be accessible. - A service account with full access to the external cluster must be available. You can also use a service account with read-only ACLs when the `offset-syncs` topic location is set to `target`. You must have describe and/or describe-configs ACLs for the connector to read topic configurations on the source cluster and create the topics on the target cluster, unless you create the topics yourself. ## Limitations - ACLs are copied, but service accounts are not created. - Only topic ACLs are copied (group ACLs are not). - Only ACLs for topics matching the connector configuration are copied (write ACLs are not copied). - All permissions ACLs are downgraded to read-only. ## Create a MirrorMaker2 Source connector To create the MirrorMaker2 Source connector: 1. In Redpanda Cloud, click **Connectors** in the navigation menu, and then click **Create Connector**. 2. Select **Import from Kafka cluster topics**. 3. On the **Create Connector** form page, specify the following required connector configuration options: | Property name | Property key | Description | | --- | --- | --- | | `Regexes of topics to import` | `topics` | Comma-separated topic names and regexes you want to replicate. | | `Source cluster broker list` | `source.cluster.bootstrap.servers` | A comma-separated list of host/port pairs to use for establishing the initial connection to the Kafka cluster. The client will make use of all servers regardless of which servers are specified here for bootstrapping. This list only impacts the initial hosts used to discover the full set of servers, and should be in the form `host1:port1,host2:port2,...`. Because these servers are only used for the initial connection to discover the full cluster membership (which may change dynamically), it need not contain the full set of servers (you may want more than one, though, in case a server is down). | | `Source cluster security protocol` | `source.cluster.security.protocol` | The protocol to use to communicate with source brokers. Default is `PLAINTEXT`. | | `Source cluster SASL mechanism` | `source.cluster.sasl.mechanism` | SASL mechanism used for connections to source cluster. Default is `PLAIN`. | | `Source cluster SASL username` | `source.cluster.sasl.username` | SASL username used for connections to source cluster. | | `Source cluster SASL password` | `source.cluster.sasl.password` | SASL password used for connections to source cluster. | | `Sync topic configs enabled` | `sync.topic.configs.enabled` | Specifies whether to periodically configure remote topics to match their corresponding upstream topics. | | `Sync topic ACLs enabled` | `sync.topic.acls.enabled` | Specifies whether or not to periodically configure remote topic ACLs to match their corresponding upstream topics. | | `Connector name` | `name` | Globally-unique name to use for this connector. | 4. Click **Next**. Review the connector properties specified, then click **Create**. > 📝 **NOTE** > > Offsets are not guaranteed to match between the source and target. For example, if data-retention deletes occur on the source topic and the earliest offset is `#5000`, then when that event is created on the target topic the offset for that event will be `#0`. > > Events written on the target topic use the timestamp that was set on the source event. For example, if the source event has a timestamp `2023-05-22 17:00`, then this would also be the timestamp on the target event. ### Advanced MirrorMaker2 Source connector configuration In most instances, the preceding basic configuration properties are sufficient. If you require additional property settings, then specify any of the following _optional_ advanced connector configuration properties by selecting **Show advanced options** on the **Create Connector** page: | Property name | Property key | Description | | --- | --- | --- | | `Source cluster SSL custom certificate` | `source.cluster.ssl.truststore.certificates` | Trusted certificates in the PEM format. | | `Source cluster SSL keystore key` | `source.cluster.ssl.keystore.key` | Private key in the PEM format. | | `Source cluster SSL keystore certificate chain` | `source.cluster.ssl.keystore.certificate.chain` | Certificate chain in the PEM format. | | `Sync topic configs interval seconds` | `sync.topic.configs.interval.seconds` | Frequency of topic config sync. | | `Sync topic ACLs interval seconds` | `sync.topic.acls.interval.seconds` | Frequency of topic ACL sync. | | `Topics exclude` | `topics.exclude` | Excluded topics. Supports comma-separated topic names and regexes. | | `Source cluster alias` | `source.cluster.alias` | When using DefaultReplicationPolicy, topic names will be prefixed with it. | | `Replication policy class` | `replication.policy.class` | Class that defines the remote topic naming convention. Use IdentityReplicationPolicy to preserve topic names. DefaultReplicationPolicy prefixes the topic with the source cluster alias. | | `Replication factor` | `replication.factor` | Replication factor for newly created remote topics. Set -1 for cluster default. | | `Refresh topics interval seconds` | `refresh.topics.interval.seconds` | Frequency of topic refresh. | | `Offset-Syncs topic location` | `offset-syncs.topic.location` | The location (`source` or `target`) of the offset-syncs topic. The default is `source`. | | `Offset-Syncs topic replication factor` | `offset-syncs.topic.replication.factor` | Replication factor for offset-syncs topic. The default is `-1`. | | `Config properties exclude` | `config.properties.exclude` | Topic config properties that should not be replicated. Supports comma-separated property names and regexes. | | `Compression type` | `producer.override.compression.type` | The compression type for all data generated by the producer. The default is none (no compression). | | `Max size of a request` | `producer.override.max.request.size` | The maximum size of a request in bytes. The default is 1048576. | | `Auto offset reset` | `consumer.auto.offset.reset` | What to do when there is no initial offset in Kafka, or if the current offset does not exist any more on the server (for example, because that data has been deleted). 'earliest' - automatically reset the offset to the earliest offset. 'latest' - automatically reset the offset to the latest offset. 'none' - throw exception to the consumer if no previous offset is found for the consumer’s group. | | `Offset lag max` | `offset.lag.max` | How out-of-sync a remote partition can be before it is resynced. This setting impacts the MirrorMaker2 Checkpoint connector as it is the maximum lag for syncing consumer groups. The default is 100 records. | ## Map data The value converter does not require any schema; it copies data as bytes. ## Test the connection After the connector is created: - Ensure that there are no errors in logs and in Redpanda Console. - Confirm that Redpanda topics are being replicated. You should see messages coming into the topics. ## Use the Connectors API When using the Connectors API, instead of specifying a value for `source.cluster.sasl.username` and `source.cluster.sasl.password`, you can specify a value for `source.cluster.sasl.jaas.config`. ## Troubleshoot Most MirrorMaker2 Source connector issues are reported as a failed task at the time of creation. Select **Show Logs** to view error details. | Message | Action | | --- | --- | | **Connection to node -1 (/127.0.0.1:9092) could not be established. Broker may not be available. / LOGS: Timed out while checking for or creating topic 'mm2-offset-syncs.target.internal'. This could indicate a connectivity issue / TimeoutException: Timed out waiting for a node assignment** | Make sure broker URLs are correct and that the `security.protocol` is correct. | | **SaslAuthenticationException: SASL authentication failed: security: Invalid credentials** | Confirm that the username and password specified are correct. | | **Terminated during authentication. This may happen due to any of the following reasons: (1) Authentication failed due to invalid credentials with brokers older than 1.0.0, (2) Firewall blocking Kafka TLS traffic (eg it may only allow HTTPS traffic), (3) Transient network issue** | Error indicates that the SSL should be enabled using `Source cluster security protocol` (use `SSL` or `SASL_SSL`). | | **RecordTooLargeException: The message is N bytes (…​)** | Use `producer.override.max.request.size` property to change max request size. | | **RecordTooLargeException: The request included (…​)** | The target server is not able to receive messages because it is too large in size. Disabled compression can be a root cause. Consider enabling compression: `"Compression type": "snappy",` | | **Scheduler for MirrorSourceConnector caught exception in scheduled task: syncing topic ACLs** | MirrorMaker2 requires an authorizer to be configured by the broker side, but it is not. Change the `Sync topic ACLs enabled` MirrorMaker2 property to `false` (default is `true`) to disable ACL syncing. | | **TopicAuthorizationException: Topic authorization failed** | Confirm the service account for the source cluster contains describe and/or describe-configs ACLs. | | **OffsetOutOfRangeException Fetch position FetchPosition{offset=0, …​ \]** | If the 0 offset for your topic does not exist in the source cluster, set `Auto offset reset` to either `earliest` or `latest`. | --- # Page 338: Create a MongoDB Sink Connector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-mongodb-sink-connector.md --- # Create a MongoDB Sink Connector > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. The MongoDB Sink managed connector exports Redpanda structured data to a MongoDB database. ## Prerequisites - Valid credentials with the `readWrite` role to access the MongoDB database. For more granular access, you need to allow `insert`, `remove` and `update` actions for specific databases or collections. ## Limitations If you want to use the MongoDB sink connector with the `MongoDB` CDC handler for data sourced from MongoDB (using the MongoDB source connector), you must select `STRING` or `BYTES` as the value converter for both the source and sink connectors. ## Create a MongoDB Sink connector To create a MongoDB Sink connector: 1. In Redpanda Cloud, click **Connectors** in the navigation menu, and then click **Create Connector**. 2. Select **Export to MongoDB Sink**. 3. On the **Create Connector** page, specify the following required connector configuration options: | Property name | Property key | Description | | --- | --- | --- | | `Topics to export` | `topics` | A comma-separated list of the cluster topics you want to export to MongoDB. | | `Topics regex` | `topics.regex` | Java regular expression of topics to replicate. For example: specify `.*` to replicate all available topics in the cluster. Applicable only when **Use regular expressions** is selected. | | `MongoDB Connection URL` | `connection.url` | The MongoDB connection URI string to connect to your MongoDB instance or cluster. For example, `mongodb://locahost/`. | | `MongoDB username` | `connection.username` | A valid MongoDB user. | | `MongoDB password` | `connection.password` | The password for the account associated with the MongoDB user. | | `MongoDB database name` | `database` | The name of an existing MongoDB database to store output files in. | | `Kafka message key format` | `key.converter` | Format of the key in the Redpanda topic. Default is `STRING`. | | `Kafka message value format` | `value.converter` | Format of the value in the Redpanda topic. Default is `STRING`. | | `Default MongoDB collection name` | `collection` | (_Optional_). Single sink collection name to write to. If following multiple topics, then this will be the default collection to which they are mapped. | | `Max Tasks` | `tasks.max` | Maximum number of tasks to use for this connector. The default is `1`. Each task replicates exclusive set of partitions assigned to it. | | `Connector name` | `name` | Globally-unique name to use for this connector. | 4. Click **Next**. Review the connector properties specified, then click **Create**. ### Advanced MongoDB Sink connector configuration In most instances, the preceding basic configuration properties are sufficient. If you require additional property settings, then specify any of the following _optional_ advanced connector configuration properties by selecting **Show advanced options** on the **Create Connector** page: | Property name | Property key | Description | | --- | --- | --- | | `CDC handler` | `change.data.capture.handler` | The CDC (change data capture) handler to use for processing. The MongoDB handler requires plain JSON or BSON format. The default is `NONE`. | | `Key projection type` | `key.projection.type` | The type of key projection to use: either `AllowList` or `BlockList`. | | `Key projection list` | `key.projection.list` | A comma-separated list of field names for key projection. | | `Value projection type` | `value.projection.type` | Only use with `Value projection list`. The type of value projection to use: `AllowList` or `BlockList`. The default is `NONE`. | | `Value projection list` | `value.projection.list` | A comma-separated list of field names for value projection. | | `Field renamer mapping` | `field.renamer.mapping` | An inline JSON array with objects describing field name mappings. For example: `[{"oldName":"key.fieldA","newName":"field1"},{"oldName":"value.xyz","newName":"abc"}]`. | | `Field used for time` | `timeseries.timefield` | Name of the top level field used for time. Inserted documents _must_ specify this field, and it must be of the `BSON datetime` type. | | `Field describing the series` | `timeseries.metafield` | The name of the top-level field that contains metadata in each time series document. The metadata in the specified field should be data that is used to label a unique series of documents. The metadata should rarely, if ever, change. This field is used to group related data and may be of any `BSON` type, except for array. The metadata field may not be the same as the `timeField` or `_id`. | | `Convert the field to a BSON datetime type` | `timeseries.timefield.auto.convert` | Converts the timeseries field to a `BSON datetime` type. If the value is a numeric value it will use the milliseconds from epoch. Any fractional parts are discarded. If the value is a `STRING` it will use the `timeseries.timefield.auto.convert.date.format` property to parse the date. | | `DateTimeFormatter pattern for the date` | `timeseries.timefield.auto.convert .date.format` | The DateTimeFormatter pattern to use when converting string dates. Defaults to support ISO style date times. A string is expected to contain both the date and time. If the string only contains date information, then the time since epoch is taken from the start of that day. If a string representation does not contain a timezone offset, then the extracted date and time is interpreted as UTC. | | `Data expiry time in seconds` | `timeseries.expire.after.seconds` | The amount of time in seconds that the data will be kept in MongoDB before being automatically deleted. | | `Data expiry time` | `timeseries.granularity` | The expected interval between subsequent measurements for a time series. Possible values are `"seconds"`, `"minutes"` or `"hours"`. | | `Error tolerance` | `errors.tolerance` | Error tolerance response during connector operation. Default value is `none` and signals that any error will result in an immediate connector task failure. Value of `all` changes the behavior to skip over problematic records. | | `Dead letter queue topic name` | `errors.deadletterqueue.topic.name` | The name of the topic to be used as the dead letter queue (DLQ) for messages that result in an error when processed by this sink connector, its transformations, or converters. The topic name is blank by default, which means that no messages are recorded in the DLQ. | | `Dead letter queue topic replication factor` | `errors.deadletterqueue.topic .replication.factor` | Replication factor used to create the dead letter queue topic when it doesn’t already exist. | | `Enable error context headers` | `errors.deadletterqueue.context .headers.enable` | When `true`, adds a header containing error context to the messages written to the dead letter queue. To avoid clashing with headers from the original record, all error context header keys, start with `__connect.errors`. | ## Map data Use the appropriate key or value converter (input data format) for your data as follows: - `JSON` (`org.apache.kafka.connect.json.JsonConverter`) when your messages are structured JSON. Select `Message JSON contains schema`, with the `schema` and `payload` fields. - `AVRO` (`io.confluent.connect.avro.AvroConverter`) when your messages contain AVRO-encoded messages, with schema stored in the Schema Registry. - `STRING` (`org.apache.kafka.connect.storage.StringConverter`) when your messages contain plaintext JSON. - `BYTES` (`org.apache.kafka.connect.converters.ByteArrayConverter`) when your messages contain BSON. ## Test the connection After the connector is created, verify that your new collections apper in your MongoDB database: ``` show collections ``` ## Use the Connectors API When using the Connectors API, instead of specifying a value for `connection.url`, `connection.username`, and `connection.password`, you can specify a value for `connection.uri` in the form `mongodb+srv://username:password@cluster0.xxx.mongodb.net`. ## Troubleshoot Issues are reported using a failed task error message. Select **Show Logs** to view error details. | Message | Action | | --- | --- | | **Invalid value wrong_uri for configuration connection.uri: The connection string is invalid. Connection strings must start with either 'mongodb://' or 'mongodb+srv://** | Check to make sure the `Connection URI` is a valid MongoDB URL. | | **Unable to connect to the server.** | Check to ensure that the `Connection URI` is valid and that the MongoDB server accepts connections. | | **Invalid user permissions authentication failed. Exception authenticating MongoCredential{mechanism=SCRAM-SHA-1, userName='user', source='admin', password=, mechanismProperties=}**. | Check to ensure that you specified valid username and password credentials. | | **DataException: Could not convert key into a BsonDocument.** | Make sure your message keys are valid JSONs or skip configuration for fields that require valid JSON keys. | | **DataException: Error: `operationType` field doc is missing.** | Make sure the input record format is correct (produced by a MongoDB source connector if you use MongoDB CDC handler). | | **DataException: Value document is missing or CDC operation is not a string** | Make sure the input record format is correct (produced by a Debezium source connector if you use Debezium CDC handler). | | **JsonParseException: Unrecognized token 'text': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')** | Make sure the input record format is JSON. | | **Unexpected documentKey field type, expecting a document but found `BsonString…​`: {…​}** | Make sure the source data is in the plain JSON or BSON format (value converter `STRING` or `BYTES`). | ## Suggested reading - [MongoDB Kafka Sink Connector](https://www.mongodb.com/docs/kafka-connector/current/sink-connector/) --- # Page 339: Create a MongoDB Source Connector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-mongodb-source-connector.md --- # Create a MongoDB Source Connector > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. The MongoDB Source managed connector imports collections from a MongoDB database into Redpanda topics. ## Prerequisites - Valid credentials with the `read` role to access the MongoDB database. For more granular access, you need to allow `find` and `changeStream` actions for specific databases or collections. ## Create a MongoDB Source connector To create a MongoDB Source connector: 1. In Redpanda Cloud, click **Connectors** in the navigation menu, and then click **Create Connector**. 2. Select **Import from MongoDB**. 3. On the **Create Connector** page, specify the following required connector configuration options: | Property name | Property key | Description | | --- | --- | --- | | `Topic prefix` | `topic.prefix` | Prefix to prepend to database and collection names to generate the name of the Kafka topic to which to publish data. Used by the `DefaultTopicMapper`. | | `MongoDB Connection URL` | `connection.url` | The MongoDB connection URL string as supported by the official drivers. For example, `mongodb://locahost/`. | | `MongoDB username` | `connection.username` | A valid MongoDB user. | | `MongoDB password` | `connection.password` | The password for the account associated with the MongoDB user. | | `Database to watch` | `database` | The MongoDb database from which the connector imports data into Redpanda topics. The connector monitors changes in this database. Leave the field empty to watch all databases. | | `Kafka message key format` | `key.converter` | Format of the key in the Redpanda topic. Default is `STRING`. Use `AVRO` or `JSON` for schematic output, `STRING` for plain JSON, or `BYTES` for BSON. | | `Kafka message value format` | `value.converter` | Format of the value in the Redpanda topic. Default is `STRING`. Use `AVRO` or `JSON` for schematic output, `STRING` for plain JSON, or `BYTES` for BSON. | | `Collection to watch` | `collection` | The collection in the MongoDB database to watch. If not set, then all collections are watched. | | `Start up behavior when there is no source offset available` | `startup.mode` | Specifies how the connector should start up when there is no source offset available. Resuming a change stream requires a resume token, which the connector stores as reads from the source offset. If no source offset is available, the connector may either ignore all or some existing source data, or may at first copy all existing source data and then continue with processing new data. Possible values are:
- `latest` (default): The connector creates a new change stream, processes change events from it and stores resume tokens from them, thus ignoring all existing source data.
- `timestamp`: actuates `startup.mode.timestamp.*` properties. If no such properties are configured, then `timestamp` is equivalent to `latest`.
- `copy_existing`: actuates `startup.mode.copy.existing.*` properties. The connector creates a new change stream and stores its resume token, copies all existing data from all the collections being used as the source, then processes new data starting from the stored resume token. Note that reads of all the data during the copy and subsequent change stream events may produce duplicated events. During the copy, clients can make changes to the source data, which may be represented both by the copying process and the change stream. However, as the change stream events are idempotent, it’s possible to apply them multiple times with the same effect as if they were applied once. Renaming a collection during the copying process is not supported. | | `Connector name` | `name` | Globally-unique name to use for this connector. | 4. Click **Next**. Review the connector properties specified, then click **Create**. ### Advanced MongoDB Source connector configuration In most instances, the preceding basic configuration properties are sufficient. If you require additional property settings, then specify any of the following _optional_ advanced connector configuration properties by selecting **Show advanced options** on the **Create Connector** page: | Property name | Property key | Description | | --- | --- | --- | | `Enable Infer Schemas for the value` | `output.schema.infer.value` | Specifies whether or not to infer the schema for the value. Each Document is processed in isolation, which may lead to multiple schema definitions for the data. Only enable when Kafka message value format is set to `AVRO` or `JSON`. | | `startAtOperationTime` | `startup.mode.timestamp .start.at.operation.time` | Actuated only if `startup.mode = timestamp` specifies the starting point for the change stream. Must be either an integer number of seconds because the Epoch is in the decimal format (for example: `30`), or an instant in the ISO-8601 format with one second precision (for example: `1970-01-01T00:00:30Z`), or a BSON timestamp in the canonical extended JSON (v2) format (for example: `{"$timestamp": {"t": 30, "i": 0}}`). You can specify `0` to start at the beginning of the oplog. Requires MongoDB 4.0 or above. For more detail, see the [$changeStream definition](https://www.mongodb.com/docs/current/reference/operator/aggregation/changeStream/). | | `Copy existing namespace regex` | `startup.mode.copy.existing .namespace.regex` | Use a regular expression to define which existing namespaces data should be copied from. A namespace is the database name and collection, separated by a period (for example, `database.collection`). **Example:** The following regular expression only includes collections starting with `a` in the `demo` database: `demo\.a.*`. | | `Copy existing initial pipeline` | `startup.mode.copy.existing .pipeline` | An inline JSON array with objects describing the pipeline operations to run when copying existing data. Specifying this property can improve the use of indexes by the copying manager and make copying more efficient. Use this property if there is any filtering of collection data in the `pipeline` configuration to speed up the copying process. For example: `[{"$match": {"closed": "false"}}]`. | | `Pipeline to apply to the change stream` | `pipeline` | An inline JSON array with objects describing the pipeline operations to run. For example: `[{"$match": {"operationType": "insert"}}, {"$addFields": {"Kafka": "Rules!"}}]`. | | `fullDocument` | `change.stream.full.document` | Specifies what to return for update operations when using a change stream. When set to `updateLookup`, the change stream for partial updates will include both a delta describing the changes to the document, and a copy of the entire document that was changed _ at some point_ after the change occurred. See [db.collection.watch](https://www.mongodb.com/docs/manual/reference/method/db.collection.watch/) for more detail. | | `fullDocumentBeforeChange` | `change.stream.full.document .before.change` | Specifies the pre-image configuration when creating a change stream. The pre-image is not available in source records published while copying existing data as a result of enabling `copy.existing`. The pre-image configuration has no effect on copying. Requires MongoDB 6.0 or above. For details, see [possible values](https://www.mongodb.com/docs/manual/reference/method/db.collection.watch/). | | `Publish only the fullDocument` | `publish.full.document.only` | When enabled, only publishes the actual changed document (rather than the full change stream document). Automatically sets `change.stream.full.document=updateLookup` so updated documents will be included. | | `Send a null value on a delete event` | `publish.full.document.only .tombstone.on.delete` | When enabled, requires `publish.full.document.only=true`. Default is `false` (disabled). | | `Error tolerance` | `mongo.errors.tolerance` | Error tolerance response during connector operation. Default value is `none` and signals that any error will result in an immediate connector task failure. Value of `all` changes the behavior to skip over problematic records. | | `Heartbeat interval milliseconds` | `heartbeat.interval.ms` | The length of time it takes when sending heartbeat messages to record the post-batch resume token when no source records have been published. Improves the resumability of the connector for low volume namespaces. Specify `0` to disable. | | `heartbeat topic name` | `heartbeat.topic.name` | The name of the topic to publish heartbeats to. Defaults to `__mongodb_heartbeats`. | | `Offset partition name` | `offset.partition.name` | Use to specify a custom offset partition name. If blank, the default partition name based on the connection details is used. | | `Topic creation enabled` | `topic.creation.enable` | Specifies whether or not to allow automatic creation of topics. Default is `true`. | | `Topic creation partitions` | `topic.creation.default. partitions` | Specifies the number of partitions for the created topics. The default is `1`. | | `Topic creation replication factor` | `topic.creation.default. replication.factor` | Specifies the replication factor for the created topics. The default is `-1`. | ## Map data - `AVRO` (`io.confluent.connect.avro.AvroConverter`) or `JSON` (`org.apache.kafka.connect.json.JsonConverter`) for output with a preset schema. Additionally, you can set `Enable Infer Schemas` for the value. Each document will be processed in isolation, which may lead to multiple schema definitions for the data. - `STRING` (`org.apache.kafka.connect.storage.StringConverter`) when your messages contain plaintext JSON. - `BYTES` (`org.apache.kafka.connect.converters.ByteArrayConverter`) when your messages contain BSON. After the connector is created, check to ensure that: - There are no errors in logs and in Redpanda Console. - Redpanda topics contain data from relational database tables. ## Use the Connectors API When using the Connectors API, instead of specifying a value for `connection.url`, `connection.username`, and `connection.password`, you can specify a value for `connection.uri` in the form `mongodb+srv://username:password@cluster0.xxx.mongodb.net`. ## Troubleshoot Most MongoDB Source connector issues are identified in the connector creation phase. Invalid Include Tables are reported in logs. Select **Show Logs** to view error details. | Message | Action | | --- | --- | | **Invalid value wrong_uri for configuration connection.uri: The connection string is invalid. Connection strings must start with either 'mongodb://' or 'mongodb+srv://** | Check to make sure the `MongoDB Connection URL` is a valid MongoDB URL. | | **Unable to connect to the server.** | Check to ensure that the `MongoDB Connection URL` is valid and that the MongoDB server accepts connections. | | **Invalid user permissions authentication failed. Exception authenticating MongoCredential{mechanism=SCRAM-SHA-1, userName='user', source='admin', password=, mechanismProperties=}**. | Check to ensure that you specified valid username and password credentials. | | **MongoCommandException: Command failed with error 8000 (AtlasError): 'user is not allowed to do action \[find\] on \[db1.characters\]' on server ac-nboibsg-shard-00-01.4hagsz0.mongodb.net:27017. The full response is {"ok": 0, "errmsg": "user is not allowed to do action \[find\] on \[db1.characters\]", "code": 8000, "codeName": "AtlasError"}** | Check the permissions of the MongoDB user. Also confirm that the MongoDB server accepts connections. | | **Command failed with error 286 (ChangeStreamHistoryLost): 'PlanExecutor error during aggregation :: caused by :: Resume of change stream was not possible, as the resume point may no longer be in the oplog** | See [Troubleshoot invalid resume token](https://www.mongodb.com/docs/kafka-connector/master/troubleshooting/recover-from-invalid-resume-token/#std-label-kafka-troubleshoot-invalid-resume-token) | ## Suggested reading - [MongoDB Kafka Source Connector](https://www.mongodb.com/docs/kafka-connector/current/source-connector/) --- # Page 340: Create a MySQL (Debezium) Source Connector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-mysql-source-connector.md --- # Create a MySQL (Debezium) Source Connector > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. You can use a MySQL (Debezium) Source connector to import a stream of changes from MySQL, AmazonRDS, and Amazon Aurora. ## Prerequisites - A MySQL database that is accessible from the connector instance. - A MySQL user exists. This database user for the Debezium connector must have LOCK TABLES privileges. For details, see [MySQL Creating a user](https://debezium.io/documentation/reference/stable/connectors/mysql.html#mysql-creating-user). - A [binlog must be enabled](https://debezium.io/documentation/reference/stable/connectors/mysql.html#enable-mysql-binlog) for the source MySQL cluster. ## Limitations - Only `JSON`, `CloudEvents` or `AVRO` formats can be used as a a Kafka message key and value format. - The MySQL (Debezium) Source connector can work with only a single task at a time. ## Create a MySQL (Debezium) Source connector To create the MySQL (Debezium) Source connector: 1. In Redpanda Cloud, click **Connectors** in the navigation menu, and then click **Create Connector**. 2. Select **Import from MySQL (Debezium)**. 3. On the **Create Connector** page, specify the following required connector configuration options: | Property name | Property key | Description | | --- | --- | --- | | `Topic prefix` | `topic.prefix` | A topic prefix that identifies and provides a namespace for the particular database server/cluster that is capturing changes. The topic prefix should be unique across all other connectors because it is used as a prefix for all Kafka topic names that receive events emitted by this connector. Only alphanumeric characters, hyphens, dots, and underscores are accepted. | | `Hostname` | `database.hostname` | A resolvable hostname or IP address of the MySQL database server. | | `Port` | `database.port` | Integer port number of the MySQL database server. | | `User` | `database.user` | Name of the MySQL user to be used when connecting to the MySQL database. | | `Password` | `database.password` | The password of the MySQL database user who will be connecting to the MySQL database. | | `SSL mode` | `database.ssl.mode` | Specifies whether to use an encrypted connection to the MySQL server. Select `disable` to use an unencrypted connection. Select 'preferred' to use an encrypted connection if the server supports secure connections. If the server does not support secure connections, falls back to an unencrypted connection. Select `require` to use a secure, or encrypted connection. If a secure connection cannot be established when `required` is selected, then the connector fails. | | `Kafka message key format` | `key.converter` | Format of the key in the Redpanda topic. | | `Message key JSON contains schema` | `key.converter.schemas.enable` | Enable to specify that the message key contains schema in the schema field. | | `Kafka message value format` | `value.converter` | Format of the value in the Redpanda topic. | | `Message value JSON contains schema` | `value.converter.schemas.enable` | Enable to specify that the message value contains schema in the schema field. | | `Connector name` | `name` | Globally-unique name to use for this connector. | 4. Click **Next**. Review the connector properties specified, then click **Create**. ## Map data Use `Include databases`, `Include tables`, and `Include columns` to define data mapping. Alternatively, use `Exclude databases`, `Exclude tables`, and `Exclude columns`. Following is an example table in `db` database: ```sql CREATE TABLE IF NOT EXISTS Persons ( Id int PRIMARY KEY, FirstName varchar(255), LastName varchar(255) ); ``` The table has one record: ```sql INSERT INTO Persons (FirstName, LastName) VALUES (1, 'Winnie', 'the Pooh'); ``` The connector configuration for the table: ```bash column.include.list = db\\.Persons\\.(Id|FirstName|LastName) table.include.list = db\\.Persons database.include.list = db topic.prefix = frommysql ``` The connector configuration will create the Redpanda topic `frommysql.db.Persons`. For `Kafka message value format` = `JSON` (`org.apache.kafka.connect.json.JsonConverter`), the connector produces JSON messages with a schema like the following: ```json { "payload": { "schema": { // schema definition }, "payload": { "before": null, "after": { "Id": 1, "FirstName": "Winnie", "LastName": "the Pooh" }, ... } }, "encoding": "json", "schemaId": 0 } ``` For `Kafka message value format` = `AVRO` (`io.confluent.connect.avro.AvroConverter`), the connector creates a Schema Registry `frommysql.db.Persons-value` record and produces messages like the following: ```js { "payload": { "before": null, "after": { "mysql.db.Persons.Value": { "Id": 1, "FirstName": { "string": "Winnie" }, "LastName": { "string": "the Pooh" } } }, ... }, "encoding": "avro", "schemaId": 2 } ``` For `Kafka message value format` = `CloudEvents` (`io.debezium.converters.CloudEventsConverter`), the connector uses `JSON` or `AVRO` data serializer. - For `JSON` data serializer, enable `Message value CloudEvents JSON contains schema` to include JSON schema in message - For `AVRO` data serializer, connector creates schema in Schema Registry and produces messages in CloudEvents data format. ## Test the connection After the connector is created: - Check the connector status and confirm that there are no errors in logs and in Redpanda Console. - Review the Redpanda topic to confirm that it contains the expected data. ## Troubleshoot If the connector configuration is invalid, an error appears upon clicking **Finish**. If the connector fails, check the error message or select **Show Logs** to view error details. - **Topics not created by the connector** Create the topic manually or let the connector create it by setting (use desired number of partitions and replication factor): ``` Topic creation enabled: true Topic creation partitions: 1 Topic creation replication factor: -1 ``` Or in JSON: ```json "topic.creation.enable": true, "topic.creation.default.partitions": "1", "topic.creation.default.replication.factor": "-1" ``` - **Connector requires binlog file 'mysql-bin-changelog.257116', but MySQL only has mysql-bin-changelog.257123** ``` Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted" Connector requires binlog file 'mysql-bin-changelog.257116', but MySQL only has mysql-bin-changelog.257123, mysql-bin-changelog.257124, mysql-bin-changelog.257125 ``` The connector needs a binlog file that was already purged. Change the `Snapshot mode` property from the default to `when_needed`. Additional errors and corrective actions follow. | Message | Action | | --- | --- | | **Unable to connect: Public Key Retrieval is not allowed** | Set `Allow public key retrieval` property to `true`. | | **Unable to connect: Communications link failure** | Confirm that `Hostname` and `Port` are correct. | | **Access denied for user** | Confirm that `User` and `Password` credentials are valid. | | **Caused by: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Invalid schema Invalid namespace: from-mysql.db.Persons; error code: 422** | The Schema Registry namespace is incorrect. Consider changing the `Topic prefix` value, remove unallowed characters. | ## Suggested reading - [Debezium connector for MySQL](https://debezium.io/documentation/reference/stable/connectors/mysql.html) --- # Page 341: Create a PostgreSQL (Debezium) Source Connector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-postgresql-connector.md --- # Create a PostgreSQL (Debezium) Source Connector > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. You can use a PostgreSQL (Debezium) Source connector to import updates to Redpanda from PostgreSQL. ## Prerequisites Before you can create a PostgreSQL (Debezium) Source connector in the Redpanda Cloud, you must: - [Make the PostgreSQL (Debezium) database accessible](https://debezium.io/documentation/reference/stable/connectors/postgresql.html#postgresql-security) from connectors instance. - [Create a PostgreSQL (Debezium) user](https://debezium.io/documentation/reference/stable/connectors/postgresql.html#postgresql-permissions) with the necessary permissions. ## Limitations The PostgreSQL (Debezium) Source connector has the following limitations: - Only `JSON`, `CloudEvents` or `AVRO` formats can be used for a Kafka message key and value format. - PostgreSQL (Debezium) connector can work with only a single task at a time. ## Create a PostgreSQL (Debezium) Source connector To create the PostgreSQL (Debezium) Source connector: 1. In Redpanda Cloud, click **Connectors** in the navigation menu, and then click **Create Connector**. 2. Select **Import from PostgreSQL (Debezium)**. 3. On the **Create Connector** page, specify the following required connector configuration options: | Property name | Property key | Description | | --- | --- | --- | | `Topic prefix` | `topic.prefix` | A topic prefix that identifies and provides a namespace for the particular database server/cluster that is capturing changes. The topic prefix should be unique across all other connectors because it is used as a prefix for all Kafka topic names that receive events emitted by this connector. Only alphanumeric characters, hyphens, dots, and underscores are accepted. | | `Hostname` | `database.hostname` | A resolvable hostname or IP address of the PostgreSQL database server. | | `Port` | `database.port` | Integer port number of the PostgreSQL database server. | | `User` | `database.user` | Name of the PostgreSQL user to be used when connecting to the PostgreSQL database. | | `Password` | `database.password` | The password of the PostgreSQL database user who will be connecting to the PostgreSQL database. | | `Database` | `database.dbname` | The name of the database from which the connector will import changes. | | `SSL mode` | `database.sslmode` | Specifies whether to use an encrypted connection to the PostgreSQL server. Select `disable` to use an unencrypted connection. Select `require` to use a secure, or encrypted connection. If a secure connection cannot be established when `required` is selected, then the connector fails. | | `Kafka message key format` | `key.converter` | Format of the key in the Redpanda topic. | | `Message key JSON contains schema` | `key.converter.schemas.enable` | Enable to specify that the message key contains schema in the schema field. | | `Kafka message value format` | `value.converter` | Format of the value in the Redpanda topic. | | `Message value JSON contains schema` | `value.converter.schemas.enable` | Enable to specify that the message value contains schema in the schema field. | | `Connector name` | `name` | Globally-unique name to use for this connector. | 4. Click **Next**. Review the connector properties specified, then click **Create**. ## Map data Use the appropriate key or value converter (input data format) for your data as follows: - Use `Include Schemas`, `Include Tables` and `Include Columns` properties to define lists of columns, tables, and schemas to read from. Alternatively, use `Exclude Schemas`, `Exclude Tables`, and `Exclude Columns` to define lists of columns, tables, and schemas to exclude from sources list. - Use only `JSON` (`org.apache.kafka.connect.json.JsonConverter`), `AVRO` (`io.confluent.connect.avro.AvroConverter`) and `CloudEvents` (`io.debezium.converters.CloudEventsConverter`) formats for the Kafka message key and value format. ## Test the connection After the connector is created: 1. Open Redpanda Console, click the **Topics** tab and select a topic. Check to check to confirm that it contains data migrated from PostgreSQL. Alternatively, use the `rpk consume` to check the topic. 2. Click the **Connectors** tab to confirm no issues have been reported for the connector. ## Troubleshoot If the connector configuration is invalid, an error appears upon clicking **Finish**. Select **Show Logs** to view error details. Additional errors and corrective actions follow. | Message | Action | | --- | --- | | **Missing tables or topics** | The Debezium connector replicates tables one by one. Wait for other tables to be replicated. If the database is quite large, then replication takes longer to complete. | | **non-existing-db** | Make sure the provided database name in `Database` is correct, and that the database exists. | | **The connection attempt failed / Connection to postgres:9999 refused** | Check to make sure that `hostname` and `port` are correct. | | **Password authentication failed for user** | Make sure that the `User` and `Password` credentials are valid. | | **The Plugin name value is invalid** | Make sure that `Plugin` contains a [valid value](https://debezium.io/documentation/reference/stable/connectors/postgresql.html#postgresql-property-plugin-name), either `decoderbufs` or `pgoutput`. | | **Postgres server `wal_level` property is `replica`** | Specify `wal_level` as `logical` for your database. | | **RecordTooLargeException: The message is 1050766 bytes when serialized, which is larger than 1048576, the value of the max.request.size configuration.** | Increase the max request size to unblock the connector and allow large messages to pass: `"producer.override.max.request.size": "209715200".` The connector may be reaching memory limits and failing if the amount of data to pass or your messages are too large. | ## Suggested reading - [Debezium connector for PostgreSQL](https://debezium.io/documentation/reference/stable/connectors/postgresql.html) --- # Page 342: Create an S3 Sink Connector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-s3-sink-connector.md --- # Create an S3 Sink Connector > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. The Amazon S3 Sink connector exports Apache Kafka messages to files in AWS S3 buckets. ## Prerequisites Before you can create an AWS S3 sink connector in the Redpanda Cloud, you must complete these tasks: 1. [Create an AWS account](https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-creating.html). 2. [Create an S3 bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-bucket.html) that you will send data to. 3. [Create an IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html) that will be used to connect to the S3 service. 4. [Attach the following policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_change-permissions.html) to the user, replacing `bucket-name` with the name you specified in step 2. ```js { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObject", "s3:PutObject", "s3:AbortMultipartUpload", "s3:ListMultipartUploadParts", "s3:ListBucketMultipartUploads" ], "Resource": [ "arn:aws:s3:::bucket-name/*", "arn:aws:s3:::bucket-name" ] } ] } ``` 5. [Create access keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) for the user created in step 3. 6. Copy the access key ID and the secret access key. You will need them to configure the connector. ## Limitations - You can use only the `STRING` and `BYTES` input formats for `CSV` output format. - You can use only the `PARQUET` format when your messages contain schema. ## Create an AWS S3 Sink connector To create the AWS S3 Sink connector: 1. In Redpanda Cloud, click **Connectors** in the navigation menu, and then click **Create Connector**. 2. Select **Export to S3**. 3. On the **Create Connector** page, specify the following required connector configuration options: | Property name | Property key | Description | | --- | --- | --- | | `Topics to export` | `topics` | Comma-separated list of the cluster topics whose records will be exported to the S3 bucket. | | `Topics regex` | `topics.regex` | Java regular expression of topics to replicate. For example: specify `.*` to replicate all available topics in the cluster. Applicable only when **Use regular expressions** is selected. | | `AWS access key ID` | `aws.access.key.id` | Enter the AWS access key ID. | | `AWS secret access key` | `aws.secret.access.key` | Enter the AWS secret access key. | | `AWS S3 bucket name` | `aws.s3.bucket.name` | Specify the name of the AWS S3 bucket to which the connector is to send data. | | `AWS S3 region` | `aws.s3.region` | Select the region for the S3 bucket used for storing the records. The default `us-east-1`. | | `Kafka message key format` | `key.converter` | Format of the key in the Redpanda topic. The default is `BYTES`. | | `Kafka message value format` | `value.converter` | Format of the value in the Redpanda topic. The default is `BYTES`. | | `S3 file format` | `format.output.type` | Format of the files created in S3: `CSV` (the default), `AVRO`, `JSON`, `JSONL`, or `PARQUET`. You can use the `CSV` format output only with `BYTES` and `STRING`. | | `Avro codec` | `avro.codec` | The Avro compression codec to be used for Avro output files. Available values: `null` (the default), `deflate`, `snappy`, and `bzip2`. | | `Max Tasks` | `tasks.max` | Maximum number of tasks to use for this connector. The default is `1`. Each task replicates exclusive set of partitions assigned to it. | | `Connector name` | `name` | Globally-unique name to use for this connector. | 4. Click **Next**. Review the connector properties specified, then click **Create**. ### Advanced AWS S3 Sink connector configuration In most instances, the preceding basic configuration properties are sufficient. If you require additional property settings, then specify any of the following _optional_ advanced connector configuration properties by selecting **Show advanced options** on the **Create Connector** page: | Property name | Property key | Description | | --- | --- | --- | | `File name template` | `file.name.template` | The template for file names on S3. Supports `{{ variable }}` placeholders for substituting variables. Supported placeholders are:
- `topic`
- `partition`
- `start_offset` (the offset of the first record in the file)
- `timestamp:unit=yyyy\|MM\|dd\|HH` (the timestamp of the record)
- `key` (when used, other placeholders are not substituted) | | `File name prefix` | `file.name.prefix` | The prefix to be added to the name of each file put in S3. | | `Output fields` | `format.output.fields` | Fields to place into output files. Supported values are: 'key', 'value', 'offset', 'timestamp', and 'headers'. | | `Value field encoding` | `format.output.fields.value.encoding` | The type of encoding to be used for the value field. Supported values are: 'none' and 'base64'. | | `Envelope for primitives` | `format.output.envelope` | Specifies whether or not to enable additional JSON object wrapping of the actual value. | | `Output file compression` | `file.compression.type` | The compression type to be used for files put into S3. Supported values are: 'none' (default), 'gzip', 'snappy', and 'zstd'. | | `Max records per file` | `file.max.records` | The maximum number of records to put in a single file. Must be a non-negative number. 0 is interpreted as "unlimited", which is the default. In this case files are only flushed after `file.flush.interval.ms`. | | `File flush interval milliseconds` | `file.flush.interval.ms` | The time interval to periodically flush files and commit offsets. Value specified must be a non-negative number. Default is 60 seconds. 0 indicates that it is disabled. In this case, files are only flushed after reaching `file.max.records` record size. | | `AWS S3 bucket check` | `aws.s3.bucket.check` | If set to `true` (default), the connector will attempt to put a test file to the S3 bucket to validate access. | | `AWS S3 part size bytes` | `s3.part.size` | The part size in S3 multi-part uploads in bytes. Maximum is 2147483647 (2GB) and default is 5242880 (5MB). | | `S3 retry backoff` | `aws.s3.backoff.delay.ms` | S3 default base sleep time (in milliseconds) for non-throttled exceptions. Default is 100. | | `S3 maximum back-off` | `aws.s3.backoff.max.delay.ms` | S3 maximum back-off time (in milliseconds) before retrying a request. Default is 20000. | | `S3 max retries` | `aws.s3.backoff.max.retries` | Maximum retry limit (if the value is greater than 30, there can be integer overflow issues during delay calculation). Default is 3. | | `Error tolerance` | `errors.tolerance` | Error tolerance response during connector operation. Default value is `none` and signals that any error will result in an immediate connector task failure. Value of `all` changes the behavior to skip over problematic records. | | `Dead letter queue topic name` | `errors.deadletterqueue.topic.name` | The name of the topic to be used as the dead letter queue (DLQ) for messages that result in an error when processed by this sink connector, its transformations, or converters. The topic name is blank by default, which means that no messages are recorded in the DLQ. | | `Dead letter queue topic replication factor` | `errors.deadletterqueue.topic .replication.factor` | Replication factor used to create the dead letter queue topic when it doesn’t already exist. | | `Enable error context headers` | `errors.deadletterqueue.context .headers.enable` | When `true`, adds a header containing error context to the messages written to the dead letter queue. To avoid clashing with headers from the original record, all error context header keys, start with `__connect.errors`. | ## Map data Use the appropriate key or value converter (input data format) for your data as follows: - `JSON` (`org.apache.kafka.connect.json.JsonConverter`) when your messages are JSON-encoded. Select `Message JSON contains schema`, with the `schema` and `payload` fields. - `AVRO` (`io.confluent.connect.avro.AvroConverter`) when your messages contain AVRO-encoded messages, with schema stored in the Schema Registry. - `STRING` (`org.apache.kafka.connect.storage.StringConverter`) when your messages contain textual data. - `BYTES` (`org.apache.kafka.connect.converters.ByteArrayConverter`) when your messages contain arbitrary data. You can also select the output data format for your S3 files as follows: - `CSV` to produce data in the `CSV` format. For `CSV` only, you can set `STRING` and `BYTES` input formats. - `JSON` to produce data in the `JSON` format as an array of record objects. - `JSONL` to produce data in the `JSON` format, each message as a separate JSON, one per line. - `PARQUET` to produce data in the `PARQUET` format when your messages contain schema. - `AVRO` to produce data in the `AVRO` format when your messages contain schema. ## Test the connection After the connector is created, test the connection by writing to one of your topics, then checking the contents of the S3 bucket in the AWS management console. Files should appear after the file flush interval (default is 60 seconds). ## Troubleshoot If there are any connection issues, an error message is returned. Depending on the `AWS S3 bucket check` property value, the error results in a failed connector (`AWS S3 bucket check = true`) or a failed task (`AWS S3 bucket check = false`). Select **Show Logs** to view error details. Additional errors and corrective actions follow. | Message | Action | | --- | --- | | **The AWS Access Key Id you provided does not exist in our records** | `AWS access key ID` is invalid. Check to confirm that a valid existing AWS access key is specified. | | **The authorization header is malformed; the region us-east-1 is wrong; expecting us-east-2** | The selected region (`AWS S3 region`) of the AWS bucket is incorrect. Check to confirm that you have specified the region in which the bucket was created. | | **The specified bucket does not exist** | Create the bucket specified in the `AWS S3 bucket name` property, or provide the correct name of the existing bucket. | | **No files in the S3 bucket** | Be sure to wait until the connector completes the first file flush (default 60 seconds). Verify that the topics specified are correct. Then verify that the topics contain messages to be pushed to S3. | --- # Page 343: Create a Snowflake Sink Connector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-snowflake-connector.md --- # Create a Snowflake Sink Connector > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. You can use the Snowflake Sink connector to ingest and store Redpanda structured data into a Snowflake database for analytics and decision-making. ## Prerequisites Before you can create a Snowflake Sink connector in the Redpanda Cloud, you must: 1. [Create a role](https://docs.snowflake.com/en/user-guide/kafka-connector-install#creating-a-role-to-use-the-kafka-connector) for use by Kafka Connect. 2. [Create a key pair](https://docs.snowflake.com/en/user-guide/key-pair-auth#configuring-key-pair-authentication) for authentication. 3. [Create a database](https://docs.snowflake.com/en/user-guide/getting-started-tutorial-create-objects#creating-a-database) to hold the data you intend to stream from Redpanda Cloud messages. ## Limitations Refer to the [Snowflake Kafka Connector Limitations](https://docs.snowflake.com/en/user-guide/kafka-connector-overview#kafka-connector-limitations) documentation for details. ## Create a Snowflake Sink connector To create a Snowflake Sink connector: 1. In Redpanda Cloud, click **Connectors** in the navigation menu, and then click **Create Connector**. 2. Select **Export to Snowflake**. 3. On the **Create Connector** page, specify the following required connector configuration options: | Property name | Property key | Description | | --- | --- | --- | | `Topics to export` | `topics` | A comma-separated list of the cluster topics you want to export to Snowflake. | | `Topics regex` | `topics.regex` | Java regular expression of topics to replicate. For example: specify `.*` to replicate all available topics in the cluster. Applicable only when **Use regular expressions** is selected. | | `Snowflake URL name` | `snowflake.url.name` | The Snowflake URL to be used for the connection. | | `Snowflake database name` | `snowflake.database.name` | The Snowflake database name to be used for the exported data. | | `Snowflake user name` | `snowflake.user.name` | The name of the user who created the key pair. | | `Snowflake private key` | `snowflake.private.key` | The private key name for the Snowflake user. | | `Snowflake private key passphrase` | `snowflake.private.key.passphrase` | (_Optional_) If created and encrypted, the passphrase of the private key. | | `Snowflake role name` | `snowflake.role.name` | The name of the role created in [Prerequisites](#prerequisites). | | `Kafka message value format` | `value.converter` | The format of the value in the Redpanda topic. The default is `SNOWFLAKE_JSON`. | | `Max Tasks` | `tasks.max` | Maximum number of tasks to use for this connector. The default is `1`. Each task replicates exclusive set of partitions assigned to it. | | `Connector name` | `name` | Globally-unique name to use for this connector. | 4. Click **Next**. Review the connector properties specified, then click **Create**. ### Advanced Snowflake Sink connector configuration In most instances, the preceding basic configuration properties are sufficient. If you require additional property settings, then specify any of the following _optional_ advanced connector configuration properties by selecting **Show advanced options** on the **Create Connector** page: | Property name | Property key | Description | | --- | --- | --- | | `Snowflake schema name` | `snowflake.schema.name` | The Snowflake database schema name. The default is `PUBLIC`. | | `Snowflake ingestion method` | `snowflake.ingestion.method` | The default, `SNOWPIPE`, allows for structured data, while `SNOWPIPE_STREAMING` is lower latency option. | | `Snowflake topic2table map` | `snowflake.topic2table.map` | (_Optional_) Map of topics to tables. Format is comma-separated tuples. For example, `:,:`. | | `Buffer count records` | `buffer.count.records` | Number of records buffered in memory per partition before triggering Snowflake ingestion. Default is 10000. | | `Buffer flush time` | `buffer.flush.time` | The time in seconds to flush cached data. Default is 120. | | `Buffer size bytes` | `buffer.size.bytes` | Cumulative size of records buffered in memory per partition before triggering Snowflake ingestion. Default is 5000000. | | `Error tolerance` | `errors.tolerance` | Error tolerance response during connector operation. Default value is `none` and signals that any error will result in an immediate connector task failure. Value of `all` changes the behavior to skip over problematic records. | | `Dead letter queue topic name` | `errors.deadletterqueue.topic.name` | The name of the topic to be used as the dead letter queue (DLQ) for messages that result in an error when processed by this sink connector, its transformations, or converters. The topic name is blank by default, which means that no messages are recorded in the DLQ. | | `Dead letter queue topic replication factor` | `errors.deadletterqueue.topic .replication.factor` | Replication factor used to create the dead letter queue topic when it doesn’t already exist. | | `Enable error context headers` | `errors.deadletterqueue.context .headers.enable` | When `true`, adds a header containing error context to the messages written to the dead letter queue. To avoid clashing with headers from the original record, all error context header keys, start with `__connect.errors`. | ## Map data Use the appropriate key or value converter (input data format) for your data as follows: - `JSON` formatted records should use `SNOWFLAKE_JSON` (`com.snowflake.kafka.connector.records.SnowflakeJsonConverter`). - `AVRO` formatted records that use Kafka’s Schema Registry Service should use `SNOWFLAKE_AVRO` (`com.snowflake.kafka.connector.records.SnowflakeAvroConverter`). - `AVRO` formatted records that contain the schema (and therefore do not need Kafka’s Schema Registry Service) should use `SNOWFLAKE_AVRO_WITHOUT_SCHEMA_REGISTRY` (`com.snowflake.kafka.connector.records.SnowflakeAvroConverterWithoutSchemaRegistry`). - Plain text formatted records should use `STRING` (`org.apache.kafka.connect.storage.StringConverter`). ## Test the connection After the connector is created, verify in your Snowflake worksheet that your table is populated: ``` SELECT * FROM TEST.PUBLIC.TABLE_NAME; ``` It may take a couple of minutes for the records to be visible in Snowflake. ## Troubleshoot After submitting the connector for creation in Redpanda Console, the Snowflake Sink connector attempts to authenticate to the Snowflake database to validate the configuration. This validation must be successful before the connector is created. It can take up 10 seconds or more to respond. If the connector fails, check the error message or select **Show Logs** to view error details. Additional errors and corrective actions follow. | Message | Action | | --- | --- | | **snowflake.url.name is not a valid snowflake url** | Check to make sure `Snowflake URL name` contains a valid Snowflake URL. | | **snowflake.user.name: Cannot connect to Snowflake** | Check to make sure `Snowflake user name` contains a valid Snowflake user. | | **snowflake.private.key must be a valid PEM RSA private key / java.lang.IllegalArgumentException: Last encoded character (before the padding, if any) is a valid base 64 alphabet but not a possible value. Expect the discarded bits to be zero**. | `Snowflake private key` is invalid. Provide a valid key. | | **snowflake.database.name+ database does not exist** | Specify a valid database name in `snowflake.database.name`. | | **Object does not exist, or operation cannot be performed** | Snowflake error that can have several causes: an invalid role is being used, there is no existing Snowflake table, or an incorrect schema name is specified. Verify that the connector configuration and Snowflake settings are valid. | | **Config:value.converter has provided value:com.snowflake.kafka.connector.records.SnowflakeJsonConverter. If ingestionMethod is:snowpipe_streaming, Snowflake Custom Converters are not allowed.** | Use `STRING` for the `Kafka message value format`. | ## Suggested reading - For more about limitations, see [Kafka Connector Limitations](https://docs.snowflake.com/en/user-guide/kafka-connector-overview#kafka-connector-limitations) - For testing the connection, see [Using Worksheets for Queries / DML / DDL](https://docs.snowflake.com/en/user-guide/ui-worksheet) - For details about all Snowflake Sink connector properties, see [Kafka Configuration Properties](https://docs.snowflake.com/en/user-guide/kafka-connector-install#required-properties) --- # Page 344: Create a SQL Server (Debezium) Source Connector **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-sqlserver-connector.md --- # Create a SQL Server (Debezium) Source Connector > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. You can use an SQL Server (Debezium) Source connector to import updates to Redpanda from SQL Server. ## Prerequisites Before you can create an SQL Server (Debezium) Source connector in the Redpanda Cloud, you must: - Make the SQL Server (Debezium) database accessible from the connector instance. - Create a SQL Server (Debezium) user with the necessary permissions. ## Limitations The SQL Server (Debezium) Source connector has the following limitations: - Only `JSON`, `CloudEvents` or `AVRO` formats can be used for a Kafka message key and value format. - SQL Server (Debezium) connector can work with only a single task at a time per database name. ## Create an SQL Server (Debezium) Source connector To create the SQL Server (Debezium) Source connector: 1. In Redpanda Cloud, click **Connectors** in the navigation menu, and then click **Create Connector**. 2. Select **Import from SQL Server (Debezium)**. 3. On the **Create Connector** page, specify the following required connector configuration options: | Property name | Property key | Description | | --- | --- | --- | | `Topic prefix` | `topic.prefix` | A topic prefix that identifies and provides a namespace for the particular database server/cluster that is capturing changes. The topic prefix should be unique across all other connectors because it is used as a prefix for all Kafka topic names that receive events emitted by this connector. Only alphanumeric characters, hyphens, dots, and underscores are accepted. | | `Hostname` | `database.hostname` | A resolvable hostname or IP address of the SQL Server database server. | | `Port` | `database.port` | Integer port number of the SQL Server database server. | | `User` | `database.user` | Name of the SQL Server user to be used when connecting to the SQL Server database. | | `Password` | `database.password` | The password of the SQL Server database user who will be connecting to the SQL Server database. | | `Database instance` | `database.instance` | Specifies the instance name of the SQL Server named instance. If both database.port and database.instance are specified, database.instance is ignored. | | `Databases` | `database.names` | The comma-separated list of the SQL Server database names from which to stream the changes. | | `Kafka message key format` | `key.converter` | Format of the key in the Redpanda topic. | | `Message key JSON contains schema` | `key.converter.schemas.enable` | Enable to specify that the message key contains schema in the schema field. | | `Kafka message value format` | `value.converter` | Format of the value in the Redpanda topic. | | `Message value JSON contains schema` | `value.converter.schemas.enable` | Enable to specify that the message value contains schema in the schema field. | | `Max tasks` | `tasks.max` | The maximum number of tasks that the connector can use to capture data from the database instance. If the `Databases` list contains more than one element, you can increase the value of this property to a number less than or equal to the number of elements in the list. Default: 1 | | `Connector name` | `name` | Globally-unique name to use for this connector. | 4. Click **Next**. Review the connector properties specified, then click **Create**. ## Map data Use the appropriate key or value converter (input data format) for your data as follows: - Use the `Include Schemas`, `Include Tables`, and `Include Columns` properties to define lists of columns, tables, and schemas to read from. Alternatively, use `Exclude Schemas`, `Exclude Tables`, and `Exclude Columns` to define lists of columns, tables, and schemas to exclude from sources list. - Use only `JSON` (`org.apache.kafka.connect.json.JsonConverter`), `AVRO` (`io.confluent.connect.avro.AvroConverter`), and `CloudEvents` (`io.debezium.converters.CloudEventsConverter`) formats for the Kafka message key and value format. ## Test the connection After the connector is created: 1. Open Redpanda Console, click the **Topics** tab, and select a topic. Check to confirm that it contains data migrated from SQL Server. Alternatively, run `rpk consume` to check the topic. 2. Click the **Connectors** tab to confirm that no issues have been reported for the connector. ## Suggested reading - [Debezium connector for SQL Server](https://debezium.io/documentation/reference/stable/connectors/sqlserver.html) --- # Page 345: Disable Kafka Connect **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc.md --- # Disable Kafka Connect Kafka Connect is disabled by default on new clusters. If you previously enabled Kafka Connect on a cluster and want to disable it, you can use the [Cloud API](https://docs.redpanda.com/api/doc/cloud-controlplane/topic/topic-cloud-api-overview). > 📝 **NOTE** > > Redpanda Support does not manage or monitor Kafka Connect, but Support can enable the feature for your account. ## Verify Kafka Connect is enabled If Kafka Connect is enabled on your cluster, you will see it configured on the **Connect** page in the Redpanda Cloud UI. You can also verify with the Cloud API: ```bash curl -sX GET "https://api.redpanda.com/v1/clusters/{cluster.id}" \ -H "Authorization: Bearer $AUTH_TOKEN" \ -H 'accept: application/json' | jq -r '.cluster.kafka_connect' ``` Replace `{cluster.id}` with your actual cluster ID. You can find the cluster ID in the Redpanda Cloud UI, in the page header of the cluster overview. > 📝 **NOTE** > > On Dedicated clusters, the cluster ID is in the **Details** section. If Kafka Connect is enabled, the response will show: ```bash "enabled": true ``` ## Prerequisites - You have the cluster ID of a cluster that has Kafka Connect enabled. - You have a valid bearer token for the Cloud API. For details, see [Authenticate to the API](https://docs.redpanda.com/api/doc/cloud-controlplane/authentication). > ❗ **IMPORTANT** > > Make sure to stop any active connectors gracefully before disabling Kafka Connect to avoid data loss or incomplete processing. ## Disable Kafka Connect After you are authenticated to the Cloud API, make a [`PATCH /v1/clusters/{cluster.id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster) request, replacing `{cluster.id}` with your actual cluster ID. ```bash curl -X PATCH "https://api.redpanda.com/v1/clusters/{cluster.id}" \ -H "Authorization: Bearer $AUTH_TOKEN" \ -H "Content-Type: application/json" \ -d '{"kafka_connect":{"enabled":false}}' ``` The `PATCH` request returns the ID of a long-running operation. You can check the status of the operation by polling the [`GET /operations/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-operationservice_getoperation) endpoint: ```bash curl -X GET "https://api.redpanda.com/v1/operations/\{operation.id\}" \ -H "Authorization: Bearer $AUTH_TOKEN" \ -H "Content-Type: application/json" ``` When the operation is complete, the status will show `"state": "STATE_COMPLETED"`. You can verify that Kafka Connect has been disabled by running the verification command from the previous section. The response should show: ```bash "enabled": false ``` --- # Page 346: Monitor Kafka Connect **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/monitor-connectors.md --- # Monitor Kafka Connect > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. You can monitor the health of Kafka Connect with metrics that Redpanda exports through a Prometheus HTTPS endpoint. You can use Grafana to visualize the metrics and set up alerts. The most important metrics to be monitored by alerts are: - connector failed tasks - connector lag / connector lag rate ## View connector logs Connector logs are written to the system topic `__redpanda.connectors_logs`. You can view logs in Redpanda Cloud on the Topics page for your cluster, or you can download logs with `rpk`. For example: ```bash # Last 100 messages (most recent) rpk topic consume __redpanda.connectors_logs -o -100 -n 100 # Last 10 minutes rpk topic consume __redpanda.connectors_logs -o @-10m:end # Stream new logs only (like tail -f) rpk topic consume __redpanda.connectors_logs -o end # Filter by connector name rpk topic consume __redpanda.connectors_logs -o @-10m:end -O json \ | jq -r 'select(.message | test(""; "i"))' ``` > 📝 **NOTE** > > Access to system topics may be restricted by organization/project roles. Log retention follows cluster/system-topic policies and messages may expire. ## Limitations The connectors dashboard renders metrics that are exported by managed connectors. However, when a connector does not create a task (for example, an empty topic list), the dashboard will not show metrics for that connector. --- # Page 347: Sizing Connectors **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/sizing-connectors.md --- # Sizing Connectors > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. ## Connector tasks When you set up a connector, its main responsibility is to validate the configuration and spawn _connector tasks_, which perform the work. Setting up multiple tasks for a connector allows for parallelization of the work, resulting in higher throughputs. Before setting up connector tasks, consider the following: - For source connectors, the ability to add tasks to achieve higher throughput depends on the connector implementation and configuration. For many connectors, only a single connector task is allowed (for example, Debezium allows a single task only). When Redpanda Cloud does not offer an option to set the number of tasks, the source connector runs only one task. - For sink connectors, parallelism is achieved by evenly distributing configured topic partitions for the connector amongst connector tasks. The number of partitions must be equal to or greater than the number of tasks. ## Single task throughput Connector throughput depends on many factors, including converters used, compression, message size, and the performance of external systems. As a rule of thumb, expect a single connector task to provide 1-2 MB/s of throughput. ## Specify number of connector tasks for a sink connector It can be a challenge to determine the number of connector tasks to use for a given workload, so you must experiment to find the right number. Start with low number of connector tasks and wait a couple of minutes to view performance. Keep increasing the number of tasks until satisfactory throughput is achieved. Keep in mind that the underlying infrastructure must scale to provide room for additional connector tasks. Waiting roughly 10 minutes after each change should provide sufficient time for the system to scale up. --- # Page 348: Single Message Transforms **URL**: https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/transforms.md --- # Single Message Transforms > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. Single Message Transforms (SMTs) help you modify data and its characteristics as it passes through a connector, without needing additional stream processors. Prior to using an SMT with production data, test the configuration on a smaller subset of data to verify the behavior of the SMT. ## Cast Cast SMT lets you change the data type of fields in a Redpanda message, updating the schema if one is present. Use the concrete transformation type designed for the record key (`org.apache.kafka.connect.transforms.Cast$Key`) or value (`org.apache.kafka.connect.transforms.Cast$Value`). ### Configuration | Property key | Description | | --- | --- | | `spec` | Comma-separated list of field names and the type to which they should be cast; for example: ``my-field1:int32,my-field2:string. Allowed types are: `int8``, `int16`, `int32`, `int64`, `float32`, `float64`, `boolean`, and `string`. | ### Example ``` "transforms": "Cast", "transforms.Cast.type": "org.apache.kafka.connect.transforms.Cast$Value", "transforms.Cast.spec": "price:float64" ``` Before: ``` {"price": 1234, "product_id": "9987"} ``` After: ``` {"price": 1234.0,"product_id": "9987"} ``` ## DropHeaders DropHeaders SMT removes one or more headers from each record. ### Configuration | Property key | Description | | --- | --- | | `headers` | Comma-separated list of header names to drop. | ### Example Sample configuration: ``` "transforms": "DropHeader", "transforms.DropHeader.type": "org.apache.kafka.connect.transforms.DropHeaders", "transforms.DropHeader.headers": "source-id,conv-id" ``` ## EventRouter (Debezium) The outbox pattern is a way to safely and reliably exchange data between multiple (micro) services. An outbox pattern implementation avoids inconsistencies between a service’s internal state (as typically persisted in its database) and state in events consumed by services that need the same data. To implement the outbox pattern in a Debezium application, configure a Debezium connector to: - Capture changes in an outbox table - Apply the Debezium outbox EventRouter Single Message Transformation > 📝 **NOTE** > > EventRouter SMT is available for managed Debezium connectors only. ### Configuration | Property key | Description | | --- | --- | | `route.by.field` | Specifies the name of a column in the outbox table. The default behavior is that the value in this column becomes a part of the name of the topic to which the connector emits the outbox messages. | | `route.topic.replacement` | Specifies the name of the topic to which the connector emits outbox messages. The default topic name is `outbox.event.` followed by the `aggregatetype` column value in the outbox table record. | | `table.expand.json.payload` | Specifies whether the JSON expansion of a String payload should be done. If no content is found, or if there’s a parsing error, the content is kept "as is". | | `fields.additional.placement` | Specifies one or more outbox table columns to add to outbox message headers or envelopes. Specify a comma-separated list of pairs. In each pair, specify the name of a column and whether you want the value to be in the header or the envelope. | | `table.field.event.key` | Specifies the outbox table column that contains the event key. When this column contains a value, the SMT uses that value as the key in the emitted outbox message. This is important for maintaining the correct order in Kafka partitions. | ### Example Sample JSON configuration: ``` "transforms": "outbox", "transforms.outbox.route.by.field": "type", "transforms.outbox.route.topic.replacement": "my-topic.${routedByValue}", "transforms.outbox.table.expand.json.payload": "true", "transforms.outbox.table.field.event.key": "aggregate_id", "transforms.outbox.table.fields.additional.placement": "before:envelope", "transforms.outbox.type": "io.debezium.transforms.outbox.EventRouter" ``` ### Suggested reading - [Debezium Outbox Event Router SMT](https://debezium.io/documentation/reference/stable/transformations/outbox-event-router.html) ## ExtractField ExtractField SMT pulls the specified field from a Struct when a schema is present, or a Map for schemaless data. Any null values are passed through unmodified. Use the concrete transformation type designed for the record key (`org.apache.kafka.connect.transforms.ExtractField$Key`) or value (`org.apache.kafka.connect.transforms.ExtractField$Value`). ### Configuration | Property key | Description | | --- | --- | | `field` | Field name to extract. | ### Example Sample configuration: ``` "transforms": "ExtractField", "transforms.ExtractField.type": "org.apache.kafka.connect.transforms.ExtractField$Value", "transforms.ExtractField.field": "product_id" ``` Before: ```json {"product_id":9987,"price":1234} ``` After: ```json {"value":9987} ``` ## Filter Filter SMT drops all records, filtering them from subsequent transformations in the chain. This is intended to be used conditionally to filter out records matching (or not matching) a particular predicate. ### Configuration | Property key | Description | | --- | --- | | `predicate` | Name of predicate filtering records. | ### Example Sample configuration: ``` "transforms": "Filter", "transforms.Filter.type": "org.apache.kafka.connect.transforms.Filter", "transforms.Filter.predicate": "IsMyTopic", "predicates": "IsMyTopic", "predicates.IsMyTopic.type": "org.apache.kafka.connect.transforms.predicates.TopicNameMatches", "predicates.IsMyTopic.pattern": "my-topic" ``` ### Predicates Managed connectors support the following predicates: #### TopicNameMatches `org.apache.kafka.connect.transforms.predicates.TopicNameMatches` - A predicate that is true for records with a topic name that matches the configured regular expression. | Property key | Description | | --- | --- | | `pattern` | A Java regular expression for matching against the name of a record’s topic. | #### HasHeaderKey `org.apache.kafka.connect.transforms.predicates.HasHeaderKey` - A predicate that is true for records with at least one header with the configured name. | Property key | Description | | --- | --- | | `name` | The header name. | #### RecordIsTombstone `org.apache.kafka.connect.transforms.predicates.RecordIsTombstone` - A predicate that is true for records that are tombstones (that is, they have null values). ## Flatten Flatten SMT flattens a nested data structure, generating names for each field by concatenating the field names at each level with a configurable delimiter character. Applies to Struct when a schema is present, or a Map for schemaless data. Array fields and their contents are not modified. The default delimiter is `.`. Use the concrete transformation type designed for the record key (`org.apache.kafka.connect.transforms.Flatten$Key`) or value (`org.apache.kafka.connect.transforms.Flatten$Value`). ### Configuration | Property key | Description | | --- | --- | | `delimiter` | Delimiter to insert between field names from the input record when generating field names for the output record. | ### Example ``` "transforms": "flatten", "transforms.flatten.type": "org.apache.kafka.connect.transforms.Flatten$Value", "transforms.flatten.delimiter": "." ``` Before: ```json { "user": { "id": 10, "name": { "first": "Red", "last": "Panda" } } } ``` After: ```json { "user.id": 10, "user.name.first": "Red", "user.name.last": "Panda" } ``` ## HeaderFrom HeaderFrom SMT moves or copies fields in the key or value of a record into that record’s headers. Corresponding elements of `fields` and `headers` together identify a field and the header it should be moved or copied to. Use the concrete transformation type designed for the record key (`org.apache.kafka.connect.transforms.HeaderFrom$Key`) or value (`org.apache.kafka.connect.transforms.HeaderFrom$Value`). ### Configuration | Property key | Description | | --- | --- | | `fields` | Comma-separated list of field names in the record whose values are to be copied or moved to headers. | | `headers` | Comma-separated list of header names, in the same order as the field names listed in the fields configuration property. | | `operation` | Either `move` if the fields are to be moved to the headers (removed from the key/value), or `copy` if the fields are to be copied to the headers (retained in the key/value). | ### Example ``` "transforms": "HeaderFrom", "transforms.HeaderFrom.type": "org.apache.kafka.connect.transforms.HeaderFrom$Value", "transforms.HeaderFrom.fields": "id,last_login_ts", "transforms.HeaderFrom.headers": "user_id,timestamp", "transforms.HeaderFrom.operation": "move" ``` Before: - Record value: ``` { "id": 11, "name": "Harry Wilson", "last_login_ts": 1715242380 } ``` - Record header: ``` { "conv_id": "uier923" } ``` After: - Record value: ``` { "name": "Harry Wilson" } ``` - Record header: ``` { "conv_id": "uier923", "user_id": 11, "timestamp": 1715242380 } ``` ## HoistField HoistField SMT wraps data using the specified field name in a Struct when schema present, or a Map in the case of schemaless data. Use the concrete transformation type designed for the record key (`org.apache.kafka.connect.transforms.HoistField$Key`) or value (`org.apache.kafka.connect.transforms.HoistField$Value`). ### Configuration | Property key | Description | | --- | --- | | `field` | Field name for the single field that will be created in the resulting Struct or Map. | ### Example ``` "transforms": "HoistField", "transforms.HoistField.type": "org.apache.kafka.connect.transforms.HoistField$Value", "transforms.HoistField.field": "name" ``` Message: ```none Red Panda ``` After: ```none {"name":"Red"} {"name":"Panda"} ``` ## InsertField InsertField SMT inserts field(s) using attributes from the record metadata or a configured static value. Use the concrete transformation type designed for the record key (`org.apache.kafka.connect.transforms.InsertField$Key`) or value (`org.apache.kafka.connect.transforms.InsertField$Value`). ### Configuration | Property key | Description | | --- | --- | | `offset.field` | Field name for Redpanda offset. | | `partition.field` | Field name for Redpanda partition. | | `static.field` | Field name for static data field. | | `static.value` | The static field value. | | `timestamp.field` | Field name for record timestamp. | | `topic.field` | Field name for Redpanda topic. | ### Example Sample configuration: ``` "transforms": "InsertField", "transforms.InsertField.type": "org.apache.kafka.connect.transforms.InsertField$Value", "transforms.InsertField.static.field": "cluster_id", "transforms.InsertField.static.value": "19423" ``` Before: ```json {"product_id":9987,"price":1234} ``` After: ```json {"price":1234,"cluster_id":"19423","product_id":9987} ``` ## MaskField MaskField SMT replaces the contents of fields in a record. Use the concrete transformation type designed for the record key (`org.apache.kafka.connect.transforms.MaskField$Key`) or value (`org.apache.kafka.connect.transforms.MaskField$Value`). ### Configuration | Property key | Description | | --- | --- | | `fields` | Comma-separated list of fields to mask. | | `replacement` | Custom value replacement used to mask field values. | ### Example ``` "transforms": "MaskField", "transforms.MaskField.type": "org.apache.kafka.connect.transforms.MaskField$Value", "transforms.MaskField.fields": "metadata", "transforms.MaskField.replacement": "***" ``` Before: ``` {"product_id":9987,"price":1234,"metadata":"test"} ``` After: ``` {"metadata":"***","price":1234,"product_id":9987} ``` ## RegexRouter RegexRouter SMT updates the record topic using the configured regular expression and replacement string. Under the hood, the regex is compiled to a `java.util.regex.Pattern`. If the pattern matches the input topic, `java.util.regex.Matcher#replaceFirst()` is used with the replacement string to obtain the new topic. ### Configuration | Property key | Description | | --- | --- | | `regex` | Regular expression to use for matching. | | `replacement` | Replacement string. | ### Example This configuration snippet shows how to add the prefix `prefix_` to the beginning of a topic. ``` "transforms": "AppendPrefix", "transforms.AppendPrefix.type": "org.apache.kafka.connect.transforms.RegexRouter", "transforms.AppendPrefix.regex": ".*", "transforms.AppendPrefix.replacement": "prefix_$0" ``` Before: `topic-name` After: `prefix_topic-name` ## ReplaceField ReplaceField SMT filters or renames fields in a Redpanda record. Use the concrete transformation type designed for the record key (`org.apache.kafka.connect.transforms.ReplaceField$Key`) or value (`org.apache.kafka.connect.transforms.ReplaceField$Value`). ### Configuration | Property key | Description | | --- | --- | | `exclude` | Fields to exclude. This takes precedence over the fields to include. | | `include` | Fields to include. If specified, only these fields are used. | | `renames` | List of comma-separated pairs. For example: `foo:bar,abc:xyz` | ### Example Sample configuration: ``` "transforms": "ReplaceField", "transforms.ReplaceField.type": "org.apache.kafka.connect.transforms.ReplaceField$Value", "transforms.ReplaceField.renames": "product_id:item_number" ``` Before: ```json {"product_id":9987,"price":1234} ``` After: ```json {"item_number":9987,"price":1234} ``` ## ReplaceTimestamp (Redpanda) ReplaceTimestamp (Redpanda) SMT is designed to support using a record key/value field as a record timestamp, which then can be used to partition data with an S3 connector. Use the concrete transformation type designed for the record key (`com.redpanda.connectors.transforms.ReplaceTimestamp$Key`) or value (`com.redpanda.connectors.transforms.ReplaceTimestamp$Value`). > 📝 **NOTE** > > ReplaceTimestamp is available for Sink connector only. ### Configuration | Property key | Description | | --- | --- | | `field` | Specifies the name of a field to be used as a source of timestamp. | ### Example To use `my-timestamp` field as a source of the timestamp for the record, update a connector config with: ``` "transforms": "ReplaceTimestamp", "transforms.ReplaceTimestamp.type": "com.redpanda.connectors.transforms.ReplaceTimestamp$Value", "transforms.ReplaceTimestamp.field": "my-timestamp" ``` for messages in a format: ``` { "name": "my-name", ... "my-timestamp": 1707928150868, ... } ``` The SMT needs structured data to be able to extract the field from it, which means either a Map in the case of schemaless data, or a Struct when a schema is present. The timestamp value should be of a numeric type (epoch millis), or a Java Date object (which is the case when using `"connect.name":"org.apache.kafka.connect.data.Timestamp"` in schema). ## SchemaRegistryReplicator (Redpanda) SchemaRegistryReplicator (Redpanda) SMT is a transform to replicate schemas. > 📝 **NOTE** > > SchemaRegistryReplicator SMT is designed to be used with the MirrorMaker2 connector only. To use it, remove the `_schema` topic from the topic exclude list. ### Example Sample configuration: ``` "transforms": "schema-replicator", "transforms.schema-replicator.type": "com.redpanda.connectors.transforms.SchemaRegistryReplicator" ``` ## SetSchemaMetadata SetSchemaMetadata SMT sets the schema name, version, or both on the record’s key (`org.apache.kafka.connect.transforms.SetSchemaMetadata$Key`) or value (`org.apache.kafka.connect.transforms.SetSchemaMetadata$Value`) schema. ### Configuration | Property key | Description | | --- | --- | | `schema.name` | Schema name to set. | | `schema.version` | Schema version to set. | ### Example Sample configuration: ``` "transforms": "SetSchemaMetadata", "transforms.SetSchemaMetadata.type": "org.apache.kafka.connect.transforms.SetSchemaMetadata$Value", "transforms.SetSchemaMetadata.schema.name": "transaction-value" "transforms.SetSchemaMetadata.schema.version": "3" ``` ## TimestampConverter TimestampConverter SMT converts timestamps between different formats, such as Unix epoch, strings, and Connect Date/Timestamp types. It applies to individual fields or to the entire value. Use the concrete transformation type designed for the record key (`org.apache.kafka.connect.transforms.TimestampConverter$Key`) or value (`org.apache.kafka.connect.transforms.TimestampConverter$Value`). ### Configuration | Property key | Description | | --- | --- | | `field` | The field containing the timestamp, or empty if the entire value is a timestamp. Default: `""`. | | `target.type` | The desired timestamp representation: `string`, `unix`, `Date`, `Time`, or `Timestamp`. | | `format` | A `SimpleDateFormat`-compatible format for the timestamp. Used to generate the output when `target.type=string` or used to parse the input if the input is a string. Default: `""`. | | `unix.precision` | The desired Unix precision for the timestamp: seconds, milliseconds, microseconds, or nanoseconds. Used to generate the output when type=unix or used to parse the input if the input is a Long. Note: This SMT causes precision loss during conversions from, and to, values with sub-millisecond components. Default: `milliseconds`. | ### Example Sample configuration: ``` "transforms": "TimestampConverter", "transforms.TimestampConverter.type": "org.apache.kafka.connect.transforms.TimestampConverter$Value", "transforms.TimestampConverter.field": "last_login_date", "transforms.TimestampConverter.format": "yyyy-MM-dd", "transforms.TimestampConverter.target.type": "string" ``` Before: `1702041416` After: `2023-12-08` ## TimestampRouter TimestampRouter SMT updates the record’s topic field as a function of the original topic value and the record timestamp. This is mainly useful for sink connectors, because the topic field is often used to determine the equivalent entity name in the destination system (for example, a database table or search index name). > 📝 **NOTE** > > TimestampRouter SMT should be used with sink connectors only. ### Configuration | Property key | Description | | --- | --- | | `topic.format` | Format string that can contain `${topic}` and `${timestamp}` as placeholders for the topic and timestamp, respectively. | | `timestamp.format` | Format string for the timestamp that is compatible with `java.text.SimpleDateFormat`. | ### Example Sample configuration: ``` "transforms": "router", "transforms.router.type": "org.apache.kafka.connect.transforms.TimestampRouter", "transforms.router.topic.format": "${topic}_${timestamp}", "transforms.router.timestamp.format": "YYYY-MM-dd" ``` ## ValueToKey ValueToKey SMT replaces the record key with a new key formed from a subset of fields in the record value. ### Configuration | Property key | Description | | --- | --- | | `fields` | Comma-separated list of field names on the record value to extract as the record key. | ### Example Sample configuration: ``` "transforms": "valueToKey", "transforms.valueToKey.type": "org.apache.kafka.connect.transforms.ValueToKey", "transforms.valueToKey.fields": "txn-id" ``` ## Error handling By default, `Error tolerance` is set to `NONE`, so SMTs fail for any exception (notably, data parsing or data processing errors). To avoid the connector crashing for data issues, set `Error tolerance` to `ALL`, and specify `Dead Letter Queue Topic Name` as a place where failed messages are redirected. --- # Page 349: Produce Data **URL**: https://docs.redpanda.com/cloud-data-platform/develop/produce-data.md --- # Produce Data - [Configure Producers](https://docs.redpanda.com/cloud-data-platform/develop/produce-data/configure-producers/) Learn about configuration options for producers, including write caching and acknowledgment settings. - [Idempotent Producers](https://docs.redpanda.com/cloud-data-platform/develop/produce-data/idempotent-producers/) Idempotent producers assign a unique ID to every write request, guaranteeing that each message is recorded only once in the order in which it was sent. - [Configure Leader Pinning](https://docs.redpanda.com/cloud-data-platform/develop/produce-data/leader-pinning/) Learn about Leader Pinning and how to configure a preferred partition leader location based on cloud availability zones or regions. --- # Page 350: Configure Producers **URL**: https://docs.redpanda.com/cloud-data-platform/develop/produce-data/configure-producers.md --- # Configure Producers Producers are client applications that write data to Redpanda in the form of events. Producers communicate with Redpanda through the Kafka API. When a producer publishes a message to a Redpanda cluster, it sends it to a specific partition. Every event consists of a key and value. When selecting which partition to produce to, if the key is blank, then the producer publishes in a round-robin fashion between the topic’s partitions. If a key is provided, then the partition hashes the key using the murmur2 algorithm and modulates across the number of partitions. ## Producer acknowledgment settings The `acks` property sets the number of acknowledgments the producer requires the leader to have received before considering a request complete. This controls the durability of records that are sent. Redpanda guarantees data safety with fsync, which means flushing to disk. - With `acks=all`, every write is fsynced by default. - With `write.caching` enabled at the topic level, Redpanda fsyncs to disk according to `flush.ms` and `flush.bytes`, whichever is reached first. ### `acks=0` The producer doesn’t wait for acknowledgments from the leader and doesn’t retry sending messages. This increases throughput and lowers latency of the system at the expense of durability and data loss. This option allows a producer to immediately consider a message acknowledged when it is sent to the Redpanda broker. This means that a producer does not have to wait for any response from the Redpanda broker. This is the least safe option, because a leader-broker crash can cause data loss if the data has not yet replicated to the other brokers in the replica set. However, this setting is useful when you want to optimize for the highest throughput and are willing to risk some data loss. Because of the lack of guarantees, this setting is the most network bandwidth-efficient. This is helpful for use cases like IoT/sensor data collection, where updates are periodic or stateless and you can afford some degree of data loss, but you want to gather as much data as possible in a given time interval. ### `acks=1` The producer waits for an acknowledgment from the leader, but it doesn’t wait for the leader to get acknowledgments from followers. This setting doesn’t prioritize throughput, latency, or durability. Instead, `acks=1` attempts to provide a balance between all of them. Replication is not guaranteed with this setting because it happens in the background, after the leader broker sends an acknowledgment to the producer. This setting could result in data loss if the leader broker crashes before any followers manage to replicate the message or if a majority of replicas go down at the same time before fsyncing the message to the disk. ### `acks=all` The producer receives an acknowledgment after the majority of (implicitly, all) replicas acknowledge the message. Redpanda guarantees data safety by fsyncing every message to disk before acknowledgement back to clients. This increases durability at the expense of lower throughput and increased latency. Sometimes referred to as `acks = -1`, this option instructs the broker that replication is considered complete when the message has been replicated (and fsynced) to the majority of the brokers responsible for the partition in the cluster. As soon as the fsync call is complete, the message is considered acknowledged and is made visible to readers. > 📝 **NOTE** > > This property has an important distinction compared to Kafka’s behavior. In Kafka, a message is considered acknowledged without the requirement that it has been fsynced. Messages that have not been fsynced to disk may be lost in the event of a broker crash. So when using `acks=all`, the Redpanda default configuration is more resilient than Kafka’s. You can also consider using write caching, which is a relaxed mode of `acks=all` that acknowledges a message as soon as it is received and acknowledged on a majority of brokers, without waiting for it to fsync to disk. This provides lower latency while still ensuring that a majority of brokers acknowledge the write. ### `retries` This property controls the number of times a message is re-sent to the broker if the broker fails to acknowledge it. This is essentially the same as if the client application resends the erroneous message after receiving an error response. The default value of `retries` in most client libraries is 0. This means that if the send fails, the message is not re-sent at all. If you increase this to a higher value, check the `max.in.flight.requests.per.connection` value as well, because leaving that property at its default value can potentially cause ordering issues in the target topic where the messages arrive. This occurs if two batches are sent to a single partition and the first fails and is retired, but the second succeeds so the records in the second batch may appear first. ### `max.in.flight.requests.per.connection` This property controls how many unacknowledged messages can be sent to the broker simultaneously at any given time. The default value is 5 in most client libraries. If you set this to 1, then the producer does not send any more messages until the previous one is either acknowledged or an error happens, which can prompt a retry. If you set this to a value higher than 1, then the producer sends more messages at the same time, which can help increase throughput but adds a risk of message reordering if retries are enabled. When you configure the producer to be [idempotent](https://docs.redpanda.com/cloud-data-platform/develop/produce-data/idempotent-producers/), up to five requests can be guaranteed to be in flight with the order preserved. ### `enable.idempotence` To enable idempotence, set `enable.idempotence` to `true` (the default) in your Redpanda configuration. When idempotence is enabled, the producer ensures that exactly one copy of every message is written to the broker. When set to `false`, the producer retries sending a message for any reason (such as transient errors like brokers not being available or not enough replicas exception), and it can lead to duplicates. In most client libraries `enable.idempotence` is set to true by default. Internally, this is implemented using a special identifier that is assigned to every producer (the producer ID or PID). This ID, along with a sequence number, is included in every message sent to the broker. The broker checks if the PID/sequence number combination is larger than the previous one and, if not, it discards the message. To guarantee true idempotent behavior, you must also set `acks=all` to ensure that all brokers record messages in order, even in the event of node failures. In this configuration, both the producer and the broker prefer safety and durability over throughput. Idempotence is only guaranteed within a session. A session starts after the producer is instantiated and a connection is established between the client and the Redpanda broker. When the connection is closed, the session ends. If your application code retries a request, the producer client assigns a new ID to that request, which may lead to duplicate messages. ## Message batching Batching is an efficient way to save on both network bandwidth and disk size, because messages can be compressed easier. When a producer prepares to send messages to a broker, it first fills up a buffer. When this buffer is full, the producer compresses (if instructed to do so) and sends out this batch of messages to the broker. The number of batches that can be sent in a single request to the broker is limited by the `max.request.size` property. The number of requests that can simultaneously be in this sending state is controlled by the `max.in.flight.requests.per.connection` value, which defaults to 5 in most client libraries. Tune the batching configuration with the following properties: ### `buffer.memory` This property controls the total amount of memory available to the producer for buffering. If messages are sent faster than they can be delivered to the broker, the producer application may run out of memory, which causes it to either block subsequent send calls or throw an exception. The `max.block.ms` property controls the amount of time the producer blocks before throwing an exception if it cannot immediately send messages to the broker. ### `batch.size` This property controls the maximum size of coupled messages that can be batched together in one request. The producer automatically puts messages being sent to the same partition into one batch. This configuration property is given in bytes, as opposed to the number of messages. When the producer is gathering messages to assign to a batch, at some point it hits this byte-size limit, which triggers it to send the batch to the broker. However, the producer does not necessarily wait (for as much time as set using `linger.ms`) until the batch is full. Sometimes, it can even send single-message batches. This means that setting the batch size too large is not necessarily undesirable, because it won’t cause throttling when sending messages; rather, it only causes increased memory usage. Conversely, setting the batch size too small can cause the producer to send batches of messages faster, which can cause network overhead, meaning a reduced throughput. The default value is usually 16384, but you can set this as low as 0, which turns off batching entirely. ### `linger.ms` This property controls the maximum amount of time the producer waits before sending out a batch of messages, if it is not already full. This means you can somewhat force the producer to make sure that batches are filled as efficiently as possible. If you’re willing to tolerate some latency, setting this value to a number larger than the default of `0` causes the producer to send fewer, more efficient batches of messages. If you set the value to `0`, there is still a high chance messages arrive around the same time to be batched together. ## Common producer configurations ### `compression.type` This property controls how the producer should compress a batch of messages before sending it to the broker. The default is `none`, which means the batch of messages is not compressed at all. Compression occurs on full batches, so you can improve batching throughput by setting this property to use one of the available compression algorithms (along with increasing batch size). The available options are: `zstd`, `lz4`, `gzip`, and `snappy`. ### Serializers Serializers are responsible for converting a message to a byte array. You can influence the speed/memory efficiency of your streaming setup by choosing one of the built-in serializers or writing a custom one. The performance consequences of using serializers is not typically significant. For example, if you opt for the JSON serializer, you have more data to transport with each message because every record contains its schema in a verbose format, which impacts your compression speeds and network throughput. Alternatively, going with AVRO or Protobuf allows you to only define the schema in one place, while also enabling features like schema evolution. ## Broker timestamps Redpanda employs a unique strategy to help ensure the accuracy of retention operations. In this strategy, closed segments are only eligible for deletion when the age of all messages in the segment exceeds a configured threshold. However, when a producer sends a message to a topic, the timestamp set by the producer may not accurately reflect the time the message reaches the broker. To address this time skew, each time a producer sends a message to a topic, Redpanda records the broker’s system date and time in the `broker_timestamp` property of the message. This property helps maintain accurate retention policies, even when the message’s creation timestamp deviates from the broker’s time. > 📝 **NOTE** > > Clock synchronization should be monitored by the server owner, as Redpanda does not monitor clock synchronization. While Redpanda does not rely on clocks for correctness, if you are using `LogAppendTime` (server timestamp set by Redpanda), server clocks may affect the time your application sees. ## Producer optimization strategies You can optimize for speed (throughput and latency) or safety (durability and availability) by adjusting properties. Finding the optimal configuration depends on your use case. There are many configuration options within Redpanda. The configuration options mentioned here work best when combined with other broker and consumer configuration options. See also: - [Consumer Offsets](https://docs.redpanda.com/cloud-data-platform/develop/consume-data/consumer-offsets/) ### Optimize for speed To get data into Redpanda as quickly as possible, you can maximize latency and throughput in a variety of ways: - Experiment with [acks](#producer-acknowledgment-settings) settings. The quicker a producer receives a reply from the broker that the message has been committed, the sooner it can send the next message, which generally results in higher throughput. Hence, if you set `acks=1`, then the leader broker does not need to wait for replication to occur, and it can reply as soon as it finishes committing the message. This can result in less durability overall. - Enable [write caching](#Write caching), which acknowledges a message as soon as it is received and acknowledged on a majority of brokers, without waiting for it to fsync to disk. This provides lower latency while still ensuring that a majority of brokers acknowledge the write. - Experiment with other component’s properties, like the topic partition size. - Explore how the producer batches messages. Increasing the value of `batch.size` and `linger.ms` can increase throughput by making the producer add more messages into one batch before sending it to the broker and waiting until the batches can properly fill up. This approach negatively impacts latency though. By contrast, if you set `linger.ms` to `0` and `batch.size` to `1`, you can achieve lower latency, but sacrifice throughput. ### Optimize for safety For applications where you must guarantee that there are no lost messages, duplicates, or service downtime, you can use higher durability `acks` settings. If you set `acks=all`, then the producer waits for a majority of replicas to acknowledge the message before it can send the next message, resulting in lower latency, because there is more communication required between brokers. This approach can guarantee higher durability because the message is replicated to all brokers. You can also increase durability by increasing the number of retries the broker can make in case messages are not delivered successfully. The trade-off is that duplicates may enter the system and potentially alter the ordering of messages. --- # Page 351: Idempotent Producers **URL**: https://docs.redpanda.com/cloud-data-platform/develop/produce-data/idempotent-producers.md --- # Idempotent Producers When a producer writes messages to a topic, each message should be recorded only once in the order in which it was sent. However, network issues such as a connection failure can result in a timeout, which prevents a write request from succeeding. In such cases, the client retries the write request until one of these events occurs: - The client receives an acknowledgment from the broker that the write was successful. - The retry limit is reached. - The message delivery timeout limit is reached. Since there is no way to tell if the initial write request succeeded before the disruption, a retry can result in a duplicate message. A retry can also cause subsequent messages to be written out of order. Idempotent producers prevent this problem by assigning a unique ID to every write request. The request ID consists of the producer ID and a sequence number. The sequence number identifies the order in which each write request was sent. If a retry results in a duplicate message, Redpanda detects and rejects the duplicate message and maintains the original order of the messages. If new write requests continue while a previous request is being retried, the new requests are stored in the client’s memory in the order in which they were sent. The client must also retry these requests once the previous request is successful. ## Enable idempotence for producers To make producers idempotent, the `enable.idempotence` property must be set to `true` in your producer configuration, as well as in the Redpanda cluster configuration, where it is set to `true` by default. Some Kafka clients have `enable.idempotence` set to `false` by default. In this case, set the property to `true` by following the instructions for your particular client. Idempotence is guaranteed within a session. A session starts once a producer is created and a connection is established between the client and the Kafka broker. > 📝 **NOTE** > > Idempotent producers retry unsuccessful write requests automatically. If you manually retry a write request, the client will assign a new ID to that request, which may lead to duplicate messages. --- # Page 352: Configure Leader Pinning **URL**: https://docs.redpanda.com/cloud-data-platform/develop/produce-data/leader-pinning.md --- # Configure Leader Pinning Produce requests that write data to Redpanda topics are routed through the topic partition leader, which syncs messages across its follower replicas. For a Redpanda cluster deployed across multiple availability zones (AZs), Leader Pinning ensures that a topic’s partition leaders are geographically closer to clients, which helps decrease networking costs and guarantees lower latency. If consumers are located in the same preferred region or AZ for Leader Pinning, and you have not set up [follower fetching](https://docs.redpanda.com/cloud-data-platform/develop/consume-data/follower-fetching/), Leader Pinning can also help reduce networking costs on consume requests. After reading this page, you will be able to: - Configure preferred partition leader placement using rack labels - Configure ordered rack preference for priority-based leader failover - Identify conditions where Leader Pinning cannot place leaders in preferred racks ## Set leader rack preferences Configure Leader Pinning if you have Redpanda deployed in a multi-AZ or multi-region cluster and your ingress is concentrated in a particular AZ or region. Use the topic configuration property `redpanda.leaders.preference` to configure Leader Pinning for individual topics. The property accepts the following string values: - `none`: Disable Leader Pinning for the topic. - `racks:[,,…​]`: Specify the preferred location (rack) of all topic partition leaders. The list can contain one or more racks, and you can list the racks in any order. Spaces in the list are ignored, for example: `racks:rack1,rack2` and `racks: rack1, rack2` are equivalent. You cannot specify empty racks, for example: `racks: rack1,,rack2`. If you specify multiple racks, Redpanda tries to distribute the partition leader locations equally across brokers in these racks. - `ordered_racks:[,,…​]`: Supported in Redpanda v26.1 or later. Specify the preferred racks in priority order. Redpanda places leaders in the first listed rack when available, failing over to each subsequent rack when higher-priority racks are unavailable. If all listed racks are unavailable, leaders fall back to any other available brokers. Brokers with no rack assignment are treated as lowest priority. To find the rack identifiers of all brokers, run: ```bash rpk cluster info ``` Expected output ```bash CLUSTER ======= redpanda.be267958-279d-49cd-ae86-98fc7ed2de48 BROKERS ======= ID HOST PORT RACK 0* 54.70.51.189 9092 us-west-2a 1 35.93.178.18 9092 us-west-2b 2 35.91.121.126 9092 us-west-2c ``` To set the topic property: ```bash rpk topic alter-config --set redpanda.leaders.preference=ordered_racks:, ``` If there is more than one broker in the preferred AZ (or AZs), Leader Pinning distributes partition leaders uniformly across brokers in the AZ. ## Limitations Leader Pinning controls which replica is elected as leader, and does not move replicas to different brokers. If all of a topic’s replicas are on brokers in non-preferred racks, no replica exists in the preferred racks to elect as leader, and Redpanda may elect a non-preferred leader indefinitely. For example, consider a cluster deployed across four racks (A, B, C, D) with Leader Pinning configured as `ordered_racks:A,B,C,D`. With a replication factor of 3, rack awareness can only place replicas in three of the four racks. If the highest-priority rack (A) does not receive a replica, no replica exists there to elect as leader, and Redpanda may elect a non-preferred leader indefinitely. To prevent this scenario, ensure the topic’s replication factor at least equals the total number of racks in the cluster, so every rack, including the highest-priority rack, receives a replica. ## Leader Pinning failover across availability zones If there are three AZs: A, B, and C, and A becomes unavailable, the failover behavior with `racks` is as follows: - The topic with `A` as the preferred leader AZ will have its partition leaders uniformly distributed across B and C. - The topic with `A,B` as the preferred leader AZs will have its partition leaders in B. - The topic with `B` as the preferred leader AZ will have its partition leaders in B as well. ### Failover with ordered rack preference With `ordered_racks`, the failover order follows the configured priority list. Leaders move to the next available rack in the list when higher-priority racks become unavailable. For a topic configured with `ordered_racks:A,B,C`: - The topic with `A` as the first-priority rack will have its partition leaders in A. - If A becomes unavailable, leaders move to B. - If A and B become unavailable, leaders move to C. - If A, B, and C all become unavailable, leaders fall back to any available brokers. If a higher-priority rack recovers and the topic’s replication factor ensures that rack receives a replica, Redpanda automatically moves leaders back to the highest available preferred rack. ## Suggested reading - For latency-tolerant, high-throughput workloads where cross-AZ networking charges are a major cost driver, also consider [Cloud Topics](https://docs.redpanda.com/cloud-data-platform/develop/topics/cloud-topics/) - [Follower Fetching](https://docs.redpanda.com/cloud-data-platform/develop/consume-data/follower-fetching/) --- # Page 353: Topics **URL**: https://docs.redpanda.com/cloud-data-platform/develop/topics.md --- # Topics - [Topics Overview](https://docs.redpanda.com/cloud-data-platform/develop/topics/create-topic/) Learn how to create a topic for a Redpanda Cloud cluster. - [Manage Topics](https://docs.redpanda.com/cloud-data-platform/develop/topics/config-topics/) Learn how to create topics, update topic configurations, and delete topics or records. - [Manage Cloud Topics](https://docs.redpanda.com/cloud-data-platform/develop/topics/cloud-topics/) Cloud Topics are Redpanda topics that enable users to trade off latency for lower costs. --- # Page 354: Manage Cloud Topics **URL**: https://docs.redpanda.com/cloud-data-platform/develop/topics/cloud-topics.md --- # Manage Cloud Topics Starting in v26.1, Redpanda provides [Cloud Topics](https://docs.redpanda.com/home/glossary/#cloud-topic) to support multi-modal streaming workloads in the most cost-effective way possible: as a per-topic configuration running mixed latency workloads. While standard Redpanda [topics](https://docs.redpanda.com/cloud-data-platform/develop/topics/config-topics/) that use local storage or Tiered Storage are ideal for latency-sensitive workloads (for example, for audit logs or analytics), Cloud Topics are optimized for latency-tolerant, high-throughput workloads where cross-AZ networking charges are a major consideration that can become the dominant cost driver at high throughput. These workloads can include observability streams, offline analytics, AI/ML model training data feeds, or development environments that have flexible latency requirements. Instead of replicating every byte across expensive network links, Cloud Topics leverage durable, inexpensive cloud storage (S3, ADLS, GCS, MinIO) as the primary mechanism to both replicate data and serve it to consumers. This eliminates over 90% of the cost of replicating data over network links in multi-AZ clusters. The end-to-end latency experienced when using Cloud Topics can range from 500 ms to as high as a few seconds with different object stores. Lower latencies may be achievable in certain environments, but Cloud Topics is optimized for throughput rather than low latency or tightly constrained tail latency. This latency profile is often acceptable for many streaming workloads, and can unlock new streaming use cases that previously were not cost effective. With Cloud Topics, data from the client is not acknowledged until it is uploaded to object storage. This maintains durability in the face of infrastructure failures, but results in an increase in both produce latency and end-to-end latency, driven by both batching of produced data and the inherent latency of the underlying object store. You should generally expect end-to-end latencies of 1-2 seconds with public cloud stores. After reading this page, you will be able to: - Describe the latency and cost trade-offs of Cloud Topics compared to standard Redpanda topics - Create a Cloud Topic using rpk on a cluster that has cloud storage enabled - Identify Cloud Topics limitations and configurations that reduce cross-AZ networking costs ## Prerequisites - [Install rpk](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/) v26.1 or later. ## Limitations - In Redpanda versions earlier than v26.2, shadow links do not support Cloud Topics. - Once created, a Cloud Topic cannot be converted back to a standard Redpanda topic that uses local storage or Tiered Storage v1. Conversely, existing topics created as local or Tiered Storage v1 topics cannot be converted to Cloud Topics. Starting in Redpanda v26.2, Cloud Topics can be converted to and from Tiered Storage v2 topics. ## Create Cloud Topics Cloud Topics don’t require a separate cluster property to enable them. When cloud storage is enabled for your cluster, you can create Cloud Topics directly. To create a Cloud Topic, set the topic property `redpanda.storage.mode` to `cloud`: ```bash rpk topic create -c redpanda.storage.mode=cloud ``` ```console TOPIC STATUS audit.analytics.may2025 OK ``` You can make a topic a Cloud Topic only at topic creation time. In addition to replication, cross-AZ ingress (producer) and egress (consumer) traffic can also contribute substantially to cloud networking costs. When running multi-AZ clusters in general, Redpanda strongly recommends using [Follower Fetching](https://docs.redpanda.com/cloud-data-platform/develop/consume-data/follower-fetching/), which allows consumers to avoid crossing network zones. When possible, you can use [leader pinning](https://docs.redpanda.com/cloud-data-platform/develop/produce-data/leader-pinning/), which positions a topic’s partition leader close to the producers, providing a similar benefit for ingress traffic. These features can add additional savings to the replication cost savings of Cloud Topics. For client-side tuning guidance, see [Configure producers for Cloud Topics](https://docs.redpanda.com/cloud-data-platform/develop/topics/configure-producers-for-cloud-topics/). --- # Page 355: Manage Topics **URL**: https://docs.redpanda.com/cloud-data-platform/develop/topics/config-topics.md --- # Manage Topics Topics provide a way to organize events in a data streaming platform. ## Create a topic Creating a topic can be as simple as specifying a name for your topic on the command line. For example, to create a topic named `xyz`, run: ```bash rpk topic create xyz ``` This command creates a topic named `xyz` with one partition and three replicas, because these are the default values set in the cluster configuration file. Replicas are copies of partitions that are distributed across different brokers, so if one broker goes down, other brokers still have a copy of the data. Redpanda Cloud supports 40,000 topics per cluster. ### Choose the number of partitions A partition acts as a log file where topic data is written. Dividing topics into partitions allows producers to write messages in parallel and consumers to read messages in parallel. The higher the number of partitions, the greater the throughput. > 💡 **TIP** > > As a general rule, select a number of partitions that corresponds to the maximum number of consumers in any consumer group that will consume the data. For example, suppose you plan to create a consumer group with 10 consumers. To create topic `xyz` with 10 partitions, run: ```bash rpk topic create xyz -p 10 ``` ### Choose a storage mode Starting in Redpanda v26.1, you can set the `redpanda.storage.mode` topic property to control how a topic stores data: | Value | Behavior | | --- | --- | | `unset` | Legacy behavior. Tiered Storage is controlled by the `redpanda.remote.read` and `redpanda.remote.write` topic properties and their cluster-level defaults (`cloud_storage_enable_remote_read` and `cloud_storage_enable_remote_write`). | | `local` | Topic data is stored only on the broker’s local disk. Object storage upload is disabled for the topic, regardless of `redpanda.remote.read` and `redpanda.remote.write` values. | | `tiered` | Data is stored on local disk and uploaded to object storage. Enables Tiered Storage for the topic regardless of `redpanda.remote.read` and `redpanda.remote.write` values. Starting in Redpanda v26.2, Tiered Storage is available in two versions (`tiered_v1` and `tiered_v2` (beta)). See [Choose a Tiered Storage version](https://docs.redpanda.com/cloud-data-platform/manage/tiered-storage-versions/). | | `cloud` | Data is stored durably in object storage using the [Cloud Topics](https://docs.redpanda.com/home/glossary/#cloud-topic) architecture. Local storage is used only as a write buffer. See [Manage Cloud Topics](https://docs.redpanda.com/cloud-data-platform/develop/topics/cloud-topics/). | > 📝 **NOTE** > > In Redpanda Cloud, the `default_redpanda_storage_mode` cluster property defaults to `tiered`, so new topics use Tiered Storage unless you specify a different storage mode. Cluster properties aren’t available on Serverless clusters. See [Configure Cluster Properties](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/). To set the storage mode at topic creation time: ```bash rpk topic create -c redpanda.storage.mode=tiered ``` When `redpanda.storage.mode` is set to `local`, `tiered`, or `cloud`, the `redpanda.remote.read` and `redpanda.remote.write` topic properties have no effect on the topic. Starting in Redpanda v26.2, the `tiered` value is an alias that resolves to one of two Tiered Storage versions when the topic is created. The `default_redpanda_storage_mode_tiered_impl` cluster property selects the version (`tiered_v1` by default). To select the version explicitly for a single topic, set both `redpanda.storage.mode` and `redpanda.storage.mode.impl` when you create the topic: ```bash rpk topic create -c redpanda.storage.mode=tiered -c redpanda.storage.mode.impl=tiered_v2 ``` The `redpanda.storage.mode.impl` property reports the exact implementation of every topic’s storage mode and is read-only after topic creation. For details, see [Choose a Tiered Storage version](https://docs.redpanda.com/cloud-data-platform/manage/tiered-storage-versions/). To set `local` as the default storage mode for all new topics in a cluster: ```bash rpk cluster config set default_redpanda_storage_mode=local ``` ## Update topic configurations After you create a topic, you can update the topic property settings for all new data written to it. For example, you can add partitions or change the cleanup policy. ### Add partitions You can assign a certain number of partitions when you create a topic, and add partitions later. For example, suppose you add brokers to your cluster, and you want to take advantage of the additional processing power. To increase the number of partitions for existing topics, run: ```bash rpk topic add-partitions [TOPICS...] --num [#] ``` Note that `--num <#>` is the number of partitions to _add_, not the total number of partitions. > 📝 **NOTE** > > If a topic already has messages and you add partitions, the existing messages won’t be redistributed to the new partitions. If you require messages to be redistributed, then you must create a new topic with the new partition count, then stream the messages from the old topic to the new topic so they are appropriately distributed according to the new partition hashing. ### Reduce the number of partitions You cannot reduce the number of partitions on an existing topic. The Kafka API does not support it: a record’s partition is chosen when the record is produced, and records that have already been written stay in the partition where they landed, so removing a partition would orphan its data. Redpanda assigns a record that has a key to a partition by hashing the key, and leaves a record without a key to the producer’s partitioner, which usually spreads such records across all available partitions. To move a topic’s data to fewer partitions, copy it to a new topic and switch your clients over. Before you start, check that your applications can tolerate the following: - **Duplicates**: Redpanda Connect delivers records at least once, so a restart or a retry during the copy can write the same record to the new topic twice. A lag of zero shows only how far the copy has committed, not that the new topic is free of duplicates. Either make your consumers idempotent, or deduplicate on a record ID after the copy. - **Ordering**: records keep their keys, so all records for a key still land on one partition and keep their order relative to each other, but the global order of records across partitions is not preserved. - **Retention**: the copy starts at the oldest record that is still retained. Records that retention or compaction has already removed cannot be copied, and both keep running during the copy, so complete the copy well within the topic’s retention period. - **Consumer offsets**: consumer group offsets are stored per topic, so the offsets your consumers committed on the original topic do not carry over. Each consumer starts from the beginning of the new topic and replays what the copy wrote, unless you set its offsets explicitly with `rpk group seek`. - **Write downtime**: producers must stop writing to the original topic before you switch clients over, so plan a window in which the topic accepts no writes. The following procedure reduces a topic named `orders` from three partitions to one. 1. Check the configuration of the original topic so that you can recreate it. Note the replication factor, and every row whose `SOURCE` is `DYNAMIC_TOPIC_CONFIG`, which is an override you must set on the new topic: ```bash rpk topic describe orders ``` Example output (abbreviated) ```bash SUMMARY ======= NAME orders PARTITIONS 3 REPLICAS 1 CONFIGS ======= KEY VALUE SOURCE cleanup.policy delete DEFAULT_CONFIG retention.bytes -1 DEFAULT_CONFIG retention.local.target.ms 86400000 DEFAULT_CONFIG retention.ms 604800000 DYNAMIC_TOPIC_CONFIG segment.bytes 134217728 DEFAULT_CONFIG ``` Here, only `retention.ms` is an override. If the topic has Tiered Storage settings, a custom cleanup policy, or other overrides, carry all of them over: a new topic created without them silently falls back to the cluster defaults. 2. Create the new topic with the target number of partitions, the replication factor of the original topic, and each override from the previous step: ```bash rpk topic create orders-reduced --partitions 1 --replicas 1 --topic-config retention.ms=604800000 ``` Example output ```bash TOPIC STATUS orders-reduced OK ``` 3. Copy the data with a [Redpanda Connect](https://docs.redpanda.com/connect/get-started/about/) pipeline. This configuration reads all records that are still available in the original topic and preserves record keys, so records for the same key land on the same partition of the new topic: `reduce-partitions.yaml` ```yaml input: redpanda: seed_brokers: [""] topics: ["orders"] consumer_group: orders-to-orders-reduced start_offset: earliest output: redpanda: seed_brokers: [""] topic: orders-reduced key: ${! @kafka_key } ``` Give the consumer group a name that is unique to this copy, such as `-to-`. `start_offset: earliest` applies only when the group has no committed offset, so a group name that has been used before resumes from where it left off and skips records. ```bash rpk connect run reduce-partitions.yaml ``` Example output ```bash level=info msg="Launching a Redpanda Connect instance, use CTRL+C to close" level=info msg="Output type redpanda is now active" level=info msg="Input type redpanda is now active" ``` 4. Stop the producers that write to the original topic. Leave the pipeline running so that it copies the last records they wrote. 5. Wait for the copy to drain. It is complete when the consumer group reports a `LAG` of `0` for every partition of the original topic: ```bash rpk group describe orders-to-orders-reduced ``` Example output ```bash GROUP orders-to-orders-reduced COORDINATOR-NODE 0 COORDINATOR-PARTITION __consumer_offsets/0 STATE Stable BALANCER cooperative-sticky MEMBERS 1 TOTAL-LAG 0 TOPIC PARTITION CURRENT-OFFSET LOG-START-OFFSET LOG-END-OFFSET LAG MEMBER-ID CLIENT-ID HOST orders 0 3 0 3 0 redpanda-connect-15d7a80f-590f-4cde-bc16-4854fa2754 redpanda-connect 10.0.0.1 orders 1 3 0 3 0 redpanda-connect-15d7a80f-590f-4cde-bc16-4854fa2754 redpanda-connect 10.0.0.1 orders 2 3 0 3 0 redpanda-connect-15d7a80f-590f-4cde-bc16-4854fa2754 redpanda-connect 10.0.0.1 ``` 6. Compare the record counts of the two topics. For each topic, the number of available records is the sum of `HIGH-WATERMARK` minus `LOG-START-OFFSET` across its partitions. A higher count on the new topic means the copy wrote duplicates: ```bash rpk topic describe orders -p rpk topic describe orders-reduced -p ``` Example output ```bash PARTITION LEADER EPOCH REPLICAS LOG-START-OFFSET HIGH-WATERMARK 0 0 1 [0] 0 3 1 0 1 [0] 0 3 2 0 1 [0] 0 3 PARTITION LEADER EPOCH REPLICAS LOG-START-OFFSET HIGH-WATERMARK 0 0 1 [0] 0 9 ``` Nine records across the three original partitions, and the same nine on the single partition of the new topic. 7. Point your producers and consumers at the new topic. Consumers start from the beginning of the new topic unless you set their offsets with `rpk group seek`. 8. Stop the pipeline with Ctrl+C. 9. When you no longer need the original topic, delete it to reclaim storage. See [Delete a topic](#delete-a-topic). > ⚠️ **CAUTION** > > Do not delete the original topic until the new topic holds the data you expect and your consumers are running against it. Deleting a topic deletes its data. ### Change the storage mode You can change a topic’s `redpanda.storage.mode` after creation, with the following restrictions: | From | To | Permitted | Notes | | --- | --- | --- | --- | | `local` | `tiered` (v1) | Yes | Enables Tiered Storage for the topic. | | `tiered` (v1) | `local` | With caution | Disables object storage uploads and reads for the topic. **This is not a migration**: data already uploaded to Tiered Storage is not moved to local storage and is not deleted. It remains in object storage, becomes unreachable while the topic is in `local` mode, and continues to accrue storage costs. Only data within the topic’s local retention remains readable. Redpanda strongly recommends against repeatedly toggling this setting, as it can result in data gaps in Tiered Storage. | | `cloud` | [`tiered` (v2)](https://docs.redpanda.com/cloud-data-platform/manage/tiered-storage-versions/) (beta) | Yes | Starting in Redpanda v26.2. | | `tiered` (v2) (beta) | `cloud` | Yes | Starting in Redpanda v26.2. | | `tiered` (v1) | `tiered` (v2) (beta) | No | Topics cannot be converted between Tiered Storage versions, in either direction. | | `local` | `tiered` (v2) (beta) | No | | | `unset` | `cloud` | No | Cloud Topics can otherwise only be set at topic creation time. | | `local` | `cloud` | No | Cloud Topics can otherwise only be set at topic creation time. | | `tiered` (v1) | `cloud` | No | Cloud Topics can otherwise only be set at topic creation time. | | `cloud` | `local` or `tiered` (v1) | No | A Cloud Topic cannot be converted to a local or Tiered Storage v1 topic. | When you change the storage mode, you always set the `redpanda.storage.mode` property. The `tiered` value resolves to the version selected by the `default_redpanda_storage_mode_tiered_impl` cluster property, so, for example, converting a `cloud` topic to Tiered Storage v2 (beta) requires `default_redpanda_storage_mode_tiered_impl=tiered_v2`. The `redpanda.storage.mode.impl` property cannot be changed after topic creation. See [Choose a Tiered Storage version](https://docs.redpanda.com/cloud-data-platform/manage/tiered-storage-versions/). For example, to transition an existing local topic to Tiered Storage: ```bash rpk topic alter-config --set redpanda.storage.mode=tiered ``` > 📝 **NOTE** > > This example requires `default_redpanda_storage_mode_tiered_impl` to be `tiered_v1` (the default). If the cluster default is `tiered_v2` (beta), the request is rejected, because a `local` topic cannot be converted to Tiered Storage v2. ### Change the cleanup policy The cleanup policy determines how to clean up the partition log files when they reach a certain size: - `delete` deletes data based on age or log size. Topics retain all records until then. - `compact` compacts the data by only keeping the latest values for each KEY. - `compact,delete` combines both methods. Unlike compacted topics, which keep only the most recent message for a given key, topics configured with a `delete` cleanup policy provide a running history of all changes for those topics. > ⚠️ **WARNING** > > All topic properties take effect immediately after being set. Do not modify properties on internal Redpanda topics (such as `__consumer_offsets`, `_schemas`, or other system topics) as this can cause cluster instability. For example, to change a topic’s policy to `compact`, run: ```bash rpk topic alter-config [TOPICS…] —-set cleanup.policy=compact ``` ### Configure write caching Write caching is a relaxed mode of [`acks=all`](https://docs.redpanda.com/cloud-data-platform/develop/produce-data/configure-producers/#acksall) that provides better performance at the expense of durability. It acknowledges a message as soon as it is received and acknowledged on a majority of brokers, without waiting for it to be written to disk. This provides lower latency while still ensuring that a majority of brokers acknowledge the write. Write caching applies to user topics. It does not apply to transactions or consumer offsets: data written in the context of a transaction and consumer offset commits is always written to disk and fsynced before being acknowledged to the client. Only enable write caching on workloads that can tolerate some data loss in the case of multiple, simultaneous broker failures. Leaving write caching disabled safeguards your data against complete data center or availability zone failures. #### Configure at topic level To override the cluster-level setting at the topic level, set the topic-level property `write.caching`: `rpk topic alter-config my_topic --set write.caching=true` With `write.caching` enabled at the topic level, Redpanda fsyncs to disk according to `flush.ms` and `flush.bytes`, whichever is reached first. #### How flush settings interact with write caching If you do not set `flush.ms` or `flush.bytes` on a topic, they inherit their cluster-level defaults. Which produce requests these settings apply to depends on the producer’s [`acks`](https://docs.redpanda.com/cloud-data-platform/develop/produce-data/configure-producers/#producer-acknowledgment-settings) setting and on write caching: - Requests with `acks=0` or `acks=1` always honor `flush.ms` and `flush.bytes`, whether or not write caching is enabled. - Requests with `acks=all` honor `flush.ms` and `flush.bytes` only when write caching is enabled. When write caching is disabled, Redpanda fsyncs each `acks=all` batch to disk on a majority of replicas before it acknowledges the write. ### Remove a configuration setting You can remove a configuration that overrides the default setting, and the setting will use the default value again. For example, suppose you altered the cleanup policy to use `compact` instead of the default, `delete`. Now you want to return the policy setting to the default. To remove the configuration setting `cleanup.policy=compact`, run `rpk topic alter-config` with the `--delete` flag: ```bash rpk topic alter-config [TOPICS...] --delete cleanup.policy ``` ## List topic configuration settings To display all the configuration settings for a topic, run: ```bash rpk topic describe -c ``` The `-c` flag limits the command output to just the topic configurations. This command is useful for checking the default configuration settings before you make any changes and for verifying changes after you make them. The following command output displays after running `rpk topic describe test-topic`, where `test-topic` was created with default settings: ```bash rpk topic describe test_topic SUMMARY ======= NAME test_topic PARTITIONS 1 REPLICAS 3 CONFIGS ======= KEY VALUE SOURCE cleanup.policy delete DYNAMIC_TOPIC_CONFIG compression.type producer DEFAULT_CONFIG max.message.bytes 20971520 DEFAULT_CONFIG message.timestamp.type CreateTime DEFAULT_CONFIG redpanda.datapolicy function_name: script_name: DEFAULT_CONFIG redpanda.remote.delete true DEFAULT_CONFIG redpanda.remote.read false DEFAULT_CONFIG redpanda.remote.write false DEFAULT_CONFIG retention.bytes -1 DEFAULT_CONFIG retention.local.target.bytes -1 DEFAULT_CONFIG retention.local.target.ms 86400000 DEFAULT_CONFIG retention.ms 604800000 DEFAULT_CONFIG ``` ## Delete a topic To delete a topic, run: ```bash rpk topic delete ``` When a topic is deleted, its underlying data is deleted, too. To delete multiple topics at a time, provide a space-separated list. For example, to delete two topics named `topic1` and `topic2`, run: ```bash rpk topic delete topic1 topic2 ``` You can also use the `-r` flag to specify one or more regular expressions; then, any topic names that match the pattern you specify are deleted. For example, to delete topics with names that start with “f” and end with “r”, run: ```bash rpk topic delete -r '^f.*' '.*r$' ``` Note that the first regular expression must start with the `^` symbol, and the last expression must end with the `$` symbol. This requirement helps prevent accidental deletions. ## Delete records from a topic Redpanda allows you to delete data from the beginning of a partition up to a specific offset (a monotonically increasing sequence number for records in a partition). Deleting records frees up disk space, which is especially helpful if your producers are pushing more data than anticipated in your retention plan. Delete records when you know that all consumers have read up to that given offset, and the data is no longer needed. There are different ways to delete records from a topic, including using the [`rpk topic trim-prefix`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-topic/rpk-topic-trim-prefix/) command, using the `DeleteRecords` Kafka API with Kafka clients, or using Redpanda Cloud. > 📝 **NOTE** > > - To delete records, `cleanup.policy` must be set to `delete` or `compact,delete`. > > - Object storage is deleted asynchronously. After messages are deleted, the partition’s start offset will have advanced, but garbage collection of deleted segments may not be complete. > > - Similar to Kafka, after deleting records, local storage and object storage may still contain data for deleted offsets. (Redpanda does not truncate segments. Instead, it bumps the start offset, then it attempts to delete as many whole segments as possible.) Data before the new start offset is not visible to clients but could be read by someone with access to the local disk of a Redpanda node. > ⚠️ **WARNING** > > When you delete records from a topic with a timestamp, Redpanda advances the partition start offset to the first record whose timestamp is after the threshold. If record timestamps are not in order with respect to offsets, this may result in unintended deletion of data. Before using a timestamp, verify that timestamps increase in the same order as offsets in the topic to avoid accidental data loss. For example: > > ```bash > rpk topic consume -n 50 --format '%o %d{go[2006-01-02T15:04:05Z07:00]} %k %v' > ``` ## Next steps [Configure Producers](https://docs.redpanda.com/cloud-data-platform/develop/produce-data/configure-producers/) --- # Page 356: Configure Producers for Cloud Topics **URL**: https://docs.redpanda.com/cloud-data-platform/develop/topics/configure-producers-for-cloud-topics.md --- # Configure Producers for Cloud Topics This page describes how to tune the client producer for Cloud Topics (note that general producer configuration guidance still applies). See [Configure Producers](https://docs.redpanda.com/cloud-data-platform/develop/produce-data/configure-producers/). With idempotency enabled, Kafka’s protocol allows only five in-flight requests at a time on a single broker connection. This imposes a tight limit on how much data can be in flight at a single time. Over high-latency links, this is already a problem for standard topics. Cloud Topics use a 250ms batching interval at the broker to reduce cloud storage costs, which effectively makes every producer connection a high-latency link. Compared to standard topics, this changes producer tuning priorities. Configuring batch size, linger time, and request size correctly is critical for achieving good single-producer throughput. This section covers the key settings and example values for the most common client libraries. Calculate the maximum throughput for a single producer as follows: ```text broker_count * max_in_flight * request_size / latency_seconds ``` Throughput formula definitions: - `broker_count`: The number of brokers in the cluster. - `max_in_flight`: The maximum number of in-flight requests on a single connection. With an idempotent producer, this is usually five. - `latency_seconds`: The latency of a single produce request. Assuming normal operation, this can be equated to the 250ms as earlier. In practice, it is typically lower, as the timer starts with the first byte arriving. - `request_size`: The size of a single produce request. This is the primary tuning lever because the other factors are effectively constants. Another way to increase throughput in the system is to increase producer count, as doing so naturally increases available parallelism in the system as more connections are opened to the brokers. ## Producer settings Most Kafka client libraries offer an assortment of tunables, with many properties impacting request size. The most important ones are described here, along with an example for the Kafka Java client, along with caveats from other libraries. ### Batches and requests A Kafka produce request consists of one or more batches. A batch contains multiple records. Records mostly correspond to application-level messages as passed to the Kafka client API. At the broker level, the unit that matters is the batch, as everything happens at the batch level. Hence, creating the largest possible batches is the most important factor for performance in general, and equally applies for Cloud Topics. A request can contain multiple batches, this can sometimes alleviate the need for massive batches. However, this requires that a producer is producing to multiple partitions and that there are enough partitions per broker to fill the request with batches. As explained in [Java client](#java-client), there are also exceptions to this in some client libraries, so you should not blindly rely on them. ### Java client For the Java client, Redpanda Data recommends the following as minimal settings: | Setting | Recommended value | | --- | --- | | `linger.ms` | `10ms` | | `batch.size` | `131072` | | `max.request.size` | `1048576 (default)` | As shown in the preceding formula, with a basic three-broker setup and enough partitions, you can achieve a maximum throughput of ~65 MB/s per producer. If more throughput is needed on a single producer, increase batch and max request size. Setting `linger.ms` to a higher value is recommended, but it’s less critical for Cloud Topics because as soon as there are five requests in flight, messages are force-batched even after crossing the `linger.ms` threshold. ### librdkafka librdkafka is a commonly-used Kafka C library. However, it’s also the backing library for many other Kafka clients like confluent-kafka-python. librdkafka only allows a single batch in a produce request, unlike most other Kafka client libraries. This significantly cuts down how much data is packed into a single request. Thus, it’s important to increase `batch.size` to even higher values, as it is effectively the limiting factor. librdkafka has a default of 1MB, which typically allows for decent throughput. ### idempotency considerations Disabling idempotency allows you to avoid the in-flight limitation and vastly increases the number of concurrent in-flight requests and throughput. However, running without idempotency can result in duplicate and out-of-order messages, which for most applications is a problem, and is not recommended. In cases where message requirements are fairly lax, it can be a viable alternative. --- # Page 357: Topics Overview **URL**: https://docs.redpanda.com/cloud-data-platform/develop/topics/create-topic.md --- # Topics Overview Topics provide a way to organize events. After creating a cluster, you can create a topic in it. BYOC and Dedicated clusters can have up to 40,000 topics. For Serverless topic and partition limits, see [Serverless usage limits](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/#serverless-usage-limits). Topic properties are populated from information stored in the broker. Redpanda features, such as Tiered Storage, are enabled and configured by default in Redpanda Cloud. You can optionally overwrite some settings. > ⚠️ **WARNING** > > Modifying the properties of topics that are created and managed by Redpanda applications can cause unexpected errors. This may lead to connector and cluster failures. | Property | Description | | --- | --- | | **Partitions** | The number of partitions for the topic. | | **Replication factor** | The number of partition replicas for the topic.
Redpanda Cloud requires a minimum of 3 topic replicas. If a topic is created with a replication factor of 1, Redpanda resets the replication factor to 3. | | **Cleanup policy** | The policy that determines how to clean up old log segments.
The default is **delete**. | | **Retention time** | The maximum length of time to keep messages in a topic.
The default is **7 days**. | | **Retention size** | The maximum size of each partition. If a partition reaches this size and more messages are added, the oldest messages are deleted.
The default is **infinite**. | | **Message size** | The maximum size of a message or batch for a newly-created topic.
The default is **20 MiB** for BYOC and Dedicated clusters, and **8 MiB** for Serverless clusters. You can increase this value up to **32 MiB** for BYOC and Dedicated clusters, and **20 MiB** for Serverless clusters, with the `max.message.bytes` topic property. | | **Segment size** | The maximum size of a log segment. When a segment reaches this size, Redpanda closes it and starts a new one.
Redpanda Cloud sets the segment size for your cluster automatically. You can override it for a topic with the `segment.bytes` property. | ## Next steps - [Manage Topics](https://docs.redpanda.com/cloud-data-platform/develop/topics/config-topics/) - [Manage Cloud Topics](https://docs.redpanda.com/cloud-data-platform/develop/topics/cloud-topics/) - [Topic Configuration Properties](https://docs.redpanda.com/cloud-data-platform/reference/properties/topic-properties/) --- # Page 358: Transactions **URL**: https://docs.redpanda.com/cloud-data-platform/develop/transactions.md --- # Transactions Redpanda supports Apache Kafka®-compatible transaction semantics and APIs. For example, you can fetch messages starting from the last consumed offset and transactionally process them one by one, updating the last consumed offset and producing events at the same time. A transaction can span partitions from different topics, and a topic can be deleted while there are active transactions on one or more of its partitions. In-flight transactions can detect deletion events, remove the deleted partitions (and related messages) from the transaction scope, and commit changes to the remaining partitions. If a producer is sending multiple messages to the same or different partitions, and network connectivity or broker failure cause the transaction to fail, then it’s guaranteed that either all messages are written to the partitions or none. This is important for applications that require strict guarantees, like financial services transactions. Transactions guarantee both exactly-once semantics (EOS) and atomicity: - EOS helps developers avoid the anomalies of at-most-once processing (with potential lost events) and at-least-once processing (with potential duplicated events). Redpanda supports EOS when transactions are used in combination with [idempotent producers](https://docs.redpanda.com/cloud-data-platform/develop/produce-data/idempotent-producers/). - Atomicity additionally commits a set of messages across partitions as a unit: either all messages are committed or none. Encapsulated data received or sent across multiple topics in a single operation can only succeed or fail globally. ## Use transactions By default, the `enable_transactions` cluster configuration property is set to true. However, in the following use cases, clients must explicitly use the Transactions API to perform operations within a transaction: - [Atomic (all or nothing) publishing of multiple messages](#atomic-publishing-of-multiple-messages) - [Exactly-once stream processing](#exactly-once-stream-processing) When you use transactions, you must set the [`transactional.id`](https://kafka.apache.org/documentation/#producerconfigs_transactional.id) property in the producer configuration. This property uniquely identifies the producer and enables reliable semantics across multiple producer sessions. It ensures that all transactions issued by a given producer are completed before any new transactions are started. ### Atomic publishing of multiple messages A banking IT system with an event-sourcing microservice architecture illustrates why transactions are necessary. In this system, each bank branch is implemented as an independent microservice that manages its own distinct set of accounts. Every branch maintains its own transaction history, stored as a Redpanda partition. When a branch starts, it replays the transaction history to reconstruct its current state. Financial transactions such as money transfers require the following guarantees: - A sender can’t withdraw more than the account withdrawal limit. - A recipient receives exactly the same amount sent. - A transaction is fast and is run at most once. - If a transaction fails, the system rolls back to the initial state. - Without withdrawals and deposits, the amount of money in the system remains constant with any history of money transfers. These requirements are easy to satisfy when the sender and the recipient of a financial transaction are hosted by the same branch. The operation doesn’t leave the consistency domain, and all checks and locks can be performed within a single service (ledger). Things get more complex with cross-branch financial transactions, because they involve several ledgers, and the operations should be performed atomically (all or nothing). The default approach (saga pattern) breaks a transaction into a sequence of reversible idempotent steps; however, this violates the isolation principle and adds complexity, making the application responsible for orchestrating the steps. Redpanda natively supports transactions, so it’s possible to atomically update several ledgers at the same time. For example: Show multi-ledger transaction example: ```java Properties props = new Properties(); props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "..."); props.put(ProducerConfig.ACKS_CONFIG, "all"); props.put(ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG, true); props.put(ProducerConfig.TRANSACTIONAL_ID_CONFIG, "app-id"); Producer producer = null; while (true) { // waiting for somebody to initiate a financial transaction var sender_branch = ...; var sender_account = ...; var recipient_branch = ...; var recipient_account = ...; var amount = 42; if (producer == null) { try { producer = new KafkaProducer<>(props); producer.initTransactions(); } catch (Exception e1) { // TIP: log error for further analysis try { if (producer != null) { producer.close(); } } catch(Exception e2) { } producer = null; // TIP: notify the initiator of a transaction about the failure continue; } } producer.beginTransaction(); try { var f1 = producer.send(new ProducerRecord("ledger", sender_branch, sender_account, "" + (-amount))); var f2 = producer.send(new ProducerRecord("ledger", recipient_branch, recipient_account, "" + amount)); f1.get(); f2.get(); } catch (Exception e1) { // TIP: log error for further analysis try { producer.abortTransaction(); } catch (Exception e2) { // TIP: log error for further analysis try { producer.close(); } catch (Exception e3) { } producer = null; } // TIP: notify the initiator of a transaction about the failure continue; } try { producer.commitTransaction(); } catch (Exception e1) { try { producer.close(); } catch (Exception e3) {} producer = null; // TIP: notify the initiator of a transaction about the failure continue; } // TIP: notify the initiator of a transaction about the success } ``` When a transaction fails before a `commitTransaction` attempt completes, you can assume that it is not executed. When a transaction fails after a `commitTransaction` attempt completes, the true transaction status is unknown. Redpanda only guarantees that there isn’t a partial result: either the transaction is committed and complete, or it is fully rolled back. ### Exactly-once stream processing Redpanda is commonly used as a pipe connecting different applications and storage systems. An application could use an OLTP database and then rely on change data capture to deliver the changes to a data warehouse. Redpanda transactions let you use streams as a smart pipe in your applications, building complex atomic operations that transform, aggregate, or otherwise process data transiting between external applications and storage systems. For example, here is the regular pipe flow: ``` Postgresql -> topic -> warehouse ``` Here is the smart pipe flow, with a transformation in `topic(1) -> topic(2)`: ``` Postgresql -> topic(1) transform topic(2) -> warehouse ``` The transformation reads a record from `topic(1)`, processes it, and writes it to `topic(2)`. Without transactions, an intermittent error can cause a message to be lost or processed several times. With transactions, Redpanda guarantees exactly-once semantics. For example: Show exactly-once processing example: ```java var source = "source-topic"; var target = "target-topic"; Properties pprops = new Properties(); pprops.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "..."); pprops.put(ProducerConfig.ACKS_CONFIG, "all"); pprops.put(ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG, true); pprops.put(ProducerConfig.TRANSACTIONAL_ID_CONFIG, UUID.randomUUID().toString()); Properties cprops = new Properties(); cprops.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "..."); cprops.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false); cprops.put(ConsumerConfig.GROUP_ID_CONFIG, "app-id"); cprops.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest"); cprops.put(ConsumerConfig.ISOLATION_LEVEL_CONFIG, "read_committed"); Consumer consumer = null; Producer producer = null; boolean should_reset = false; while (true) { if (should_reset) { should_reset = false; if (consumer != null) { try { consumer.close(); } catch(Exception e) {} consumer = null; } if (producer != null) { try { producer.close(); } catch (Exception e2) {} producer = null; } } try { if (consumer == null) { consumer = new KafkaConsumer<>(cprops); consumer.subscribe(Collections.singleton(source)); } } catch (Exception e1) { // TIP: log error for further analysis should_reset = true; continue; } try { if (producer == null) { producer = new KafkaProducer<>(pprops); producer.initTransactions(); } } catch (Exception e1) { // TIP: log error for further analysis should_reset = true; continue; } ConsumerRecords records = null; try { records = consumer.poll(Duration.ofMillis(10000)); } catch (Exception e1) { // TIP: log error for further analysis should_reset = true; continue; } var it = records.iterator(); while (it.hasNext()) { var record = it.next(); // transformation var old_value = record.value(); var new_value = old_value.toUpperCase(); try { producer.beginTransaction(); producer.send(new ProducerRecord(target, record.key(), new_value)); var offsets = new HashMap(); offsets.put(new TopicPartition(source, record.partition()), new OffsetAndMetadata(record.offset() + 1)); producer.sendOffsetsToTransaction(offsets, consumer.groupMetadata()); } catch (Exception e1) { // TIP: log error for further analysis try { producer.abortTransaction(); } catch (Exception e2) { } should_reset = true; break; } try { producer.commitTransaction(); } catch (Exception e1) { // TIP: log error for further analysis should_reset = true; break; } } } ``` #### Exactly-once processing configuration requirements Redpanda’s default configuration supports exactly-once processing. To preserve this capability, ensure the following settings are maintained: - `enable_idempotence = true` - `enable_transactions = true` - `transaction_coordinator_delete_retention_ms` is greater than or equal to `transactional_id_expiration_ms` ## Best practices To help avoid common pitfalls and optimize performance, consider the following when configuring transactional workloads in Redpanda: ### Tune producer ID limits Redpanda Cloud manages the producer ID limits (`max_concurrent_producer_ids` and `transactional_id_expiration_ms`) and the connection limit (`kafka_connections_max`). If your workload needs different limits, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). Client applications should minimize producer ID churn. Reuse producer instances when possible, instead of creating new ones for each operation. Avoid using random transactional IDs, as some Flink configurations do, because this creates excessive producer ID churn. Instead, use consistent transactional IDs that can be resumed across application restarts. ### Configure transaction timeouts and limits - If a consumer is configured to use the read_committed isolation level, it can only process successfully committed transactions. As a result, an ongoing transaction with a large timeout that becomes stuck could prevent the consumer from processing other committed transactions. To avoid this, don’t set the transaction timeout client setting (`transaction.timeout.ms` in the Kafka Java client implementation) to a value that is too high. The longer the timeout, the longer consumers may be blocked. ## Handle transaction failures Different transactions require different approaches to handling failures within the application. Consider the approaches to failed or timed-out transactions in the provided use cases: - Publishing of multiple messages: The request came from outside the system, and it is the application’s responsibility to discover the true status of a timed-out transaction. (This example doesn’t use consumer groups to distribute partitions between consumers.) - Exactly-once streaming (consume-transform-loop): This is a closed system. Upon re-initialization of the consumer and producer, the system automatically discovers the moment it was interrupted and continues from that place. Additionally, this automatically scales by the number of partitions. Run another instance of the application, and it starts processing its share of partitions in the source topic. ## Transactions with compacted segments Transactions are supported on topics with compaction configured. The compaction process removes aborted transaction data from the log. The resulting compacted segment contains only committed data batches (and potentially harmless gaps in the offsets due to skipped batches). ## Suggested reading - [Kafka-compatible fast distributed transactions](https://redpanda.com/blog/fast-transactions) --- # Page 359: Get Started **URL**: https://docs.redpanda.com/cloud-data-platform/get-started.md --- # Get Started - [What’s New in Redpanda Cloud](https://docs.redpanda.com/cloud-data-platform/get-started/whats-new-cloud/) Summary of new features in Redpanda Cloud. - [Redpanda Cloud Overview](https://docs.redpanda.com/cloud-data-platform/get-started/cloud-overview/) Learn about Redpanda Cloud deployment options, including BYOC and Serverless clusters. - [BYOC Architecture](https://docs.redpanda.com/cloud-data-platform/get-started/byoc-arch/) Learn about the control plane - data plane architecture in BYOC. --- # Page 360: How Redpanda Works **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/architecture.md --- # How Redpanda Works At its core, Redpanda is a fault-tolerant transaction log for storing event streams. Producers and consumers interact with Redpanda using the Kafka API. To achieve high scalability, producers and consumers are fully decoupled. Redpanda provides strong guarantees to producers that events are stored durably within the system, and consumers can subscribe to Redpanda and read the events asynchronously. Redpanda achieves this decoupling by organizing events into topics. Topics represent a logical grouping of events that are written to the same log. A topic can have multiple producers writing events to it and multiple consumers reading events from it. This page provides details about how Redpanda works. For a high-level overview, see [Introduction to Redpanda](https://docs.redpanda.com/cloud-data-platform/get-started/intro-to-events/). ## Tiered Storage Redpanda Tiered Storage is a multi-tiered object storage solution that provides the ability to offload log segments to object storage in near real time. Tiered Storage can be combined with local storage to provide long-term data retention and disaster recovery on a per-topic basis. Consumers that read from more recent offsets continue to read from local storage, and consumers that read from historical offsets read from object storage, all with the same API. Consumers can read and reread events from any point within the maximum retention period, whether the events reside on local or object storage. As data in object storage grows, the metadata for it grows. To support efficient long-term data retention, Redpanda splits the metadata in object storage, maintaining metadata of only recently-updated segments in memory or local disk, while safely archiving the remaining metadata in object storage and caching it locally on disk. Archived metadata is then loaded only when historical data is accessed. This allows Tiered Storage to handle partitions of virtually any size or retention length. ## Partitions To scale topics, Redpanda shards them into one or more partitions that are distributed across the nodes in a cluster. This allows for concurrent writing and reading from multiple nodes. When producers write to a topic, they route events to one of the topic’s partitions. Events with the same key (like a stock ticker) are always routed to the same partition, and Redpanda guarantees the order of events at the partition level. Consumers read events from a partition in the order that they were written. If a key is not specified, then events are sent to all topic partitions in a round-robin fashion. ## Raft consensus algorithm Redpanda provides strong guarantees for data safety and fault tolerance. Events written to a topic partition are appended to a log file on disk. They can be replicated to other nodes in the cluster and appended to their copies of the log file on disk to prevent data loss in the event of failure. The [Raft consensus algorithm](https://raft.github.io/) is used for data replication. Every topic partition forms a Raft group consisting of a single elected leader and zero or more followers (as specified by the topic’s replication factor). A Raft group can tolerate ƒ failures given 2ƒ+1 nodes. For example, in a cluster with five nodes and a topic with a replication factor of five, the topic remains fully operational if two nodes fail. Raft is a majority vote algorithm. For a leader to acknowledge that an event has been committed to a partition, a majority of its replicas must have written that event to their copy of the log. When a majority (quorum) of responses have been received, the leader can make the event available to consumers and acknowledge receipt of the event when `acks=all (-1)`. [Producer acknowledgement settings](https://docs.redpanda.com/cloud-data-platform/develop/produce-data/configure-producers/#producer-acknowledgement-settings) define how producers and leaders communicate their status while transferring data. As long as the leader and a majority of the replicas are stable, Redpanda can tolerate disturbances in a minority of the replicas. If [gray failures](https://blog.acolyer.org/2017/06/15/gray-failure-the-achilles-heel-of-cloud-scale-systems/) cause a minority of replicas to respond slower than normal, then the leader does not have to wait for their responses to progress, and any additional latency is not passed on to the clients. The result is that Redpanda is less sensitive to faults and can deliver predictable performance. ## Partition leadership elections [Raft](https://raft.github.io/) uses a heartbeat mechanism to maintain leader authority and to trigger leader elections. The partition leader sends a heartbeat to all followers every 150 milliseconds to assert its leadership in the current term (an election cycle). If a follower does not receive a heartbeat within the election timeout, it triggers an election to choose a new partition leader. Configure the election timeout with the [`election_timeout_ms`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#election_timeout_ms) cluster property (default: 1500 milliseconds). The follower increments its term and votes for itself to be the leader for that term. It then sends a vote request to the other nodes and waits for one of the following scenarios: - It receives a majority of votes and becomes the leader. Raft guarantees that at most one candidate can be elected the leader for a given term. - Another follower establishes itself as the leader. While waiting for votes, the candidate may receive communication from another node in the group claiming to be the leader. The candidate only accepts the claim if its term is greater than or equal to the candidate’s term; otherwise, the communication is rejected and the candidate continues to wait for votes. - No leader is elected over a period of time. If multiple followers timeout and become election candidates at the same time, it’s possible that no candidate gets a majority of votes. When this happens, each candidate increments its term and triggers a new election round. Raft uses a random timeout between 150-300 milliseconds to ensure that split votes are rare and resolved quickly. As long as there is a timing inequality between heartbeat time, election timeout, and mean time between node failures (MTBF), then Raft can elect and maintain a steady leader and make progress. A leader can maintain its position as long as one of the ten heartbeat messages it sends to all of its followers every 1.5 seconds is received; otherwise, a new leader is elected. If a follower triggers an election, but the incumbent leader subsequently springs back to life and starts sending data again, then it’s too late. As part of the election process, the follower (now an election candidate) incremented the term and rejects requests from the previous term, essentially forcing a leadership change. If a cluster is experiencing wider network infrastructure problems that result in latencies above the heartbeat timeout, then back-to-back election rounds can be triggered. During this period, unstable Raft groups may not be able to form a quorum. This results in partitions rejecting writes, but data previously written to disk is not lost. Redpanda has a Raft-priority implementation that allows the system to settle quickly after network outages. ## Controller partition and snapshots Redpanda stores metadata update commands (such as creating and deleting topics or users) in a system partition called the controller partition. A new snapshot is created after each controller command is added, or, with rapid updates, after a set period of time (default is 60 seconds). Controller snapshots save the current cluster metadata state to disk, so startup is fast. For example, with a partition that has moved several times, a snapshot can restore the latest state without replaying every move command. Each broker has a snapshot file stored in the controller log directory, such as `/var/lib/redpanda/data/redpanda/controller/0_0/snapshot`. The controller partition is replicated by a Raft group that includes all cluster brokers, and the controller snapshot is the Raft snapshot for this group. Snapshots are hydrated when a broker joins the cluster or restarts. Snapshots are enabled by default for all clusters, both new and upgraded. ## Optimized platform performance Redpanda is designed to exploit advances in modern hardware, from the network down to the disks. Network bandwidth has increased considerably, especially in object storage, and spinning disks have been replaced by SSD devices that deliver better I/O performance. CPUs are faster too, but this is largely due to the increased core counts as opposed to the increase in single-core speeds. Redpanda has tuners that detect your hardware configuration to automatically optimize itself. Examples of platform and kernel features that Redpanda uses to optimize its performance: - Direct Memory Access (DMA) for disk I/O - Sparse file system support with XFS - Distribution of interrupt request (IRQ) processing between CPU cores - Isolated processes with control groups (cgroups) - Disabled CPU power-saving modes - Upfront memory allocation, partitioned and pinned to CPU cores ## Thread-per-core model Redpanda implements a thread-per-core programming model through its use of the [Seastar](https://seastar.io/) library. This allows Redpanda to pin each of its application threads to a CPU core to avoid context switching and blocking. It combines this with message passing to asynchronously communicate between the pinned threads. With this, Redpanda avoids the overhead of context switching and expensive locking operations to improve processing performance and efficiency. From a sizing perspective, Redpanda’s ability to efficiently use all available hardware enables it to scale up to get the most out of your infrastructure, before you’re forced to scale out to meet the demands of your workload. Redpanda delivers better performance with a smaller footprint, resulting in reduced operational costs and complexity. --- # Page 361: BYOC Architecture **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/byoc-arch.md --- # BYOC Architecture With Bring Your Own Cloud (BYOC) clusters, you deploy Redpanda in your own cloud (AWS, Azure, or GCP), and all data is contained in your own environment. This provides an additional layer of security and isolation. Redpanda handles provisioning, operations, and maintenance of the underlying infrastructure, including Kubernetes. ## Control plane - data plane For high availability, Redpanda Cloud uses the following control plane - data plane architecture: ![Control plane and data plane](https://docs.redpanda.com/cloud-data-platform/shared/_images/control_d_plane.png) - **Control plane**: This is a Redpanda Cloud managed service that manages provisioning, operations, and maintenance of clusters with Kubernetes under the hood, including Kubernetes version upgrades and infrastructure maintenance. The control plane enforces rules in the data plane. You can use [RBAC](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac/) or [GBAC](https://docs.redpanda.com/cloud-data-platform/security/authorization/gbac/gbac/) in the control plane to manage access to organization-level resources like clusters, resource groups, and networks. - **Data plane**: This is where your cluster lives. The term _data plane_ is sometimes used interchangeably with _cluster_. The data plane is where you manage topics, consumer groups, connectors, and schemas. You can use [RBAC](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac_dp/) or [GBAC](https://docs.redpanda.com/cloud-data-platform/security/authorization/gbac/gbac_dp/) in the data plane to configure cluster-level permissions for provisioned users at scale. IAM permissions allow the Redpanda Cloud agent to access the cloud provider API to create and manage cluster resources. The permissions follow the principle of least privilege, limiting access to only what is necessary. Clusters are configured and maintained in the control plane, but they remain available even if the network connection to the control plane is lost. > 💡 **TIP** > > In the Redpanda Cloud UI, you can identify which plane you’re in by the side navigation: > > - **Control Plane:** Visible after login at the organization level. Here you can select, create, and delete clusters, networks, and resource groups. > > - **Data Plane:** Visible after selecting a specific cluster. Here you can work with topics, consumer groups, connectors, and schemas. ## BYOC setup In a BYOC architecture, you deploy the data plane in your own VPC. All network connections into the data plane take place through either a public endpoint, or for private clusters, through Redpanda Cloud network connections such as VPC peering, AWS PrivateLink, Azure Private Link, or GCP Private Service Connect. Customer data never leaves the data plane. A BYOC cluster is initially set up from the control plane. This is a two-step process performed by `rpk cloud byoc apply`, where `` is `aws`, `gcp`, or `azure`: 1. You bootstrap a virtual machine (VM) in your VPC. This VM launches the agent and bootstraps the necessary infrastructure. Redpanda then assigns fine-grained IAM policies following least privilege, creating dedicated IAM roles per workload with only the permissions each requires. 2. The agent communicates with the control plane to pull the cluster specifications. After the agent is up and running, it connects to the control plane and starts dequeuing and applying cluster specifications that provision, configure, and maintain clusters. The agent is in constant communication with the control plane, receiving and applying cluster specifications and exchanging cluster metadata. Agents are authenticated and authorized through opaque and ephemeral tokens, and they have dedicated job queues in the control plane. Agents also manage VPC peering networks. ![cloud_byoc_apply](https://docs.redpanda.com/cloud-data-platform/shared/_images/byoc_apply.png) > 📝 **NOTE** > > To create a Redpanda cluster in your virtual private cloud (VPC), follow the instructions in the Redpanda Cloud UI. The UI contains the parameters necessary to successfully run `rpk cloud byoc apply` with your cloud provider. > 📝 **NOTE** > > Redpanda Cloud does not support customer access or modifications to any of the internal data plane resources. This restriction allows Redpanda Data to manage all configuration changes internally to ensure a 99.99% service level agreement (SLA) for BYOC clusters. ## Next steps - [Choose Between BYOC and BYOVPC](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/choose-byoc-or-byovpc/) - [Redpanda Access to Your Environment](https://docs.redpanda.com/cloud-data-platform/security/redpanda-access/) --- # Page 362: Redpanda Cloud Overview **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cloud-overview.md --- # Redpanda Cloud Overview Redpanda Cloud is a complete data streaming platform delivered as a fully-managed service. It provides automated upgrades and patching, data balancing, and support while continuously monitoring your data to meet strict performance, availability, reliability, and security requirements. All Redpanda Cloud clusters are deployed with an integrated [Redpanda Console](https://docs.redpanda.com/home/glossary/#redpanda-console), and all clusters have access to unlimited retention and 300+ data connectors with [Redpanda Connect](https://docs.redpanda.com/home/glossary/#redpanda-connect). ## Redpanda Cloud deployment options Redpanda Cloud offers the following fully-managed deployment options: - **[Bring Your Own Cloud (BYOC)](#bring-your-own-cloud-byoc)**: Maximum control and security by deploying in your own cloud environment - **[Serverless](#serverless)**: Fastest way to get started with automatic scaling If you have an existing Dedicated cluster, see [Dedicated clusters](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/create-dedicated-cloud-cluster/). ### Quick comparison | | BYOC | Serverless | | --- | --- | --- | | **Best for** | Production clusters requiring data sovereignty, the highest throughput, and added security | Starter projects and applications with low or variable traffic | | **Deployment** | Your cloud account (AWS/Azure/GCP) | Redpanda’s cloud (AWS/GCP) | | **Tenancy** | Single-tenant | Multi-tenant | | **[Cloud SLA](https://www.redpanda.com/legal/redpanda-cloud-service-level-agreement)** | 99.99%, multi-AZ | 99.9% | | **Max throughput (write, read)** | Up to 2 GB/s, 4 GB/s | Up to 100 MB/s, 300 MB/s | | **Partitions, pre-replication** | Up to 112,500 | Up to 5,000 | | **Max message size (MiB)** | 20 (default), 32 (max) | 8 (default), 20 (max) | | **Private networking** | ✓ | ✓ | | **SSO authentication** | ✓ (GitHub, Google, OIDC) | ✓ (GitHub, Google, OIDC) | | **Redpanda Connect** | ✓ | ✓ | | **Role-based access control (RBAC) & audit logs** | ✓ | ✗ | | **Group-based access control (GBAC)** | ✓ | ✗ | | **Prometheus/OpenMetrics endpoint for cluster metrics** | ✓ | ✓ | | **Multiple availability zones (AZs)** | ✓ | ✗ | | **Cluster properties editing** | ✓ (AWS/GCP) | ✗ | | **Redpanda Support** | Enterprise support for BYOC; Premium support required for BYOVPC/BYOVNet | Enterprise support with annual contracts | > 📝 **NOTE** > > - The partition limit is the number of logical partitions before replication occurs. Redpanda Cloud uses a replication factor of three. > > - SSO is configured for your organization and applies to every cluster in it, whatever the cluster type. See [Single sign-on](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/#single-sign-on). > > - Enterprise support provides access to streaming experts 24/5, with 24/7 priority escalation for production outages. Premium support provides an enhanced Support SLA. > > - See also: [Serverless vs BYOC](#serverless-vs-byoc) ### Bring Your Own Cloud (BYOC) With BYOC clusters, you deploy the Redpanda [data plane](https://docs.redpanda.com/home/glossary/#data-plane) into a dedicated VPC (for AWS and GCP) or VNet (for Azure) in your own cloud account, and all data is contained in your own environment. This provides an additional layer of security and isolation. (See [BYOC Architecture](https://docs.redpanda.com/cloud-data-platform/get-started/byoc-arch/).) Redpanda manages provisioning, monitoring, upgrades, and security policies, including the underlying infrastructure and Kubernetes used to run the cluster. Redpanda also manages required resources in your VPC or VNet, including subnets (subnetworks in GCP), IAM roles, and object storage resources (for example, S3 buckets or Azure Storage accounts). For full details, see [Upgrades and Maintenance](https://docs.redpanda.com/cloud-data-platform/manage/maintenance/). #### Bring Your Own VPC/VNet (BYOVPC/BYOVNet) With BYOVPC/BYOVNet clusters, you take full control of the networking lifecycle. Compared to standard BYOC, BYOVPC/BYOVNet provides more security, but the configuration is more complex. See the [shared responsibility model](#shared-responsibility-model) to understand what you manage versus what Redpanda manages. To compare the two variants, see [Choose Between BYOC and BYOVPC](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/choose-byoc-or-byovpc/). The BYOC infrastructure that Redpanda manages should not be used to deploy any other workloads. For details about the control plane - data plane framework in BYOC, see [BYOC architecture](https://docs.redpanda.com/cloud-data-platform/get-started/byoc-arch/). #### Sign up for BYOC To start using BYOC, contact [Redpanda sales](https://redpanda.com/try-redpanda?section=enterprise-trial) to request a private offer with possible discounts. You are billed directly or through Google Cloud Marketplace or AWS Marketplace. ### Serverless Serverless is the fastest and easiest way to start data streaming. With Serverless clusters, you host your data in Redpanda’s VPC, and Redpanda handles automatic scaling, provisioning, operations, and maintenance. This is a production-ready deployment option with a cluster available instantly, and you only pay for what you consume. > 📝 **NOTE** > > - Serverless on GCP is currently in a [beta](https://docs.redpanda.com/home/glossary/#beta) release. #### Sign up for Serverless ##### Free trial A [free trial on AWS](https://www.redpanda.com/try-redpanda) is the fastest way to get started with Serverless. Each free-trial customer qualifies for $100 (USD) in credits to spend in the first 30 days. This should be enough to run Redpanda with reasonable throughput. No credit card is required. To continue using Serverless after your trial expires, you can enter a credit card and pay as you go. Any remaining credit balance is used before you are charged. When either the credits expire or the days in the trial expire, the clusters move into a suspended state, and you won’t be able to access your data in either the Redpanda Cloud Console or with the Kafka API. There is a seven-day grace period following the end of the trial when you can add your credit card and restore service. After that, the data is permanently deleted. For questions about the trial, ask in the [Redpanda community on GitHub](https://github.com/redpanda-data/community). After you start a trial, Redpanda instantly prepares an account for you. The first time you sign in, you can answer a few quick questions about your project so Redpanda can tailor your experience. Your account includes a `welcome` cluster with a `hello-world` demo topic you can explore. It includes sample data so you can see how real-time messaging works before sending your own data. On that first visit, the **Overview** page shows a **Get started** option with guided ways to [interact with your cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/#interact-with-your-cluster): create a Redpanda Connect [pipeline](https://docs.redpanda.com/home/glossary/#pipeline), use `rpk` from the command line, or connect with your own Kafka client. To get started with `rpk`: 1. Log in with `rpk cloud login`. 2. Consume from the `hello-world` topic with `rpk topic consume hello-world`. 3. In the [Redpanda Cloud Console](https://cloud.redpanda.com), navigate to the **Topics** page and open the `hello-world` topic to see the included messages. ##### Redpanda Sales To request a private offer with possible discounts for annual committed use, contact [Redpanda Sales](https://www.redpanda.com/price-estimator). When you subscribe to Serverless through Redpanda Sales, you gain immediate access to Enterprise support. Redpanda creates a cloud organization for you and sends you a welcome email. ##### AWS Marketplace New subscriptions to Redpanda Cloud through [AWS Marketplace](https://docs.redpanda.com/cloud-data-platform/billing/aws-pay-as-you-go/) receive $300 (USD) in free credits to spend in the first 30 days. AWS Marketplace charges for anything beyond $300, unless you cancel the subscription. After your free credits have been used, you can continue using your cluster without any commitment, only paying for what you consume and canceling anytime. > 📝 **NOTE** > > When you subscribe to Redpanda through AWS Marketplace, you do not have immediate access to Enterprise support, only the [Redpanda community on GitHub](https://github.com/redpanda-data/community). For Enterprise support, contact [Redpanda Sales](https://www.redpanda.com/price-estimator). Redpanda creates a cloud organization for you and sends you a welcome email. ##### Google Cloud Marketplace New subscriptions to Redpanda Cloud through [Google Cloud Marketplace](https://docs.redpanda.com/cloud-data-platform/billing/gcp-pay-as-you-go/) receive $300 (USD) in free credits to spend in the first 30 days. Google Cloud Marketplace charges for anything beyond $300, unless you cancel the subscription. After your free credits have been used, you can continue using your cluster without any commitment, only paying for what you consume and canceling anytime. > 📝 **NOTE** > > When you subscribe to Redpanda through Google Cloud Marketplace, you do not have immediate access to Enterprise support, only the [Redpanda community on GitHub](https://github.com/redpanda-data/community). For Enterprise support, contact [Redpanda Sales](https://www.redpanda.com/price-estimator). Redpanda creates a cloud organization for you and sends you a welcome email. ### Serverless vs BYOC Serverless clusters are a good fit for the following use cases: - Quick setup for development or testing - Variable or unpredictable traffic patterns - No upfront cost commitment - Isolated environments for different applications Consider BYOC if you need more control over the deployment or if you have workloads with consistently-high throughput. BYOC clusters offer the following features: - Multiple availability zones (AZs). A multi-AZ cluster provides higher resiliency in the event of a failure in one of the zones. - Role-based access control (RBAC) in the data plane - Group-based access control (GBAC) - Higher limits and quotas. See [BYOC usage tiers](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/) compared to [Serverless limits](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/#serverless-usage-limits). ## Redpanda Cloud architecture When you sign up for a Redpanda account, Redpanda creates an organization for you. Your organization contains all your Redpanda resources, including your clusters and networks. Within your organization, Redpanda creates a default resource group to contain your resources. You can rename this resource group, and you can create more resource groups. For example, you may want different resource groups for production and testing. > 💡 **TIP** > > For more detailed information about the Redpanda platform, see [Introduction to Redpanda](https://docs.redpanda.com/cloud-data-platform/get-started/intro-to-events/) and [How Redpanda Works](https://docs.redpanda.com/cloud-data-platform/get-started/architecture/). ## Shared responsibility model The Redpanda Cloud shared responsibility model lists the security areas owned by Redpanda and the security areas owned by customers. Responsibilities depend on the type of deployment. For Dedicated clusters, see [Shared responsibility model for Dedicated](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/create-dedicated-cloud-cluster/#shared-responsibility-model). For a summary of this split alongside the rest of the Redpanda Cloud security model, see [Redpanda Cloud Security Overview](https://docs.redpanda.com/cloud-data-platform/security/cloud-security-overview/). For what Redpanda can and cannot access in your own cloud account, see [Redpanda Access to Your Environment](https://docs.redpanda.com/cloud-data-platform/security/redpanda-access/). ### BYOC | Resource | Redpanda responsibility | Customer responsibility | | --- | --- | --- | | Redpanda upgrades and hotfixes | ✓ | | | Cost management and attribution | ✓ | ✓ | | Software vulnerability remediation | ✓ | | | Infrastructure vulnerability remediation | ✓ | | | IAM (roles, service accounts, access segmentation) | ✓ | ✓ | | Compute | ✓ | | | Redpanda agent VM maintenance | ✓ | | | VPC (subnets, routing, firewall) | ✓ | ✓ | | VPC peering | | ✓ | | VPC private links (service endpoint) | ✓ | | | VPC private links (consumer endpoint) | | ✓ | | Local storage | ✓ | | | Tiered Storage | ✓ | | | Control plane | ✓ | | | Access controls and audit | ✓ | ✓ | | Managed disaster recovery | | ✓ | | Observability and monitoring (SLOs, SLIs, tracing, alerting, runbooks) | ✓ | | | Availability service-level agreement (SLA) | ✓ (subject to required access to customer resources) | | | Proactive threat detection | ✓ | ✓ | | Static secret rotation | ✓ | | | Incident response | ✓ | | | Resilience verification | ✓ | | ### BYOVPC/BYOVNet | Resource | Redpanda responsibility | Customer responsibility | | --- | --- | --- | | Redpanda upgrades and hotfixes | ✓ | | | Cost management and attribution | ✓ | ✓ | | Software vulnerability remediation | ✓ | | | Infrastructure vulnerability remediation | ✓ | ✓ | | IAM (roles, service accounts, access segmentation) | | ✓ | | Compute | ✓ | | | Redpanda agent VM maintenance | ✓ | | | VPC (subnets, routing, firewall) | | ✓ | | VPC peering | | ✓ | | VPC private links (service endpoint) | ✓ | | | VPC private links (consumer endpoint) | | ✓ | | Local storage | ✓ | | | Tiered Storage | | ✓ | | Control plane | ✓ | | | Access controls and audit | ✓ | ✓ | | Managed disaster recovery | | ✓ | | Observability and monitoring (SLOs, SLIs, tracing, alerting, runbooks) | ✓ | ✓ (for VPC components and cloud storage buckets/containers managed by customer) | | Availability SLA | ✓ (subject to required access to customer resources) | ✓ | | Proactive threat detection | ✓ | ✓ | | Static secret rotation | ✓ | ✓ | | Incident response | ✓ | | | Resilience verification | ✓ | | ## Redpanda Connect [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/) lets you compose pipelines from a rich library of inputs, processors, and outputs with strong metrics, logging, and per-pipeline scaling. To try it, see the [quickstart](https://docs.redpanda.com/cloud-data-platform/develop/connect/connect-quickstart/). | | Data transforms | Redpanda Connect | | --- | --- | --- | | Best for | Simple, stateless, per-record normalization inside Redpanda | Enrichment/lookup with external services; multi-stage flows | | External I/O | Not permitted (sandboxed) | Native (HTTP/database/object storage) | | Topology | 1:1 or 1:N (no cross-topic fan-in) | Fan-in and fan-out; multi-step pipelines | | Ordering | Preserves per-partition order | Per-partition order can be preserved; configure parallelism and batching accordingly | | Scale & isolation | Shares broker CPU/memory; best for lightweight operations | Scales independently; isolates heavy work from brokers | | Failure handling | You code routing/error behavior | Built-in retries/backoff and DLQ patterns | > 💡 **TIP** > > - Use data transforms for simple, in-broker, per-record changes with minimal latency. > > - Use Redpanda Connect if your pipeline must talk to external systems (HTTP services, databases, cloud storage), or when you need advanced flow control, such as batching and windowed processing. ### Redpanda Connect vs data transforms [Data transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/how-transforms-work/) (Wasm) provide lightweight, per-record changes between Redpanda topics with minimal latency. Transforms run inside the broker, map one input topic to one or more output topics, and are intentionally sandboxed (no external network or disk access). They’re ideal for validation, redaction, format/schema conversion, and simple routing. ## Redpanda Cloud vs Self-Managed feature compatibility Because Redpanda Cloud is a fully-managed service that provides maintenance, data and partition balancing, upgrades, and recovery, much of the cluster maintenance required for Self-Managed users is not necessary for Redpanda Cloud users. Also, Redpanda Cloud is opinionated about Kafka configurations. For example, automatic topic creation is disabled. Some systems expect the Kafka service to automatically create topics when a message is produced to a topic that doesn’t exist. (You can enable this for BYOC clusters with the `auto_create_topics_enabled` cluster property.) New clusters in Redpanda Cloud generally include functionality added in Self-Managed versions immediately. Existing clusters include new functionality when they get upgraded to the latest version. Redpanda Cloud deployments do not support the following functionality available in Redpanda Self-Managed deployments: - Kafka API OIDC authentication. However, Redpanda Cloud does support [SSO to the Redpanda Cloud UI](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/#single-sign-on). - Admin API. - FIPS-compliance mode. - Kerberos authentication. - Redpanda debug bundles. - Redpanda Console topic documentation. - Manual deserialization of Schema Registry - Configuring access to object storage with customer-managed encryption key. - Kubernetes Helm chart and Redpanda Operator functionality. - The following `rpk` commands: - `rpk cluster health` - `rpk cluster license` - `rpk cluster maintenance` - `rpk cluster partitions` - `rpk cluster self-test` - `rpk cluster storage restore` (But `rpk cluster storage` and subcommands for mountable topics are supported in BYOC clusters) - `rpk connect` - `rpk container` - `rpk debug` - `rpk generate app` (This is supported in Serverless clusters only.) - `rpk iotune` - `rpk redpanda` - `rpk topic describe-storage` (All other `rpk topic` commands are supported on both Redpanda Cloud and Self Managed.) > 📝 **NOTE** > > The `rpk cloud` commands are not supported in Self-Managed deployments. ## Suggested videos - [YouTube - What is Redpanda BYOC? (3 mins)](https://www.youtube.com/watch?v=gVlzsJAYT64&ab_channel=RedpandaData) ## Next steps - [Learn about Redpanda Cloud security](https://docs.redpanda.com/cloud-data-platform/security/cloud-security-overview/) - [Learn about upgrades and maintenance](https://docs.redpanda.com/cloud-data-platform/manage/maintenance/) - [Create a Serverless cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/) - [Create a BYOC cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/) --- # Page 363: Cluster Overview **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-overview.md --- # Cluster Overview This reference describes the overview page for BYOC and Serverless clusters in the Redpanda Cloud Console. The overview page is the first place to check the health of a cluster and to copy the connection details that clients need to reach it. Use this reference to: - Locate connection endpoints and the cluster ID on the overview page - Locate the source of a cluster health warning - Identify which product cards support self-service setup > 📝 **NOTE** > > On Dedicated clusters, the cluster ID is in the **Details** section of the overview page, and connection URLs are in the **How to connect** section. ## Page header The header identifies the cluster and summarizes its state: - The line above the cluster name shows the cluster type, the network access type (public or private), and the cluster ID. Click the copy icon next to the ID to copy it. - Next to the cluster name, a health indicator shows **All systems healthy** when everything is running normally. When a product reports a problem, a **Needs attention** indicator appears instead. See [Health and warnings](#health). - Header stats show the cloud provider and region, the availability zones, and the network name. - The **Get started** menu opens quickstart shortcuts, such as connecting data sources, streaming from the command line, and querying streams with SQL. ## Health and warnings When one or more products on the cluster report a problem, the **Needs attention** indicator next to the cluster name expands into an entry for each affected product with a count of its issues. Click an entry to jump to that product’s card and open its **Needs attention** section, which describes each issue in detail. Product cards also show status badges, such as **Unavailable**, **Metrics unavailable**, or **Awaiting metrics**, when a product or its metrics cannot be reached. > 📝 **NOTE** > > On clusters with private networking, live product stats are read from inside the cluster’s network. To see them, open the page from a host connected to your private network. ## How to connect The **How to connect** panel lists the details clients need to reach the cluster: - **Streaming**: bootstrap servers, Schema Registry endpoint, HTTP Proxy endpoint (BYOC only), Admin API endpoint, Redpanda Console URL, and the supported SASL mechanisms. - **SQL** (shown when Redpanda SQL is enabled): connection details for the PostgreSQL-compatible SQL engine. - **Prometheus**: the metrics endpoint and scrape configuration for monitoring tools. See [Monitor Redpanda Cloud](https://docs.redpanda.com/cloud-data-platform/manage/monitor-cloud/). The endpoints shown reflect your cluster’s network configuration: on a cluster with private networking, the panel lists private endpoints, which are reachable only from inside your connected network. On Serverless clusters with private access enabled, the private bootstrap URL and private Schema Registry endpoint appear alongside the public ones. On Serverless clusters, the **Manage credentials** link on the **Streaming** tab opens the cluster’s security pages, where you manage users and ACLs. ## Product cards Each product on the cluster has a card summarizing its status: - **Redpanda Streaming**: broker count, topics, client connections, and recent throughput, with an expandable list of the largest topics. - **Redpanda Connect**: pipeline status. Expand **Pipelines** to see each pipeline’s input, output, and state. - **Iceberg Topics**: table count, rows per hour, backlog, and dead letter queue rows, plus storage and catalog details. - **Redpanda SQL**: engine status, active sessions, queries per minute, and node count. - **Shadow link**: status of shadow links that mirror topics from another cluster. Serverless clusters show the **Redpanda Streaming** and **Redpanda Connect** cards. The other cards appear on BYOC clusters. The card states described on this page apply to both cluster types. If a product is not yet set up on the cluster, its card explains what the product does and why you might want it, links to the product’s documentation, and shows the next step: - If you can set up or enable the product yourself, the card offers the action directly: create a [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/) pipeline, enable or materialize an [Iceberg](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/) topic, [enable Redpanda SQL](https://docs.redpanda.com/cloud-data-platform/sql/get-started/deploy-sql-cluster/), or create a [shadow link](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/). - If your role does not allow enabling the product, the card tells you to ask an administrator of your organization. - If the product is not included in the cluster’s plan, the card says so and links to the plan limits. ## Network card BYOC clusters show a card named for the cluster’s network access: **Private network**, **Public network**, or **BYOVPC network**. The card provides: - Private connectivity options for the cluster’s cloud provider: AWS PrivateLink, AWS Transit Gateway, and VPC peering on AWS; Azure Private Link and VNet peering on Azure; Private Service Connect and VPC peering on GCP. Configured connections appear as tiles with their status, and the card offers setup actions where configuration through the Console is supported. See [Redpanda Cloud Networking](https://docs.redpanda.com/cloud-data-platform/networking/). - **Connect to your network**: network details for configuring connectivity from your side, including the Redpanda network name, CIDR range, and NAT gateways. - **Manage network**: opens the Redpanda network page. Serverless clusters show a card named for the cluster’s network access: **Private network** or **Public network**. Private connectivity for Serverless clusters is available on AWS only, through AWS PrivateLink. When a private link is configured, the card shows its status, endpoint service name, region, number of permitted principals, and availability zones. To set up private access on a Serverless cluster on AWS, click **Enable private access**, which opens the cluster’s **Dataplane settings** page. See [Configure AWS PrivateLink in the Cloud Console](https://docs.redpanda.com/cloud-data-platform/networking/serverless/aws/privatelink-ui/). ## See also - [Serverless](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/) - [BYOC](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/) - [Monitor Redpanda Cloud](https://docs.redpanda.com/cloud-data-platform/manage/monitor-cloud/) --- # Page 364: Redpanda Cloud Deployment **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types.md --- # Redpanda Cloud Deployment - [Serverless](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/) Learn how to create a Serverless cluster and start streaming. - [BYOC](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/) Learn how to create a Bring Your Own Cloud (BYOC), Bring Your Own Virtual Private Cloud (BYOVPC), or Bring Your Own Virtual Network (BYOVNet) cluster. - [Dedicated](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/create-dedicated-cloud-cluster/) Learn how to create a Dedicated cluster and start streaming. - [Cluster Overview](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-overview/) Find connection endpoints, health status, network details, and product information on the cluster overview page. --- # Page 365: BYOC **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc.md --- # BYOC Bring Your Own Cloud (BYOC) lets you run Redpanda in your own cloud environment while using managed services provided by Redpanda. With BYOC clusters, Redpanda deploys into a dedicated network in your own cloud account: - AWS and GCP: Virtual Private Cloud (VPC) - Azure: Virtual Network (VNet) Your data never leaves your environment, giving you extra security and control. See [BYOC architecture](https://docs.redpanda.com/cloud-data-platform/get-started/byoc-arch/) for details. Redpanda manages provisioning, monitoring, upgrades, and security policies, and it manages required resources in your VPC or VNet, including subnets (subnetworks in GCP), IAM roles, and object storage resources (for example, S3 buckets or Azure Storage accounts). You get hands-off operations with a 99.99% uptime guarantee while keeping full control of your data. If you want to manage the networking infrastructure yourself, create a Bring Your Own Virtual Private Cloud (BYOVPC) or Bring Your Own Virtual Network (BYOVNet) cluster. With BYOVPC/BYOVNet, you create the networking and security resources in advance, so the Redpanda agent does not create or change them. The agent still deploys and operates the Redpanda cluster infrastructure with the permissions you grant it. This is ideal for organizations with stringent compliance requirements or existing network configurations, when you need full control over the network lifecycle. Compared to standard BYOC, BYOVPC/BYOVNet provides more security, but the configuration is more complex. See the [shared responsibility model](https://docs.redpanda.com/cloud-data-platform/get-started/cloud-overview/#shared-responsibility-model) to understand what you manage versus what Redpanda manages. To compare the two variants and decide which one fits your requirements, see [Choose Between BYOC and BYOVPC](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/choose-byoc-or-byovpc/). For what Redpanda can and cannot access in your cloud account, and how emergency access works, see [Redpanda Access to Your Environment](https://docs.redpanda.com/cloud-data-platform/security/redpanda-access/). > ❗ **IMPORTANT** > > Don’t deploy other workloads on the BYOC infrastructure that Redpanda manages. - [Choose Between BYOC and BYOVPC](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/choose-byoc-or-byovpc/) Compare standard BYOC with BYOVPC and BYOVNet clusters, and choose who provisions and owns the network, IAM, and storage resources for your cluster. - [Size and Price a BYOC Cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/size-byoc-cluster/) Get machine configurations and price estimates matched to your workload before you create a BYOC cluster. - [BYOC: AWS](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws/) Learn how to create a BYOC or BYOVPC cluster on AWS. - [BYOC: Azure](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/) Learn how to create a BYOC or BYOVNet cluster on Azure. - [BYOC: GCP](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/) Learn how to create a BYOC or BYOVPC cluster on GCP. - [Create Remote Read Replicas](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/remote-read-replicas/) Learn how to create a remote read replica topic with BYOC, which is a read-only topic that mirrors a topic on a different cluster. --- # Page 366: BYOC: AWS **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws.md --- # BYOC: AWS - [Create a BYOC Cluster on AWS](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws/create-byoc-cluster-aws/) Use the Redpanda Cloud UI to create a BYOC cluster on AWS. - [Create a BYOVPC Cluster on AWS](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws/vpc-byo-aws/) Use the Redpanda BYOVPC Terraform module to deploy a BYOVPC cluster on AWS. --- # Page 367: Create a BYOC Cluster on AWS **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws/create-byoc-cluster-aws.md --- # Create a BYOC Cluster on AWS To create a Redpanda cluster in your virtual private cloud (VPC), follow the instructions in the Redpanda Cloud UI. The UI contains the parameters necessary to successfully run `rpk cloud byoc aws apply`. See also: [BYOC architecture](https://docs.redpanda.com/cloud-data-platform/get-started/byoc-arch/). > 📝 **NOTE** > > With standard BYOC clusters, Redpanda manages security policies and resources for your VPC, including subnetworks, service accounts, IAM roles, firewall rules, and storage buckets. For the highest level of security, you can manage these resources yourself with a [BYOVPC cluster on AWS](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws/vpc-byo-aws/). To compare the two variants, see [Choose Between BYOC and BYOVPC](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/choose-byoc-or-byovpc/). ## Prerequisites Before you deploy a BYOC cluster on AWS, verify the following prerequisites: - The latest version of `rpk`. See [Install or Update rpk](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/). - The user authenticating to AWS has the `AdministratorAccess` policy, for example through the `AWSAdministratorAccess` permission set in IAM Identity Center. You need this access to create the IAM policies specified in [AWS IAM policies](https://docs.redpanda.com/cloud-data-platform/security/authorization/cloud-iam-policies/). - The user has the AWS variables necessary to authenticate. Use either: - `AWS_PROFILE` or - `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` To verify access, you should be able to successfully run `aws sts get-caller-identity` for your region. For more information, see the [AWS CLI reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sts/get-caller-identity.html). - If the AWS account is a member of an AWS Organization, confirm that no service control policy (SCP) denies the actions Redpanda needs. If your organization uses allow-list SCPs, also confirm that the SCPs allow those actions. An SCP deny applies even to administrators. See [Check service control policies](https://docs.redpanda.com/cloud-data-platform/security/authorization/cloud-iam-policies/#check-service-control-policies). - A CIDR block for the Redpanda network. You can’t change the CIDR after the network is created, so agree on it with your network team before you start. See [Choose CIDR Ranges](https://docs.redpanda.com/cloud-data-platform/networking/cidr-ranges/). The block must: - Be in an RFC 1918 private range (`10.0.0.0/8`, `172.16.0.0/12`, or `192.168.0.0/16`). - Be between `/16` and `/20` in size. - Not overlap with any network you plan to connect to the cluster. - A decision on how the cluster reaches the internet. By default, Redpanda creates a NAT Gateway, an Elastic IP address, and an Internet Gateway in the Redpanda VPC. To route egress through your own AWS Transit Gateway and hub VPC instead, complete the hub setup before you create the cluster. Centralized egress is in beta and requires a private connection type. To request access for your organization, contact your account team. See [Configure Centralized Egress with AWS Transit Gateway](https://docs.redpanda.com/cloud-data-platform/networking/byoc/aws/nat-free-egress/). - (Optional) If your security team reviews third-party access before an install, share [Redpanda Access to Your Environment](https://docs.redpanda.com/cloud-data-platform/security/redpanda-access/) with them. It describes what Redpanda can and cannot access in your cloud account. ### Prerequisite checklist - Updated `rpk` to the latest version - Verified that the user has `AdministratorAccess` and that `aws sts get-caller-identity` returns the target account - Checked that SCPs don’t deny the required actions and, if your organization uses allow-list SCPs, that they allow them - Chose a non-overlapping RFC 1918 CIDR block between `/16` and `/20` - Chose an egress model (NAT Gateway or centralized egress) ## Create a BYOC cluster 1. Log in to [Redpanda Cloud](https://cloud.redpanda.com). 2. On the Clusters page, click **Create cluster**, then click **Create** for BYOC. 3. Enter a cluster name, then select the resource group, provider (AWS), [region](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/), availability, and Redpanda version. If your organization uses usage-based billing, describe your workload to get recommended machine configurations and price estimates. See [Size and Price a BYOC Cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/size-byoc-cluster/). Otherwise, select a [tier](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/). > 📝 **NOTE** > > - If you plan to create a private network in your own VPC, select the region where your VPC is located. > > - Three availability zones provide two backups in case one availability zone goes down. Optionally, click **Advanced settings** to specify up to five key-value custom tags. After the cluster is created, Redpanda applies the tags to the AWS resources associated with this cluster, except as described in [Reserved tag keys](#reserved-tag-keys). For more information about AWS tag restrictions, see the [AWS documentation](https://docs.aws.amazon.com/mediaconnect/latest/ug/tagging-restrictions.html). After the cluster is created, you can [specify more tags with the Cloud API](#manage-custom-tags). 4. Click **Next**. 5. On the Network page, select the connection type: either public or private. For BYOC clusters, private is best-practice. - Your network name is used to identify this network. - For a [CIDR range](https://docs.redpanda.com/cloud-data-platform/networking/cidr-ranges/), enter the block you chose in [Prerequisites](#prerequisites). Redpanda Cloud rejects a block that is outside the RFC 1918 ranges or the `/16` to `/20` size range. You can’t change the CIDR later. - Clusters with private networking include a setting for API Gateway network access. Public access exposes endpoints for Redpanda Console, the Data Plane API, and the MCP Server API, but they remain protected by your authentication and authorization controls. Private access restricts endpoint access to your VPC only. > 📝 **NOTE** > > After the cluster is created, you can change the API Gateway access on the Dataplane settings page. If you change from public to private access, users without VPN access to the Redpanda VPC will lose access to these services. > 💡 **TIP** > > To route all cluster egress through your own AWS Transit Gateway and hub VPC instead of a per-VPC NAT Gateway, set the **Transit Gateway ID** field on this page. The field is only available on clusters with a private connection type, and is only visible if centralized egress is enabled for your organization. This option is in beta. See [Configure Centralized Egress with AWS Transit Gateway](https://docs.redpanda.com/cloud-data-platform/networking/byoc/aws/nat-free-egress/). 6. Click **Next**. 7. On the Deploy page, follow the steps to log in to Redpanda Cloud and deploy the agent. As part of agent deployment: - Redpanda assigns the permission required to run the agent. For details about these permissions, see [AWS IAM policies](https://docs.redpanda.com/cloud-data-platform/security/authorization/cloud-iam-policies/). - Redpanda allocates one Elastic IP (EIP) address in AWS for each BYOC cluster. > 📝 **NOTE** > > Redpanda Cloud does not support customer access or modifications to any of the internal data plane resources. This restriction allows Redpanda Data to manage all configuration changes internally to ensure a 99.99% service level agreement (SLA) for BYOC clusters. ## Manage custom tags Your organization might require custom tags for cost allocation, audit compliance, or governance policies. After cluster creation, you can manage tags with the [Cloud Control Plane API](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-byoc-controlplane-api/). The Control Plane API allows up to 16 custom tags in AWS. Redpanda reserves some tag keys. See [Reserved tag keys](#reserved-tag-keys). Make sure you have: - The cluster ID. You can find this in the Redpanda Cloud UI, in the page header of the cluster overview. - A valid bearer token for the Cloud Control Plane API. For details, see [Authenticate to the API](https://docs.redpanda.com/api/doc/cloud-controlplane/authentication). Then complete the following steps: 1. To refresh agent permissions so the Redpanda agent can update tags, run: ```bash export CLUSTER_ID="" rpk cloud byoc aws apply --redpanda-id="$CLUSTER_ID" ``` This step is required because tag management requires additional IAM permissions that may not have been granted during initial cluster creation: - `ec2:DescribeTags` - `ec2:DescribeVolumes` - `ec2:DescribeNetworkInterfaces` - `ec2:CreateTags` - `ec2:DeleteTags` - `iam:TagPolicy` - `iam:UntagPolicy` - `iam:TagInstanceProfile` - `iam:UntagInstanceProfile` 2. To update tags, invoke the Cloud API. First, set your authentication token: ```bash export AUTH_TOKEN="" ``` The `PATCH` call sets the tags specified under `"cloud_provider_tags"`. It replaces the existing tags with the specified tags. Include all desired tags in the request. To remove a single entry, omit it from the map you send. ```bash cluster_patch_body=$(cat <<'JSON' { "cloud_provider_tags": { "Environment": "production", "CostCenter": "engineering" } } JSON ) curl -X PATCH "https://api.redpanda.com/v1/clusters/$CLUSTER_ID" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $AUTH_TOKEN" \ -d "$cluster_patch_body" ``` To remove all tags, send an empty `cloud_provider_tags` object: ```bash cluster_patch_body='{"cloud_provider_tags": {}}' curl -X PATCH "https://api.redpanda.com/v1/clusters/$CLUSTER_ID" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $AUTH_TOKEN" \ -d "$cluster_patch_body" ``` ### Reserved tag keys Redpanda rejects the following tag keys in the Redpanda Cloud UI and when you update tags with the Control Plane API: - `redpanda-org` - `redpanda-id` - `network-id` - `redpanda-client` If you enter a reserved key in the UI, the UI shows the error `This field is already in use by Redpanda`. Redpanda matches keys exactly, including case. AWS also treats tag keys as case-sensitive. Also avoid the following keys: - Keys that start with `redpanda-`. Redpanda uses this prefix for its own tags, such as `redpanda-name`, `redpanda-managed`, `redpanda-cloud-storage`, `redpanda-private-link`, and `redpanda-agent-version`. When you update tags after cluster creation, Redpanda does not apply custom tags with this prefix to EC2 instances, EBS volumes, or network interfaces. The Redpanda Terraform provider also drops them from state. - The `Name` key. Redpanda sets the `Name` tag on the resources it creates. AWS displays this tag as the resource name in the console. - Keys that start with `aws:`. AWS reserves this prefix, and the UI rejects it. These rules apply when you create the cluster and when you update tags with the Control Plane API. When you update tags with the Control Plane API, it rejects the request only if the request adds one of the four reserved keys or changes the value Redpanda set for it. You can send the reserved tags back unchanged, for example from a `GET` response, or leave them out. ## Next steps - [Configure private networking](https://docs.redpanda.com/cloud-data-platform/networking/byoc/aws/) - [Schedule a maintenance window](https://docs.redpanda.com/cloud-data-platform/manage/maintenance/#maintenance-windows) - [Monitor your cluster](https://docs.redpanda.com/cloud-data-platform/manage/monitor-cloud/) - [Choose an authorization model](https://docs.redpanda.com/cloud-data-platform/security/authorization/cloud-authorization/) --- # Page 368: Create a BYOVPC Cluster on AWS **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws/vpc-byo-aws.md --- # Create a BYOVPC Cluster on AWS > ❗ **IMPORTANT** > > BYOVPC/BYOVNet is an add-on feature that requires Premium support. To unlock this feature for your account, contact your Redpanda account team or [Redpanda Sales](https://www.redpanda.com/price-estimator). A Bring Your Own Virtual Private Cloud (BYOVPC) cluster allows you to deploy the Redpanda [data plane](https://docs.redpanda.com/home/glossary/#data-plane) into your existing VPC and manage the networking lifecycle yourself. Compared to a standard Bring Your Own Cloud (BYOC) setup, where Redpanda manages the networking lifecycle for you, BYOVPC provides more control. To compare the two variants before you commit to one, see [Choose Between BYOC and BYOVPC](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/choose-byoc-or-byovpc/). For background on the architecture, see [BYOC architecture](https://docs.redpanda.com/cloud-data-platform/get-started/byoc-arch/). When you create a BYOVPC cluster, you specify your VPC and the IAM role (instance profile) that the Redpanda agent will assume. You create the networking and security resources in advance, so the Redpanda Cloud agent doesn’t create or change them. The agent still deploys and operates the Redpanda cluster infrastructure, using the IAM role you supply and only the permissions you grant it. With BYOVPC: - You provide your own VPC in your AWS account. - You maintain more control over your account, because Redpanda requires fewer permissions than standard BYOC clusters. - You control your security resources and policies, including subnets, service accounts, IAM roles, firewall rules, and storage buckets. The [Redpanda BYOVPC Terraform Module](https://registry.terraform.io/modules/redpanda-data/redpanda-byovpc/aws/latest) contains [Terraform](https://developer.hashicorp.com/terraform) code that deploys the resources required for a BYOVPC cluster on AWS. You need to create these resources in advance and provide them to Redpanda during cluster creation. Variables are provided in the code so you can exclude resources that already exist in your environment, such as the VPC. > 📝 **NOTE** > > By default, the Terraform module enables secrets management and creates the IAM role, instance profile, and security group that Redpanda Connect requires. Secrets management allows you to store and read secrets in your cluster, for example to integrate a REST catalog with Iceberg-enabled topics. > > For existing BYOVPC clusters, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new) to enable secrets management. ## Prerequisites - Access to an AWS account in which you create your cluster. - Minimum permissions in that AWS account. For the actions required by the user who will create the cluster with `terraform apply`, see [`iam_rpk_user.tf`](https://github.com/redpanda-data/terraform-aws-redpanda-byovpc/blob/main/iam_rpk_user.tf). - Each BYOVPC cluster requires one allocated Elastic IP (EIP) address in AWS. - [Terraform](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli) version 1.8.5 or later. - The [Redpanda Terraform provider](https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs) configured with valid credentials. For setup details, see the provider documentation. ## Limitations - Existing clusters cannot be converted to BYOVPC clusters. - After creating a BYOVPC cluster, you cannot change to a different VPC. - Only primary CIDR ranges are supported for the VPC. > 📝 **NOTE** > > For simplicity, the instructions are based on the assumption that Terraform is configured to use local state. You may want to configure [remote state](https://developer.hashicorp.com/terraform/language/state/remote). ## Configure the Redpanda BYOVPC Terraform module The following example uses the Redpanda BYOVPC Terraform Module to create the resources required to create a BYOVPC cluster. > 📝 **NOTE** > > Redpanda recommends using a VPC in AWS with a CIDR block (10.0.0.0/16) to allow for enough address space. The subnets must be set to /24. ```hcl locals { common_prefix = "abc-stg" region = "us-east-2" zones = ["use2-az1", "use2-az2", "use2-az3"] enable_private_link = false # see example below for enabling private link force_destroy_cloud_storage = false # see example below if using pre-existing VPC and subnets, # otherwise when provided with these cidrs the module will # attempt to create the VPC and subnets vpc_cidr_block = "10.0.0.0/16" public_subnet_cidrs = [ "10.0.1.0/24", "10.0.3.0/24", "10.0.5.0/24", "10.0.7.0/24", "10.0.9.0/24", "10.0.11.0/24" ] private_subnet_cidrs = [ "10.0.0.0/24", "10.0.2.0/24", "10.0.4.0/24", "10.0.6.0/24", "10.0.8.0/24", "10.0.10.0/24" ] # condition_tags restrict the IAM permissions granted by the # module to only those resources with these tags, when using # condition_tags these tags must also be provided to the # redpanda_cluster so that all resources created are given # these tags condition_tags = { "redpanda-managed" : "true" } # default_tags are applied to all resources created by the # module or redpanda_cluster resource default_tags = { "env" : "staging" } # when using a brand new AWS account that has never hosted an # EKS cluster before the EKS node group service linked role # must be created, if it already exists this may be set to false create_eks_nodegroup_service_linked_role = true } module "redpanda_byovpc" { source = "redpanda-data/redpanda-byovpc/aws" common_prefix = local.common_prefix region = local.region zones = local.zones create_rpk_user = false enable_private_link = local.enable_private_link force_destroy_cloud_storage = local.force_destroy_cloud_storage enable_redpanda_connect = true vpc_cidr_block = local.vpc_cidr_block private_subnet_cidrs = local.private_subnet_cidrs public_subnet_cidrs = local.public_subnet_cidrs condition_tags = local.condition_tags default_tags = local.default_tags create_eks_nodegroup_service_linked_role = local.create_eks_nodegroup_service_linked_role } ``` > 📝 **NOTE** > > - To send telemetry back to the Redpanda control plane, the cluster needs outbound internet access. You can provide this through at least one public subnet, or through network peering or a transit gateway to another VPC that routes traffic through a public subnet. The example configuration includes multiple public subnets to allow for future scaling. Standard BYOC clusters can also route egress through a customer-owned hub VPC and Transit Gateway, eliminating the per-VPC NAT Gateway entirely. See [Configure Centralized Egress with AWS Transit Gateway](https://docs.redpanda.com/cloud-data-platform/networking/byoc/aws/nat-free-egress/). > > - The example creates an Internet Gateway and an associated Route Table rule that routes traffic into the VPC, which allows the Redpanda control plane to access the cluster. To disable creation of the Internet Gateway, either remove the configuration and value for `create_internet_gateway` or set `"create_internet_gateway": false`. > > - When using a pre-existing VPC, at least one public subnet must already exist in that VPC. Setting `public_subnet_cidrs = []` only prevents the module from creating new ones. > > - For a dual-listener cluster (beta), the network also requires customer-managed public subnets in every availability zone that has a private subnet. See [Configure Dual Listener Mode](https://docs.redpanda.com/cloud-data-platform/networking/byoc/aws/dual-listener-mode/). > 💡 **TIP** > > See the full list of zones and tiers available with each provider in the [Control Plane API reference](https://docs.redpanda.com/api/doc/cloud-controlplane/topic/topic-regions-and-usage-tiers). ## Configure the Redpanda network and cluster After provisioning the AWS infrastructure, configure the Redpanda network and cluster resources using the module outputs. ```hcl locals { resource_group_name = "staging" throughput_tier = "tier-1-aws-v3-arm" } data "redpanda_resource_group" "staging" { name = local.resource_group_name } resource "redpanda_network" "network" { name = "${local.common_prefix}-network" resource_group_id = data.redpanda_resource_group.staging.id cloud_provider = "aws" region = local.region cluster_type = "byoc" customer_managed_resources = { aws = { management_bucket = { arn = module.redpanda_byovpc.management_bucket_arn } dynamodb_table = { arn = module.redpanda_byovpc.dynamodb_table_arn } vpc = { arn = module.redpanda_byovpc.vpc_arn } private_subnets = { arns = module.redpanda_byovpc.private_subnet_arns } } } depends_on = [module.redpanda_byovpc] } resource "redpanda_cluster" "cluster" { name = "${local.common_prefix}-cluster" resource_group_id = data.redpanda_resource_group.staging.id cloud_provider = "aws" region = redpanda_network.network.region zones = local.zones network_id = redpanda_network.network.id cluster_type = "byoc" connection_type = "private" throughput_tier = local.throughput_tier allow_deletion = false tags = merge(local.condition_tags, local.default_tags) customer_managed_resources = { aws = { agent_instance_profile = { arn = module.redpanda_byovpc.agent_instance_profile_arn } cloud_storage_bucket = { arn = module.redpanda_byovpc.cloud_storage_bucket_arn } cluster_security_group = { arn = module.redpanda_byovpc.cluster_security_group_arn } connectors_node_group_instance_profile = { arn = module.redpanda_byovpc.connectors_node_group_instance_profile_arn } connectors_security_group = { arn = module.redpanda_byovpc.connectors_security_group_arn } k8s_cluster_role = { arn = module.redpanda_byovpc.k8s_cluster_role_arn } node_security_group = { arn = module.redpanda_byovpc.node_security_group_arn } permissions_boundary_policy = { arn = module.redpanda_byovpc.permissions_boundary_policy_arn } redpanda_agent_security_group = { arn = module.redpanda_byovpc.redpanda_agent_security_group_arn } redpanda_node_group_instance_profile = { arn = module.redpanda_byovpc.redpanda_node_group_instance_profile_arn } redpanda_node_group_security_group = { arn = module.redpanda_byovpc.redpanda_node_group_security_group_arn } utility_node_group_instance_profile = { arn = module.redpanda_byovpc.utility_node_group_instance_profile_arn } utility_security_group = { arn = module.redpanda_byovpc.utility_security_group_arn } redpanda_connect_node_group_instance_profile = { arn = module.redpanda_byovpc.redpanda_connect_node_group_instance_profile_arn } redpanda_connect_security_group = { arn = module.redpanda_byovpc.redpanda_connect_security_group_arn } } } depends_on = [redpanda_network.network] } ``` ## Apply the Terraform configuration Initialize, plan, and apply Terraform to set up the AWS infrastructure: ```bash terraform init && terraform plan && terraform apply ``` Cluster provisioning can take up to 45 minutes. When provisioning completes, the cluster status updates to `Running`. If the cluster stays in `Creating` status, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). ### Validation checks The `redpanda_cluster` resource performs validation checks before proceeding with provisioning: - RPK user: Checks if the user running the command has sufficient privileges to provision the agent. Any missing permissions are displayed in the output. - IAM instance profile: Checks that `agent_instance_profile`, `connectors_node_group_instance_profile`, `redpanda_node_group_instance_profile`, `redpanda_connect_node_group_instance_profile`, `utility_node_group_instance_profile`, and `k8s_cluster_role` have the minimum required permissions. Any missing permissions are displayed in the output. - Storage: Checks that the `management_bucket` exists and is versioned, checks that the `cloud_storage_bucket` exists and is not versioned, and checks that the `dynamodb_table` exists. - Network: Checks that the VPC exists, checks that the subnets exist and have the expected tags, and checks that the security groups exist and have the desired ingress and egress rules. ## Delete the cluster To delete the cluster and all associated resources, run `terraform destroy`. > ⚠️ **WARNING** > > This also deletes the customer-managed resources created by the module. ```bash terraform destroy ``` ## Enable PrivateLink PrivateLink can be enabled during cluster creation or on an already existing cluster. Start by enabling PrivateLink in the Redpanda BYOVPC Terraform module. This adds the permissions required for PrivateLink. ```hcl module "redpanda_byovpc" { # ... enable_private_link = true # ... } ``` Enable PrivateLink on the `redpanda_cluster` resource: ```hcl resource "redpanda_cluster" "cluster" { # ... aws_private_link = { allowed_principals = ["arn:aws:iam::${var.aws_account_id}:root"] enabled = true connect_console = false } # ... } ``` ## Deploy with pre-existing VPC and subnets If you already have a VPC and subnets in your AWS account, provide their IDs to the module instead of CIDR blocks. ```hcl module "redpanda_byovpc" { # ... # vpc_cidr_block = local.vpc_cidr_block # private_subnet_cidrs = local.private_subnet_cidrs # public_subnet_cidrs = local.public_subnet_cidrs vpc_id = "vpc-0c79b236047faa1ab" private_subnet_ids = [ "subnet-0e58df59b5eb037c3", "subnet-0c74559ab372f5123", "subnet-0525df35c467cad1c", "subnet-09c301e004e96c803", "subnet-0f67e76738572cb8e", "subnet-0cca6892cf789f6ec", ] public_subnet_cidrs = [] # when empty the module will not create any public subnets # ... } ``` ## Next steps - [Configure AWS PrivateLink](https://docs.redpanda.com/cloud-data-platform/networking/aws-privatelink/) - [Redpanda Access to Your Environment](https://docs.redpanda.com/cloud-data-platform/security/redpanda-access/) - [Learn about `rpk` commands](https://docs.redpanda.com/cloud-data-platform/reference/rpk/) - [Enable Redpanda SQL on a BYOVPC Cluster on AWS](https://docs.redpanda.com/cloud-data-platform/sql/get-started/enable-sql-byovpc-aws/) --- # Page 369: BYOC: Azure **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure.md --- # BYOC: Azure - [Create a BYOC Cluster on Azure](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/create-byoc-cluster-azure/) Use the Redpanda Cloud UI to create a BYOC cluster on Azure. - [Create a BYOVNet Cluster on Azure](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/vnet-azure/) Use the Redpanda BYOVNet Terraform module and the Redpanda Terraform provider to deploy a BYOVNet cluster on Azure. --- # Page 370: Create a BYOC Cluster on Azure **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/create-byoc-cluster-azure.md --- # Create a BYOC Cluster on Azure To create a Redpanda cluster in your virtual network (VNet), follow the instructions in the Redpanda Cloud UI. The UI contains the parameters necessary to successfully run `rpk cloud byoc azure apply`. See also: [BYOC architecture](https://docs.redpanda.com/cloud-data-platform/get-started/byoc-arch/). > 📝 **NOTE** > > With standard BYOC clusters, Redpanda manages security policies and resources for your virtual network (VNet), including subnetworks, managed identities, IAM roles, security groups, and storage accounts. For the most security, you can manage these resources yourself with a [BYOVNet cluster on Azure](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/vnet-azure/). To compare the two variants, see [Choose Between BYOC and BYOVPC](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/choose-byoc-or-byovpc/). ## Prerequisites Before you deploy a BYOC cluster on Azure, check all prerequisites to ensure that your Azure subscription meets requirements. ### Configure Azure CLI - [Install the Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli). - [Sign in](https://learn.microsoft.com/en-us/cli/azure/authenticate-azure-cli) with the Azure CLI: ```none az login ``` - Set the desired subscription for the Azure CLI: ```none az account set --subscription ``` ### Verify rpk version Install or update to the latest version of `rpk`. See [Install or Update rpk](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/). ### Prepare your Azure subscription In the [Azure Portal](https://login.microsoftonline.com/), confirm that the dedicated subscription you intend to use with Redpanda includes the following: - **Role**: The Azure user must have the _Owner_ role in the subscription. - **Resources**: The subscription must be registered for the following resource providers (AKS + common dependencies). See the [Microsoft documentation](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-providers-and-types). - Microsoft.Compute - Microsoft.ManagedIdentity - Microsoft.Storage - Microsoft.KeyVault - Microsoft.Network - Microsoft.ContainerService To check if a resource provider is registered, run the following command using the Azure CLI or in the Azure Cloud Shell: ```none az provider show -n Microsoft.Compute --query registrationState -o tsv az provider show -n Microsoft.ManagedIdentity --query registrationState -o tsv az provider show -n Microsoft.Storage --query registrationState -o tsv az provider show -n Microsoft.KeyVault --query registrationState -o tsv az provider show -n Microsoft.Network --query registrationState -o tsv az provider show -n Microsoft.ContainerService --query registrationState -o tsv ``` If a resource provider is not registered, run: ```none az provider register --namespace Microsoft.Compute az provider register --namespace Microsoft.ManagedIdentity az provider register --namespace Microsoft.Storage az provider register --namespace Microsoft.KeyVault az provider register --namespace Microsoft.Network az provider register --namespace Microsoft.ContainerService ``` - **Feature**: The subscription must be registered for Microsoft.Compute/EncryptionAtHost. See the [Microsoft documentation](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/disks-enable-host-based-encryption-cli#prerequisites). To register it, run: ```none az feature register --namespace Microsoft.Compute --name EncryptionAtHost # (optional) Wait and verify it shows as Registered az feature show --namespace Microsoft.Compute --name EncryptionAtHost --query properties.state -o tsv # Refresh the provider after enabling a feature az provider register --namespace Microsoft.Compute ``` - **Monitoring**: The subscription must have Azure Network Watcher enabled in the NetworkWatcherRG resource group and the region where you will use Redpanda. Network Watcher lets you monitor and diagnose conditions at a network level. See the [Microsoft documentation](https://learn.microsoft.com/en-us/azure/network-watcher/network-watcher-create?tabs=portaly). To enable it, run: ```none # Create the NetworkWatcherRG resource group az group create --name 'NetworkWatcherRG' --location '' # Enable Network Watcher in az network watcher configure --resource-group 'NetworkWatcherRG' --locations '' --enabled ``` ### Check Azure quota Confirm that the Azure subscription has enough virtual CPUs (vCPUs) per instance family and total regional vCPUs in the region where you will use Redpanda: - Standard Ddv5-series vCPUs: 12 (3 Redpanda broker nodes + extra capacity for 3 more nodes that could be utilized temporarily during tier 1 maintenance) - Standard Dadsv5-series vCPUs: 8 (2 Redpanda utility nodes) - Standard Dv3-series vCPUs: 2 (1 Redpanda agent node) See the [Microsoft documentation](https://learn.microsoft.com/en-us/azure/quotas/view-quotas). ### Check Azure SKU restrictions Ensure your subscription has access to the required VM sizes in the region where you will use Redpanda. For example, using the Azure CLI or in the Azure Cloud Shell, run: ```bash # Replace eastus2 with your target region az vm list-skus -l eastus2 --zone --size Standard_D2d_v5 --all --output table ``` Example output (no restrictions: good) ```bash ResourceType Locations Name Zones Restrictions --------------- ----------- --------------- ------- ------------ virtualMachines eastus2 Standard_D2d_v5 1,2,3 None ``` Example output (with restrictions: needs attention) ```bash ResourceType Locations Name Zones Restrictions --------------- ----------- --------------- ------- ------------ virtualMachines eastus2 Standard_D2d_v5 1,2,3 NotAvailableForSubscription ``` If you see restrictions, [open a Microsoft support request](https://learn.microsoft.com/en-us/troubleshoot/azure/general/region-access-request-process) to remove them. ### Choose a CIDR block Choose a CIDR block for the Redpanda network. The block must: - Be in an RFC 1918 private range (`10.0.0.0/8`, `172.16.0.0/12`, or `192.168.0.0/16`). - Be between `/16` and `/20` in size. - Not overlap with any network you plan to connect to the cluster. You can’t change the CIDR after the network is created, so agree on it with your network team before you start. See [Choose CIDR Ranges](https://docs.redpanda.com/cloud-data-platform/networking/cidr-ranges/). ### Choose an egress model By default, Redpanda creates a NAT Gateway with a public IP prefix in the Redpanda VNet for outbound traffic. To route egress through your own hub VNet and Azure Firewall instead, create the hub VNet and firewall before you create the cluster, because you enter their IDs during creation. Centralized egress is in beta and requires a private connection type. To request access for your organization, contact your account team. See [Configure Centralized Egress with Azure Firewall](https://docs.redpanda.com/cloud-data-platform/networking/byoc/azure/nat-free-egress/). ### (Optional) Share access details with your security team If your security team reviews third-party access before an install, share [Redpanda Access to Your Environment](https://docs.redpanda.com/cloud-data-platform/security/redpanda-access/) with them. It describes what Redpanda can and cannot access in your cloud account. ### Prerequisite checklist - Updated `rpk` to the latest version - Verified Azure user has Owner role - Registered all required resource providers - Registered EncryptionAtHost feature - Enabled Network Watcher - Verified vCPU quota - Verified no SKU restrictions - Chose a non-overlapping RFC 1918 CIDR block between `/16` and `/20` - Chose an egress model (NAT Gateway or centralized egress) ## Create a BYOC cluster To create a Redpanda cluster in your Azure VNet, follow the [prerequisites](#prerequisites) then follow the instructions in the Redpanda Cloud UI. The UI contains the parameters necessary to successfully run `rpk cloud byoc azure apply`. 1. Log in to [Redpanda Cloud](https://cloud.redpanda.com). 2. On the Clusters page, click **Create cluster**, then click **Create** for BYOC. 3. Enter a cluster name, then select the resource group, provider (Azure), [region](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/), availability, and Redpanda version. If your organization uses usage-based billing, describe your workload to get recommended machine configurations and price estimates. See [Size and Price a BYOC Cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/size-byoc-cluster/). Otherwise, select a [tier](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/). > 📝 **NOTE** > > - If you plan to create a private network in your own VNet, select the region where your VNet is located. > > - Multi-AZ is the default configuration. Three AZs provide two backups in case one availability zone goes down. Optionally, click **Advanced settings** to specify up to five key-value custom tags. After the cluster is created, Redpanda applies the tags to the Azure resources associated with this cluster, except as described in [Reserved tag keys](#reserved-tag-keys). For details about Azure tag restrictions, see the [Microsoft documentation](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources). After the cluster is created, you can [specify more tags with the Cloud API](#manage-custom-tags). 4. Click **Next**. 5. On the Network page, select the connection type: either public or private. For BYOC clusters, private using Azure Private Link is best-practice. - Your network name is used to identify this network. - For a [CIDR range](https://docs.redpanda.com/cloud-data-platform/networking/cidr-ranges/), enter the block you chose in [Choose a CIDR block](#choose-a-cidr-block). Redpanda Cloud rejects a block that is outside the RFC 1918 ranges or the `/16` to `/20` size range. You can’t change the CIDR later. - Clusters with private networking include a setting for API Gateway network access. Public access exposes endpoints for Redpanda Console, the Data Plane API, and the MCP Server API, but they remain protected by your authentication and authorization controls. Private access restricts endpoint access to your VNet only. Private access incurs an additional cost, since it involves deploying two network load balancers, instead of one. > 📝 **NOTE** > > After the cluster is created, you can change the API Gateway access on the Dataplane settings page. If you change from public to private access, users without VPN access to the Redpanda VPC will lose access to these services. > 💡 **TIP** > > To route all cluster egress through your own Azure Firewall and hub VNet instead of a per-cluster NAT Gateway, enter the **Hub egress VNet ID** and **Firewall private IP** on this page, or set `egress_spec.azure.hub_vnet_id` and `egress_spec.azure.firewall_private_ip` when you create the network with the Cloud API. This option is only available on clusters with a private connection type and a Redpanda-managed VNet, and only if centralized egress is enabled for your organization. This option is in beta. See [Configure Centralized Egress with Azure Firewall](https://docs.redpanda.com/cloud-data-platform/networking/byoc/azure/nat-free-egress/). 6. Click **Next**. 7. On the Deploy page, follow the steps to log in to Redpanda Cloud and deploy the agent. As part of agent deployment, Redpanda assigns the permissions required to run the agent. For details about these permissions, see [Azure IAM policies](https://docs.redpanda.com/cloud-data-platform/security/authorization/cloud-iam-policies-azure/). ## Manage custom tags Your organization might require custom tags for cost allocation, audit compliance, or governance policies. After cluster creation, you can manage tags with the [Cloud Control Plane API](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-byoc-controlplane-api/). The Control Plane API allows up to 16 custom tags in Azure. Redpanda reserves some tag keys. See [Reserved tag keys](#reserved-tag-keys). Make sure you have: - The cluster ID. You can find this in the Redpanda Cloud UI, in the page header of the cluster overview. - A valid bearer token for the Cloud Control Plane API. For details, see [Authenticate to the API](https://docs.redpanda.com/api/doc/cloud-controlplane/authentication). Then complete the following steps: 1. To refresh Redpanda agent permissions in the target subscription, run: ```bash export CLUSTER_ID="" export SUBSCRIPTION_ID="" rpk cloud byoc azure apply --redpanda-id="$CLUSTER_ID" --subscription-id="$SUBSCRIPTION_ID" ``` 2. To update tags, invoke the Cloud API. First, set your authentication token: ```bash export AUTH_TOKEN="" ``` The `PATCH` call sets the tags specified under `"cloud_provider_tags"`. It replaces the existing tags with the specified tags. Include all desired tags in the request. To remove a single entry, omit it from the map you send. ```bash cluster_patch_body=$(cat <<'JSON' { "cloud_provider_tags": { "Environment": "production", "CostCenter": "engineering" } } JSON ) curl -X PATCH "https://api.redpanda.com/v1/clusters/$CLUSTER_ID" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $AUTH_TOKEN" \ -d "$cluster_patch_body" ``` To remove all tags, send an empty `cloud_provider_tags` object: ```bash cluster_patch_body='{"cloud_provider_tags": {}}' curl -X PATCH "https://api.redpanda.com/v1/clusters/$CLUSTER_ID" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $AUTH_TOKEN" \ -d "$cluster_patch_body" ``` ### Reserved tag keys Redpanda rejects the following tag keys in the Redpanda Cloud UI and when you update tags with the Control Plane API: - `redpanda-org` - `redpanda-id` - `network-id` - `redpanda-client` If you enter a reserved key in the UI, the UI shows the error `This field is already in use by Redpanda`. Redpanda matches keys exactly, including case. Azure treats tag keys as case-insensitive, so a variant such as `Redpanda-Id` collides with the `redpanda-id` tag in Azure. For details, see the [Microsoft documentation](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources). Also avoid keys that start with `redpanda-`. Redpanda sets its own tags with this prefix, such as `redpanda-org-id` on cluster and network resources and `redpanda-network-id` on network resources. If a custom tag uses one of Redpanda’s keys, Redpanda’s value overwrites yours. The Redpanda Terraform provider also drops keys with this prefix from state. These rules apply when you create the cluster and when you update tags with the Control Plane API. When you update tags with the Control Plane API, it rejects the request only if the request adds one of the four reserved keys or changes the value Redpanda set for it. You can send the reserved tags back unchanged, for example from a `GET` response, or leave them out. ### Limitations - Nodepool Application Security Groups (ASG): Custom tags are set only when the cluster is created. Tags cannot be updated on these resources after cluster creation. - Private Link network interfaces (Kubernetes API server, Tiered Storage, and Private Link service): Custom tags are set only during cluster creation and cannot be changed later. ## Next steps - [Configure private networking](https://docs.redpanda.com/cloud-data-platform/networking/byoc/azure/) - [Schedule a maintenance window](https://docs.redpanda.com/cloud-data-platform/manage/maintenance/#maintenance-windows) - [Monitor your cluster](https://docs.redpanda.com/cloud-data-platform/manage/monitor-cloud/) - [Choose an authorization model](https://docs.redpanda.com/cloud-data-platform/security/authorization/cloud-authorization/) --- # Page 371: Create a BYOVNet Cluster on Azure **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/vnet-azure.md --- # Create a BYOVNet Cluster on Azure > ❗ **IMPORTANT** > > BYOVPC/BYOVNet is an add-on feature that requires Premium support. To unlock this feature for your account, contact your Redpanda account team or [Redpanda Sales](https://www.redpanda.com/price-estimator). A Bring Your Own Virtual Network (BYOVNet) cluster allows you to deploy the Redpanda [data plane](https://docs.redpanda.com/home/glossary/#data-plane) into your existing VNet and manage the networking lifecycle. Compared to a standard Bring Your Own Cloud (BYOC) setup, where Redpanda manages the networking lifecycle for you, BYOVNet provides more control. To compare the two variants before you commit to one, see [Choose Between BYOC and BYOVPC](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/choose-byoc-or-byovpc/). For background on the architecture, see [BYOC architecture](https://docs.redpanda.com/cloud-data-platform/get-started/byoc-arch/). When you create a BYOVNet cluster, you specify your VNet and managed identities. You create the networking and security resources in advance, so the Redpanda Cloud agent doesn’t create or change them. The agent still deploys and operates the Redpanda cluster infrastructure, using the managed identities you supply and only the permissions you grant them. With a customer-managed VNet: - You provide your own VNet in your Azure subscription. - You maintain more control over your account, because Redpanda requires fewer permissions than standard BYOC clusters. - You control your security resources and policies, including subnets, user-assigned identities, IAM roles and assignments, security groups, storage accounts, and key vaults. The [Redpanda BYOVNet Terraform Module](https://registry.terraform.io/modules/redpanda-data/redpanda-byovnet/azure/latest) contains [Terraform](https://developer.hashicorp.com/terraform) code that deploys the resources required for a BYOVNet cluster on Azure. The [Redpanda Terraform provider](https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs) then creates the Redpanda network and cluster from the module outputs, and runs the Redpanda agent bootstrap for you. You can do the whole deployment in a single Terraform configuration, with no Cloud API calls or `rpk` commands. Variables are provided in the module so you can exclude resources that already exist in your environment, such as the VNet. The module creates the following groups of customer-managed resources: - Resource groups - User-assigned identities - IAM roles and assignments - Network: VNet, subnets, NAT gateway, and network security group - Storage: management and Tiered Storage accounts and containers - Key vaults ## Prerequisites - Access to an Azure subscription in which you create your cluster. - Permission in that subscription to create, modify, and delete the resources that the module creates, including custom role definitions and role assignments. For example, the Owner role, or the Contributor and User Access Administrator roles. - The [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli), signed in to the subscription with `az login`. Terraform and the Redpanda agent bootstrap use your Azure CLI credentials by default. To use a service principal instead, set the `ARM_CLIENT_ID`, `ARM_CLIENT_SECRET`, `ARM_TENANT_ID`, and `ARM_SUBSCRIPTION_ID` environment variables. With either sign-in method, the Redpanda provider still needs the subscription ID, so the example configuration sets `azure_subscription_id` on the provider. - Enough vCPU quota in the region for the cluster. Check both the per-family quotas for the VM sizes that your throughput tier uses and the region’s **Total Regional vCPUs** quota. The Redpanda agent checks only the per-family quotas before it creates the cluster. Leave headroom: Redpanda Connect adds nodes when pipelines start. For example, a tier 1 cluster uses about 14 vCPUs before any pipeline runs. - [Terraform](https://developer.hashicorp.com/terraform/install) version 1.8.5 or later. - The [Redpanda Terraform provider](https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs) version 2.5.0 or later, configured with valid credentials. For example, set the `REDPANDA_CLIENT_ID` and `REDPANDA_CLIENT_SECRET` environment variables. For setup details, see [Redpanda Terraform Provider](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/). ## Limitations - Existing clusters cannot be converted to BYOVNet clusters. - After creating a BYOVNet cluster, you cannot change to a different VNet. - Only primary CIDR ranges are supported for the VNet. - Every attribute under `customer_managed_resources.azure` is immutable. Changing one plans a replacement of the network or cluster. See [Configuration changes that replace a cluster](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/#cluster-replacement). > 📝 **NOTE** > > For simplicity, these instructions assume that Terraform uses local state. You might want to configure [remote state](https://developer.hashicorp.com/terraform/language/state/remote). ## Configure the Terraform providers Create a directory for the Terraform configuration. In that directory, create a `versions.tf` file that declares the Redpanda and Azure providers: ```hcl terraform { required_providers { redpanda = { source = "redpanda-data/redpanda" version = ">= 2.5.0" } azurerm = { source = "hashicorp/azurerm" version = "~> 5.5" } } } ``` > 📝 **NOTE** > > Version 2 of the Redpanda BYOVNet module requires `azurerm` 5.5 or a later 5.x release. Then create a `main.tf` file and configure both providers: ```hcl provider "azurerm" { features {} subscription_id = local.azure_subscription_id # The module disables shared-key access on its storage accounts. # Without this setting, the provider's post-create data-plane check # fails with KeyBasedAuthenticationNotPermitted. storage_use_azuread = true } # Reads REDPANDA_CLIENT_ID and REDPANDA_CLIENT_SECRET from the environment. provider "redpanda" { # The Redpanda provider does not read the subscription from the Azure # CLI. It needs the subscription ID to run the agent bootstrap. azure_subscription_id = local.azure_subscription_id } ``` ## Configure the Redpanda BYOVNet Terraform module Add the following to `main.tf`. This example uses the Redpanda BYOVNet Terraform module to create a new VNet, the subnets, and all the other resources required for a BYOVNet cluster. ```hcl locals { azure_subscription_id = "" azure_tenant_id = "" # Use a region and zones from BYOC supported regions (Azure tab). region = "eastus" zones = ["eastus-az1", "eastus-az2", "eastus-az3"] # Prefix added to every Azure resource name that the module creates. # Storage account names use it with dashes removed, and must fit # the 24-character storage account limit, so keep it short. resource_name_prefix = "rp-" # Prefix added to every resource group name that the module creates. resource_group_name_prefix = "rp-" # The module reserves this CIDR for AKS services inside the VNet, and # the cluster declares the same value, so one local feeds both. aks_service_cidr = "10.0.15.0/24" tags = { "environment" = "dev" "managed-by" = "terraform" } } module "redpanda_byovnet" { source = "redpanda-data/redpanda-byovnet/azure" version = "~> 2.0" region = local.region zones = local.zones azure_tenant_id = local.azure_tenant_id azure_subscription_id = local.azure_subscription_id resource_name_prefix = local.resource_name_prefix resource_group_name_prefix = local.resource_group_name_prefix reserved_subnet_cidrs = { "k8s-service" = local.aks_service_cidr } # The Redpanda agent bootstrap keeps its Terraform state in the # management storage account, which allows only Microsoft Entra ID # authentication. This grants the identity that runs Terraform the # Storage Blob Data Contributor role on that storage account. grant_caller_management_storage_access = true tags = local.tags } ``` By default, the module: - Creates four resource groups (`redpanda-rg`, `storage-rg`, `network-rg`, and `iam-rg`), each prefixed with `resource_group_name_prefix`. To place resources in resource groups that already exist, set `create_resource_groups = false` and provide the names in `redpanda_resource_group_name`, `redpanda_storage_resource_group_name`, `redpanda_network_resource_group_name`, and `redpanda_iam_resource_group_name`. - Creates a VNet with the address space `10.0.0.0/20` (`vnet_addresses`). - Creates 13 private subnets (`private_subnets`) and one egress subnet (`egress_subnets`), each a `/24` in the range `10.0.0.0/24` through `10.0.13.0/24`. Subnets must be at least `/24`. - Reserves `10.0.15.0/24` for the AKS service CIDR (`reserved_subnet_cidrs`). This range must not overlap any subnet. - Creates a NAT gateway for outbound traffic from the private subnets. To provide egress another way, set `create_nat = false`. > 📝 **NOTE** > > - To send telemetry back to the Redpanda control plane, the cluster needs outbound internet access. The NAT gateway that the module creates provides this. If you set `create_nat = false`, you must provide outbound access yourself, for example through a route to a firewall in a peered hub VNet. > > - If you don’t set `grant_caller_management_storage_access = true`, assign the Storage Blob Data Contributor role on the management storage account to the identity that runs Terraform before you create the cluster. Azure role assignments can take a few minutes to propagate. > 💡 **TIP** > > For the Azure regions and zones that BYOC supports, see the **Azure** tab in [BYOC supported regions](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/#byoc-supported-regions). For throughput tiers, see [BYOC Tiers and Regions](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/). > 📝 **NOTE** > > A BYOVNet deployment made with version 1.2 of the module moves to version 2 with no changes to its Azure resources. Set the module `version` to `~> 2.0` and `azurerm` to `~> 5.5`, then run `terraform init -upgrade`. `terraform plan` reports no changes. If the deployment uses an earlier 1.x release, review the plan before you apply it. ### Optional: Deploy with a pre-existing VNet Skip this section to let the module create the VNet. If you already have a VNet in your Azure subscription, provide its name to the module instead of letting the module create one. The module still creates the subnets inside your VNet, so the CIDRs in `private_subnets`, `egress_subnets`, and `reserved_subnet_cidrs` must fall within the VNet’s address space and not overlap existing subnets. ```hcl module "redpanda_byovnet" { # ... vnet_name = "existing-vnet-name" # Use resource groups that already exist. The module adds # resource_group_name_prefix to these names, so set it to "" # if you provide the full names. create_resource_groups = false resource_group_name_prefix = "" redpanda_resource_group_name = "existing-redpanda-rg" redpanda_storage_resource_group_name = "existing-storage-rg" redpanda_network_resource_group_name = "existing-network-rg" # resource group that contains the VNet redpanda_iam_resource_group_name = "existing-iam-rg" private_subnets = { "system-pod" = { "cidr" = "10.1.1.0/24", "name" = "snet-system-pods" } "system-vnet" = { "cidr" = "10.1.2.0/24", "name" = "snet-system-vnet" } "agent-private" = { "cidr" = "10.1.3.0/24", "name" = "snet-agent-private" } "rp-0-pods" = { "cidr" = "10.1.4.0/24", "name" = "snet-rp-0-pods" } "rp-0-vnet" = { "cidr" = "10.1.5.0/24", "name" = "snet-rp-0-vnet" } "rp-1-pods" = { "cidr" = "10.1.6.0/24", "name" = "snet-rp-1-pods" } "rp-1-vnet" = { "cidr" = "10.1.7.0/24", "name" = "snet-rp-1-vnet" } "rp-2-pods" = { "cidr" = "10.1.8.0/24", "name" = "snet-rp-2-pods" } "rp-2-vnet" = { "cidr" = "10.1.9.0/24", "name" = "snet-rp-2-vnet" } "connect-pod" = { "cidr" = "10.1.10.0/24", "name" = "snet-connect-pods" } "connect-vnet" = { "cidr" = "10.1.11.0/24", "name" = "snet-connect-vnet" } "kafka-connect-pod" = { "cidr" = "10.1.12.0/24", "name" = "snet-kafka-connect-pods" } "kafka-connect-vnet" = { "cidr" = "10.1.13.0/24", "name" = "snet-kafka-connect-vnet" } } egress_subnets = { "agent-public" = { "cidr" = "10.1.0.0/24", "name" = "snet-agent-public" } } # Set local.aks_service_cidr to a range in the VNet that no subnet uses, # for example "10.1.15.0/24". reserved_subnet_cidrs = { "k8s-service" = local.aks_service_cidr } # ... } ``` Keep the subnet map keys as shown. The module outputs that the Redpanda network configuration in the next section reads are keyed on them. ## Configure the Redpanda network and cluster Add the Redpanda resource group, network, and cluster to `main.tf`. These resources read the names of the Azure resources from the module outputs. ```hcl locals { # A Redpanda Cloud resource group, not an Azure resource group. redpanda_cloud_resource_group_name = "byovnet" throughput_tier = "tier-1-azure-v3-x86" } resource "redpanda_resource_group" "byovnet" { name = local.redpanda_cloud_resource_group_name } resource "redpanda_network" "network" { name = "${local.resource_name_prefix}network" resource_group_id = redpanda_resource_group.byovnet.id cloud_provider = "azure" region = local.region cluster_type = "byoc" customer_managed_resources = { azure = { management_bucket = { storage_account_name = module.redpanda_byovnet.management_bucket_storage_account_name storage_container_name = module.redpanda_byovnet.management_bucket_storage_container_name resource_group = { name = module.redpanda_byovnet.redpanda_resource_group_name } } vnet = { name = module.redpanda_byovnet.vnet_name resource_group = { name = module.redpanda_byovnet.network_resource_group_name } } subnets = { rp_agent = { name = module.redpanda_byovnet.agent_private_subnet_name } rp_0_pods = { name = module.redpanda_byovnet.rp_0_pods_subnet_name } rp_0_vnet = { name = module.redpanda_byovnet.rp_0_vnet_subnet_name } rp_1_pods = { name = module.redpanda_byovnet.rp_1_pods_subnet_name } rp_1_vnet = { name = module.redpanda_byovnet.rp_1_vnet_subnet_name } rp_2_pods = { name = module.redpanda_byovnet.rp_2_pods_subnet_name } rp_2_vnet = { name = module.redpanda_byovnet.rp_2_vnet_subnet_name } rp_connect_pods = { name = module.redpanda_byovnet.rp_connect_pods_subnet_name } rp_connect_vnet = { name = module.redpanda_byovnet.rp_connect_vnet_subnet_name } kafka_connect_pods = { name = module.redpanda_byovnet.kafka_connect_pods_subnet_name } kafka_connect_vnet = { name = module.redpanda_byovnet.kafka_connect_vnet_subnet_name } sys_pods = { name = module.redpanda_byovnet.system_pods_subnet_name } sys_vnet = { name = module.redpanda_byovnet.system_vnet_subnet_name } rp_egress_vnet = { name = module.redpanda_byovnet.egress_subnet_name } } } } depends_on = [module.redpanda_byovnet] } resource "redpanda_cluster" "cluster" { name = "${local.resource_name_prefix}cluster" resource_group_id = redpanda_resource_group.byovnet.id network_id = redpanda_network.network.id cloud_provider = "azure" region = redpanda_network.network.region zones = local.zones cluster_type = "byoc" connection_type = "private" throughput_tier = local.throughput_tier allow_deletion = false tags = local.tags customer_managed_resources = { azure = { resource_groups = { redpanda_resource_group = { name = module.redpanda_byovnet.redpanda_resource_group_name } storage_resource_group = { name = module.redpanda_byovnet.storage_resource_group_name } iam_resource_group = { name = module.redpanda_byovnet.iam_resource_group_name } } user_assigned_identities = { agent_user_assigned_identity = { name = module.redpanda_byovnet.agent_user_assigned_identity_name } aks_user_assigned_identity = { name = module.redpanda_byovnet.aks_user_assigned_identity_name } redpanda_cluster_assigned_identity = { name = module.redpanda_byovnet.cluster_user_assigned_identity_name } cert_manager_assigned_identity = { name = module.redpanda_byovnet.cert_manager_user_assigned_identity_name } external_dns_assigned_identity = { name = module.redpanda_byovnet.external_dns_user_assigned_identity_name } redpanda_console_assigned_identity = { name = module.redpanda_byovnet.console_user_assigned_identity_name } kafka_connect_assigned_identity = { name = module.redpanda_byovnet.kafka_connect_user_assigned_identity_name } redpanda_connect_assigned_identity = { name = module.redpanda_byovnet.redpanda_connect_user_assigned_identity_name } redpanda_connect_api_assigned_identity = { name = module.redpanda_byovnet.redpanda_connect_api_user_assigned_identity_name } redpanda_operator_assigned_identity = { name = module.redpanda_byovnet.redpanda_operator_user_assigned_identity_name } } tiered_cloud_storage = { storage_account_name = module.redpanda_byovnet.tiered_storage_account_name storage_container_name = module.redpanda_byovnet.tiered_storage_container_name resource_group = { name = module.redpanda_byovnet.storage_resource_group_name } } key_vaults = { management_vault = { name = module.redpanda_byovnet.management_key_vault_name } console_vault = { name = module.redpanda_byovnet.console_key_vault_name } } security_groups = { redpanda_security_group = { name = module.redpanda_byovnet.redpanda_security_group_name } } cidrs = { aks_service_cidr = local.aks_service_cidr } } } # Azure cluster creation and deletion can outlast the default timeouts. timeouts = { create = "150m" delete = "150m" } depends_on = [redpanda_network.network] } ``` To use a Redpanda resource group that already exists, replace the `redpanda_resource_group` resource with a `redpanda_resource_group` data source, and reference `data.redpanda_resource_group.byovnet.id` in the network and cluster. To list the names of the Azure resources that the module creates, add an `outputs.tf` file. The filter keeps the module’s name outputs and leaves out its detailed JSON outputs: ```hcl output "byovnet" { description = "Names of the Azure resources that the Redpanda BYOVNet module created" value = { for k, v in module.redpanda_byovnet : k => v if endswith(k, "_name") } } ``` ## Apply the Terraform configuration Initialize, plan, and apply Terraform to create the Azure infrastructure, the Redpanda network, and the Redpanda cluster: ```bash terraform init && terraform plan && terraform apply ``` Terraform creates the resources in order: first the Azure resources in the module, then the Redpanda network, and then the Redpanda cluster. When it creates the cluster, the Redpanda Terraform provider runs the Redpanda agent bootstrap in your subscription, using your Azure credentials. You don’t need to run `rpk cloud byoc azure apply` yourself. Cluster provisioning can take about an hour. When provisioning completes, the cluster status updates to `Running`. If the cluster stays in `Creating` status, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To see the names of the Azure resources that the module created, run `terraform output byovnet`: Show example output ```bash { "agent_private_subnet_name" = "rp-snet-agent-private" "agent_user_assigned_identity_name" = "rp-agent-uai" "aks_user_assigned_identity_name" = "rp-aks-uai" "cert_manager_user_assigned_identity_name" = "rp-cert-manager-uai" "cluster_user_assigned_identity_name" = "rp-cluster-uai" "console_key_vault_name" = "rp-console-vault" "console_user_assigned_identity_name" = "rp-console-uai" "egress_subnet_name" = "rp-snet-agent-public" "external_dns_user_assigned_identity_name" = "rp-external-dns-uai" "iam_resource_group_name" = "rp-iam-rg" "kafka_connect_pods_subnet_name" = "rp-snet-kafka-connect-pods" "kafka_connect_user_assigned_identity_name" = "rp-kafka-connect-uai" "kafka_connect_vnet_subnet_name" = "rp-snet-kafka-connect-vnet" "management_bucket_storage_account_name" = "rpmanagementa" "management_bucket_storage_container_name" = "rpmanagementc" "management_key_vault_name" = "rp-rp-vault" "network_resource_group_name" = "rp-network-rg" "redpanda_connect_api_user_assigned_identity_name" = "rp-redpanda-connect-api-uai" "redpanda_connect_user_assigned_identity_name" = "rp-redpanda-connect-uai" "redpanda_operator_user_assigned_identity_name" = "rp-redpanda-operator-uai" "redpanda_resource_group_name" = "rp-redpanda-rg" "redpanda_security_group_name" = "rp-redpanda-nsg" "rp_0_pods_subnet_name" = "rp-snet-rp-0-pods" "rp_0_vnet_subnet_name" = "rp-snet-rp-0-vnet" "rp_1_pods_subnet_name" = "rp-snet-rp-1-pods" "rp_1_vnet_subnet_name" = "rp-snet-rp-1-vnet" "rp_2_pods_subnet_name" = "rp-snet-rp-2-pods" "rp_2_vnet_subnet_name" = "rp-snet-rp-2-vnet" "rp_connect_pods_subnet_name" = "rp-snet-connect-pods" "rp_connect_vnet_subnet_name" = "rp-snet-connect-vnet" "storage_resource_group_name" = "rp-storage-rg" "system_pods_subnet_name" = "rp-snet-system-pods" "system_vnet_subnet_name" = "rp-snet-system-vnet" "tiered_storage_account_name" = "rptieredstoragea" "tiered_storage_container_name" = "rptieredstoragec" "vnet_name" = "rp-rp-vnet" } ``` ## Delete the cluster To delete the cluster and all associated resources, first set `allow_deletion = true` on the `redpanda_cluster` resource and run `terraform apply`. Then run `terraform destroy`: ```bash terraform destroy ``` Terraform deletes the cluster, runs the Redpanda agent teardown, and then deletes the Redpanda network and the Azure resources. > ⚠️ **WARNING** > > This also deletes the customer-managed resources created by the module, including the Tiered Storage account and the data in it. > 📝 **NOTE** > > Redpanda Cloud does not support customer access or modifications to any of the internal data plane resources. This restriction allows Redpanda Data to manage all configuration changes internally to ensure a 99.99% service level agreement (SLA) for BYOC clusters. ## Manage custom tags Your organization might require custom tags for cost allocation, audit compliance, or governance policies. A BYOVNet cluster has two sets of Azure resources, and you tag each set in a different place: - The `tags` argument on the `redpanda_byovnet` module tags the customer-managed resources that the module creates, such as the VNet, subnets, managed identities, storage accounts, and key vaults. - The `tags` argument on the `redpanda_cluster` resource tags the Azure resources that the Redpanda agent creates for the cluster, such as the AKS cluster and its node pools. Redpanda does not apply these tags to the customer-managed resources. The example configuration passes `local.tags` to both. To change the cluster’s tags after creation, edit the `tags` map and run `terraform apply`. The provider updates the tags in place, without replacing the cluster. The map replaces the existing custom tags, so include every tag you want to keep. To remove all custom tags, set `tags = {}`. Before you change the tags of an existing cluster, refresh the Redpanda agent’s permissions in your subscription. `terraform apply` doesn’t do this for you. With Terraform 1.14 or later, the provider’s [`redpanda_byoc_agent_apply` action](https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs/actions/byoc_agent_apply) runs the agent apply, the equivalent of `rpk cloud byoc azure apply`: ```hcl variable "cluster_id" { type = string } action "redpanda_byoc_agent_apply" "cluster" { config { cluster_id = var.cluster_id } } ``` Set `cluster_id` to the cluster’s ID, for example in `terraform.tfvars`. Then invoke the action and apply the tag change: ```bash terraform apply -invoke=action.redpanda_byoc_agent_apply.cluster terraform apply ``` Redpanda Cloud allows up to 16 custom tags on an Azure cluster. Don’t use keys that start with `redpanda-`. Redpanda reserves these keys, and the provider drops them from Terraform state. For the full list of reserved keys, see [Reserved tag keys](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/create-byoc-cluster-azure/#reserved-tag-keys). Some Azure resources take custom tags only when the cluster is created, so changes to `tags` after creation don’t reach them: - Node pool application security groups (ASGs) - Private Link network interfaces for the Kubernetes API server, Tiered Storage, and the Private Link service ## Next steps - [Configure Azure Private Link](https://docs.redpanda.com/cloud-data-platform/networking/azure-private-link/) - [Redpanda Access to Your Environment](https://docs.redpanda.com/cloud-data-platform/security/redpanda-access/) - [Manage Redpanda Cloud with the Terraform provider](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/) --- # Page 372: Choose Between BYOC and BYOVPC **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/choose-byoc-or-byovpc.md --- # Choose Between BYOC and BYOVPC Every Bring Your Own Cloud (BYOC) cluster runs the Redpanda [data plane](https://docs.redpanda.com/home/glossary/#data-plane) in your own cloud account, so your streaming data stays in your environment. The two variants (standard BYOC and BYOVPC/BYOVNet) differ in who creates and owns the infrastructure around the cluster. With standard BYOC, Redpanda provisions the network, IAM, and storage resources for you in your account. With Bring Your Own Virtual Private Cloud (BYOVPC), called Bring Your Own Virtual Network (BYOVNet) on Azure, you create those resources in advance and the agent operates with only the permissions you grant. This page compares the two variants so you can decide before you create a cluster, because you cannot change the variant after creation. After reading this page, you will be able to: - Compare who provisions and owns the VPC or VNet, IAM identities, and storage in standard BYOC versus BYOVPC - Identify the operational responsibilities that BYOVPC transfers to your team - Choose the BYOC variant that matches your compliance and network ownership requirements ## Who provisions what With standard BYOC, Redpanda creates and manages the required resources in your VPC or VNet, including subnets, IAM roles, security policies, and object storage resources such as S3 buckets or Azure storage accounts. When you create the cluster, you choose a [CIDR range](https://docs.redpanda.com/cloud-data-platform/networking/cidr-ranges/) for the new Redpanda network; you do not supply an existing VPC or VNet. You grant the provisioning permissions to the Redpanda agent when you deploy it, and the agent creates dedicated IAM roles per workload, each with only the permissions that workload requires. For the full list of permissions and why each one is required, see the agent IAM policies for [AWS](https://docs.redpanda.com/cloud-data-platform/security/authorization/cloud-iam-policies/), [Azure](https://docs.redpanda.com/cloud-data-platform/security/authorization/cloud-iam-policies-azure/), or [GCP](https://docs.redpanda.com/cloud-data-platform/security/authorization/cloud-iam-policies-gcp/). With BYOVPC, you create the networking and security resources in advance, including the VPC or VNet, subnets, IAM roles, and storage resources, so the agent does not create or change them. You also supply the identity that the agent uses: an IAM role (instance profile) on AWS, managed identities on Azure, or a service account on GCP. You manage that identity’s permissions yourself, so the standard agent IAM policies do not apply, and the agent’s access is limited to the permissions you grant. In both variants, the agent deploys and operates the Redpanda cluster infrastructure in your account, and Redpanda manages provisioning, monitoring, and upgrades. For what the agent can and cannot access in either variant, see [Redpanda Access to Your Environment](https://docs.redpanda.com/cloud-data-platform/security/redpanda-access/). ## Responsibility split The following table summarizes the ownership differences that drive the decision. For the complete split, see the [shared responsibility model](https://docs.redpanda.com/cloud-data-platform/get-started/cloud-overview/#shared-responsibility-model). | Responsibility | Standard BYOC | BYOVPC/BYOVNet | | --- | --- | --- | | VPC or VNet, subnets, routing, and firewall rules | Redpanda provisions and manages them in your account | You create and manage them (Redpanda’s subnet and CIDR requirements apply) | | Agent identity and IAM roles | Redpanda creates per-workload IAM roles, scoped by the standard agent IAM policies | You supply the agent identity and manage its permissions | | [Tiered Storage](https://docs.redpanda.com/home/glossary/#tiered-storage) bucket or container | Redpanda | You | | Internet egress | Redpanda provisions a NAT gateway (Cloud NAT on GCP) | You provide the egress path | | Redpanda deployment, upgrades, and hotfixes | Redpanda | Redpanda | > 📝 **NOTE** > > You can own the egress path on a standard BYOC cluster too. On clusters with private networking, you can route all cluster egress through your own hub network instead of a Redpanda-provisioned NAT gateway. See the instructions for [AWS](https://docs.redpanda.com/cloud-data-platform/networking/byoc/aws/nat-free-egress/), [Azure](https://docs.redpanda.com/cloud-data-platform/networking/byoc/azure/nat-free-egress/), or [GCP](https://docs.redpanda.com/cloud-data-platform/networking/byoc/gcp/nat-free-egress/). ## When to choose standard BYOC Standard BYOC is the default choice. Choose it when: - Your policies do not require your team to own the network or IAM lifecycle. Standard BYOC already runs the data plane in your own cloud account, so you do not need BYOVPC for a secure deployment. - You want Redpanda to manage the network lifecycle end to end, so your team does not maintain subnets, routing, or security resources for the cluster. - You want the simpler setup. The Redpanda Cloud UI walks you through cluster creation, and the agent bootstraps the infrastructure for you. - Your main requirement is controlling egress rather than owning the whole network. Centralized egress can meet that requirement on a standard BYOC cluster. ## When to choose BYOVPC > ❗ **IMPORTANT** > > BYOVPC/BYOVNet is an add-on feature that requires Premium support. To unlock this feature for your account, contact your Redpanda account team or [Redpanda Sales](https://www.redpanda.com/price-estimator). Choose BYOVPC (BYOVNet on Azure) when: - Your security policies require Redpanda to hold fewer permissions. You supply the identity that the agent uses and manage its permissions yourself, so the standard BYOC agent IAM policies do not apply. - Your policies require clusters to run inside a VPC or VNet that your organization creates and controls, such as an existing landing zone, or you need to control the CIDR ranges and subnet layout. - Your team manages network infrastructure as code and must keep that ownership, including subnets, route tables, firewall rules or security groups, and storage. - You need the tightest control over your environment and accept a more complex configuration and the Premium support requirement in exchange. ## What BYOVPC adds operationally BYOVPC shifts ongoing work to your team. Before you choose it, confirm that you can take on the following responsibilities: - **Network lifecycle ownership**: You create the VPC or VNet, subnets, routing, egress, and security resources before cluster creation, using the Redpanda-provided Terraform modules for [AWS](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws/vpc-byo-aws/) and [Azure](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/vnet-azure/), or the gcloud setup steps for [GCP](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/vpc-byo-gcp/), and you maintain them for the life of the cluster. - **Identity and storage management**: You create and manage the agent identity, the per-workload IAM roles and their assignments, and the Tiered Storage bucket or container. On Azure, you also manage the resource group, user-assigned identities, and key vaults. - **Feature enablement**: Redpanda Connect and secrets management differ by provider on BYOVPC clusters: - On AWS, the Terraform module enables secrets management and grants the permissions that Redpanda Connect requires by default for new clusters. For existing BYOVPC clusters, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new) to enable secrets management. - On Azure, Redpanda Connect is enabled when you create the cluster. - On GCP, the creation steps include both for new clusters: you create the required service accounts during setup. For existing BYOVPC clusters, enable [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/enable-rpcn-byovpc-gcp/) and [secrets management](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/enable-secrets-byovpc-gcp/) yourself. ## Switching later You cannot change the variant after you create the cluster: - You cannot convert an existing cluster to a BYOVPC or BYOVNet cluster. - After creating a BYOVPC or BYOVNet cluster, you cannot change to a different VPC or VNet. If you might need BYOVPC later, decide before you create the cluster. ## Next steps - Create a standard BYOC cluster on [AWS](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws/create-byoc-cluster-aws/), [Azure](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/create-byoc-cluster-azure/), or [GCP](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/create-byoc-cluster-gcp/) - Create a [BYOVPC cluster on AWS](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws/vpc-byo-aws/), [BYOVNet cluster on Azure](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/vnet-azure/), or [BYOVPC cluster on GCP](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/vpc-byo-gcp/) - [Redpanda Access to Your Environment](https://docs.redpanda.com/cloud-data-platform/security/redpanda-access/) - [Choose an Authorization Model](https://docs.redpanda.com/cloud-data-platform/security/authorization/cloud-authorization/) --- # Page 373: BYOC: GCP **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp.md --- # BYOC: GCP - [Create a BYOC Cluster on GCP](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/create-byoc-cluster-gcp/) Use the Redpanda Cloud UI to create a BYOC cluster on GCP. - [Create a BYOVPC Cluster on GCP](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/vpc-byo-gcp/) Connect Redpanda Cloud to your existing VPC for additional security. - [Enable Redpanda Connect on an Existing BYOVPC Cluster on GCP](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/enable-rpcn-byovpc-gcp/) Add Redpanda Connect to your existing BYOVPC cluster. - [Enable Secrets Management on an Existing BYOVPC Cluster on GCP](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/enable-secrets-byovpc-gcp/) Store and read secrets in your existing BYOVPC cluster. --- # Page 374: Create a BYOC Cluster on GCP **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/create-byoc-cluster-gcp.md --- # Create a BYOC Cluster on GCP To create a Redpanda cluster in your virtual private cloud (VPC), follow the instructions in the Redpanda Cloud UI. The UI contains the parameters necessary to successfully run `rpk cloud byoc gcp apply`. See also: [BYOC architecture](https://docs.redpanda.com/cloud-data-platform/get-started/byoc-arch/). > 📝 **NOTE** > > With standard BYOC clusters, Redpanda manages security policies and resources for your VPC, including subnetworks, service accounts, IAM roles, firewall rules, and storage buckets. For the highest level of security, you can manage these resources yourself with a [BYOVPC cluster on GCP](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/vpc-byo-gcp/). To compare the two variants, see [Choose Between BYOC and BYOVPC](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/choose-byoc-or-byovpc/). If your clients need to connect from different GCP regions than where your cluster will be deployed, you must enable global access during cluster creation using the Cloud API. To create a BYOC cluster with global access enabled, see [Enable Global Access](https://docs.redpanda.com/cloud-data-platform/networking/byoc/gcp/enable-global-access/). ## Prerequisites Before you deploy a BYOC cluster on GCP, verify the following prerequisites: - The latest version of `rpk`. See [Install or Update rpk](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/). - Assign the `roles/editor` role (or higher, such as `roles/owner`) to the GCP user or service account that runs the bootstrap on the target GCP project. This grants the permissions needed to create VPC networks, GKE clusters, service accounts, and other infrastructure during the initial bootstrap. These bootstrap permissions are separate from the [agent permissions](https://docs.redpanda.com/cloud-data-platform/security/authorization/cloud-iam-policies-gcp/) that Redpanda assigns after bootstrap. - The user has the [Google Cloud CLI](https://cloud.google.com/sdk/docs/install) installed and authenticated, with the target project selected. To verify, run: ```bash gcloud auth list gcloud config get-value project ``` - A CIDR block for the Redpanda network. You can’t change the CIDR after the network is created, so agree on it with your network team before you start. See [Choose CIDR Ranges](https://docs.redpanda.com/cloud-data-platform/networking/cidr-ranges/). The block must: - Be in an RFC 1918 private range (`10.0.0.0/8`, `172.16.0.0/12`, or `192.168.0.0/16`). - Be between `/16` and `/20` in size. - Not overlap with any network you plan to connect to the cluster. - A decision on how the cluster reaches the internet. For clusters with a private connection type, Redpanda creates a Cloud Router and Cloud NAT in the Redpanda VPC by default. To route egress through your own hub VPC instead, complete the hub setup before you create the cluster. Centralized egress is in beta and requires a private connection type. To request access for your organization, contact your account team. See [Configure Centralized Egress with GCP VPC Peering](https://docs.redpanda.com/cloud-data-platform/networking/byoc/gcp/nat-free-egress/). - (Optional) If your security team reviews third-party access before an install, share [Redpanda Access to Your Environment](https://docs.redpanda.com/cloud-data-platform/security/redpanda-access/) with them. It describes what Redpanda can and cannot access in your cloud account. ### GCP quotas Ensure at least three nodes of headroom in the relevant GCP quotas in the same region as your cluster. During maintenance, Redpanda may temporarily create extra nodes. Quotas such as vCPUs per VM family (for example, N2D) and Local SSD total per VM family (quota key: `LOCAL_SSD_TOTAL_GB_PER_VM_FAMILY`) are listed for each tier on the **Create BYOC cluster** page in the Redpanda Cloud UI. Headroom formulas: - vCPU spare = `3 x (vCPUs per node)` - Local SSD spare (GB) = `3 x (Storage size per node in GB)` For example, with per-node storage **1500 GB** (4 × 375 GB Local SSD) and machine type **n2d-standard-4** (4 vCPUs), keep **4500 GB** Local SSD and **12 vCPUs** of spare quota. ### Prerequisite checklist - Updated `rpk` to the latest version - Assigned the bootstrap role on the target project - Authenticated the Google Cloud CLI and selected the target project - Chose a non-overlapping RFC 1918 CIDR block between `/16` and `/20` - Chose an egress model (Cloud NAT or centralized egress) - Verified GCP quotas ## Create a BYOC cluster 1. Log in to [Redpanda Cloud](https://cloud.redpanda.com). 2. On the Clusters page, click **Create cluster**, then click **Create** for BYOC. Enter a cluster name, then select the resource group, provider (GCP), [region](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/), availability, and Redpanda version. If your organization uses usage-based billing, describe your workload to get recommended machine configurations and price estimates. See [Size and Price a BYOC Cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/size-byoc-cluster/). Otherwise, select a [tier](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/). > 📝 **NOTE** > > - If you plan to create a private network in your own VPC, select the region where your VPC is located. > > - Three availability zones provide two backups in case one availability zone goes down. Optionally, click **Advanced settings** to specify up to five key-value custom GCP labels. If a label key starts with `gcp.network-tag.`, then the agent interprets it as a request to apply the `` [network tag](https://cloud.google.com/vpc/docs/add-remove-network-tags) to GCE instances in the cluster. Use labels for organization/metadata; use network tags to target firewall rules and routes. After the cluster is created, Redpanda applies labels to applicable GCP resources (for example, instances and disks) and network tags to instances, except as described in [Reserved label and network tag keys](#reserved-tag-keys). For more information, see the [GCP documentation](https://cloud.google.com/compute/docs/labeling-resources). You can also [specify more labels and network tags on the Dataplane settings page or with the Control Plane API](#manage-custom-resource-labels-and-network-tags). 3. Click **Next**. 4. On the Network page, select the connection type: either public or private. For BYOC clusters, private is best-practice. - Your network name is used to identify this network. - For a [CIDR range](https://docs.redpanda.com/cloud-data-platform/networking/cidr-ranges/), enter the block you chose in [Prerequisites](#prerequisites). Redpanda Cloud rejects a block that is outside the RFC 1918 ranges or the `/16` to `/20` size range. You can’t change the CIDR later. - Clusters with private networking include a setting for API Gateway network access. Public access exposes endpoints for Redpanda Console, the Data Plane API, but they remain protected by your authentication and authorization controls. Private access restricts endpoint access to your VPC only. > 📝 **NOTE** > > After the cluster is created, you can change the API Gateway access on the Dataplane settings page. If you change from public to private access, users without VPN access to the Redpanda VPC will lose access to these services. > 💡 **TIP** > > To route all cluster egress through your own GCP hub VPC and NAT VM instead of a per-cluster Cloud NAT, enter the **Hub VPC name** and **Hub project ID** on this page. These fields are only available on clusters with a private connection type, and are only visible if centralized egress is enabled for your organization. This option is in beta. See [Configure Centralized Egress with GCP VPC Peering](https://docs.redpanda.com/cloud-data-platform/networking/byoc/gcp/nat-free-egress/). 5. Click **Next**. 6. On the Deploy page, follow the steps to log in to Redpanda Cloud and deploy the agent. As part of agent deployment, Redpanda assigns the permissions required to run the agent. For details about these permissions, see [GCP IAM permissions](https://docs.redpanda.com/cloud-data-platform/security/authorization/cloud-iam-policies-gcp/). > 📝 **NOTE** > > Redpanda Cloud does not support customer access or modifications to any of the internal data plane resources. This restriction allows Redpanda Data to manage all configuration changes internally to ensure a 99.99% service level agreement (SLA) for BYOC clusters. ## Manage custom resource labels and network tags Your organization might require custom resource labels and network tags for cost allocation, audit compliance, or governance policies. After cluster creation, you can manage labels and network tags on your cluster’s **Dataplane settings** page in the Redpanda Cloud UI, or with the [Control Plane API](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-byoc-controlplane-api/). Redpanda reserves some label keys. See [Reserved label and network tag keys](#reserved-tag-keys). > ⚠️ **CAUTION** > > Do not add labels or network tags directly to the GCP node pools of a BYOC cluster, either in the GCP console or with commands such as `gcloud container node-pools update`. Google Kubernetes Engine (GKE) treats a node pool label or tag update as a node replacement and aggressively replaces all nodes, rather than performing a controlled rolling upgrade. This bypasses the failover process that Redpanda requires for safe node cycling. It can leave persistent volume claims (PVCs) in a pending state and may require recovering the entire cluster. > > The Dataplane settings page and the Control Plane API are the supported methods. With both, Redpanda applies labels directly to the Google Compute Engine (GCE) instances and disks in your cluster, and network tags directly to the instances. Because nothing is applied to the node pools, GKE does not replace any nodes. ### Use the Dataplane settings page To manage labels and network tags in the Redpanda Cloud UI: 1. In the Redpanda Cloud UI, open your [cluster](https://cloud.redpanda.com/clusters), and click **Dataplane settings**. 2. Under **Manage resource labels and network tags for your cluster**, click **Add**, and enter a key and value for each label. Keys and values are case-sensitive. To apply a network tag to the GCE instances in the cluster, use a key that starts with `gcp.network-tag.`. For example, the key `gcp.network-tag.web-servers` applies the `web-servers` [network tag](https://cloud.google.com/vpc/docs/add-remove-network-tags). You can add up to 10 entries on this page. To manage up to 16, use the [Control Plane API](#use-the-control-plane-api). 3. Click **Save**. ### Use the Control Plane API The Control Plane API allows up to 16 custom resource labels and network tags in GCP. Make sure you have: - The cluster ID. You can find this in the Redpanda Cloud UI, in the page header of the cluster overview. - A valid bearer token for the Control Plane API. For details, see [Authenticate to the API](https://docs.redpanda.com/api/doc/cloud-controlplane/authentication). Then complete the following steps: 1. To refresh agent permissions so the Redpanda agent can update labels and network tags, run: ```bash export CLUSTER_ID="" export PROJECT_ID="" rpk cloud byoc gcp apply --redpanda-id="$CLUSTER_ID" --project-id="$PROJECT_ID" ``` This step is required because label/tag management requires additional IAM permissions that may not have been granted during initial cluster creation: - `compute.disks.get` - `compute.disks.list` - `compute.disks.setLabels` - `compute.instances.setLabels` 2. To update labels and network tags, invoke the Control Plane API. First, set your authentication token: ```bash export AUTH_TOKEN="" ``` The `PATCH` call sets the labels and network tags specified under `"cloud_provider_tags"`. It replaces the existing labels and tags with the specified labels and tags. Include all desired labels and tags in the request. To remove a single entry, omit it from the map you send. ```bash cluster_patch_body=$(cat <<'JSON' { "cloud_provider_tags": { "environment": "production", "cost-center": "engineering", "gcp.network-tag.web-servers": "true", "gcp.network-tag.database-access": "true" } } JSON ) curl -X PATCH "https://api.redpanda.com/v1/clusters/$CLUSTER_ID" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $AUTH_TOKEN" \ -d "$cluster_patch_body" ``` To remove all labels and network tags, send an empty `cloud_provider_tags` object: ```bash cluster_patch_body='{"cloud_provider_tags": {}}' curl -X PATCH "https://api.redpanda.com/v1/clusters/$CLUSTER_ID" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $AUTH_TOKEN" \ -d "$cluster_patch_body" ``` Labels that Redpanda manages, such as the [Google Cloud Marketplace label](#marketplace-label), remain. ### Reserved label and network tag keys Redpanda rejects the following label keys when you create the cluster, when you add labels on the Dataplane settings page, and when you update labels with the Control Plane API: - `redpanda-org` - `redpanda-id` - `network-id` - `redpanda-client` If you enter a reserved key in the UI, the UI shows the error `This field is already in use by Redpanda`. Redpanda matches keys exactly. Label keys must start with a lowercase letter and can contain only lowercase letters, numbers, underscores, and dashes, except for the `gcp.network-tag.` prefix. Redpanda also reserves `goog-partner-solution` for all organizations. See [Google Cloud Marketplace consumption-tracking label](#marketplace-label). When you update labels with the Control Plane API, it rejects the request only if the request adds one of the four reserved keys or changes the value Redpanda set for it. You can send the reserved labels back unchanged, for example from a `GET` response, or leave them out. Also avoid the following keys: - Keys that start with `redpanda-`. Redpanda uses this prefix for its own labels, such as `redpanda-managed`. The Redpanda agent ignores custom labels with this prefix on GCE instances and disks, and the Redpanda Terraform provider drops them from state. - Keys that start with `goog-gke-` or `goog-k8s-`. GKE sets these labels on node instances, and the Redpanda agent ignores custom labels with these prefixes. Redpanda treats keys that start with `gcp.network-tag.` as network tag requests for the GCE instances in the cluster, not as labels. ### Google Cloud Marketplace consumption-tracking label If your organization subscribes to Redpanda Cloud through a Google Cloud Marketplace private offer, Redpanda adds the following label to the GCP resources it creates for your BYOC clusters: ```text goog-partner-solution=isol_plb32_0014m00001udwjbqaq_hsnezwtawmwgng3icvr677juyhbusiap ``` Google Cloud Marketplace requires this label for [partner consumption tracking](https://docs.cloud.google.com/marketplace/docs/partners/integrated-saas/partner-consumption-tracking). Google uses it to attribute the Google Cloud resources that run your cluster to the Redpanda Marketplace listing. The value identifies the Redpanda listing and contains no information about your organization or your data. The label appears on the following resources: - The GKE cluster - GCE instances and disks - Cloud DNS managed zones - Kubernetes node labels on Redpanda-managed node pools - The Tiered Storage bucket, the Compute Engine address resource, and the agent VM, which get the label the next time you run `rpk cloud byoc gcp apply` How the label behaves: - Redpanda applies the label to existing resources in place. Adding it doesn’t recreate resources, replace nodes, or restart brokers. This includes node pools: Redpanda adds it as a Kubernetes node label, which GKE updates without replacing nodes, not as a GCE label on the node pool. - Redpanda manages the label, so you can’t set or change it yourself. The Control Plane API rejects any update request that adds `goog-partner-solution` or changes its value, with the error `cloud tags cannot contain the reserved key "goog-partner-solution"`. If you include the key when you create a cluster, Redpanda ignores your value. If you omit the key from a `PATCH` request, Redpanda keeps the label on your cluster. - The label doesn’t replace or change your own labels. It counts toward GCP’s per-resource [label limit](https://cloud.google.com/compute/docs/labeling-resources#requirements). - To label GCE instances and disks, the Redpanda agent needs the IAM permissions listed in [Use the Control Plane API](#use-the-control-plane-api). On a BYOC cluster created before Redpanda added those permissions, run `rpk cloud byoc gcp apply` to grant them. On a BYOVPC cluster, make sure the agent’s custom role includes them. The role in [Configure the service project](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/vpc-byo-gcp/#configure-the-service-project) already lists them. ## Service account credential rotation To rotate service account credentials for your BYOC cluster, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new) with your cluster ID, the service accounts that require rotation, and your target timeline. > ⚠️ **WARNING** > > GCP service account credential rotation for BYOC clusters is not self-service. Rotating these credentials without coordinating with Redpanda can disrupt agent connectivity, monitoring, and Tiered Storage uploads, and can leave the cluster stuck and unable to complete future operations. ## Next steps - [Configure private networking](https://docs.redpanda.com/cloud-data-platform/networking/byoc/gcp/) - [Schedule a maintenance window](https://docs.redpanda.com/cloud-data-platform/manage/maintenance/#maintenance-windows) - [Monitor your cluster](https://docs.redpanda.com/cloud-data-platform/manage/monitor-cloud/) - [Choose an authorization model](https://docs.redpanda.com/cloud-data-platform/security/authorization/cloud-authorization/) --- # Page 375: Enable Redpanda Connect on an Existing BYOVPC Cluster on GCP **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/enable-rpcn-byovpc-gcp.md --- # Enable Redpanda Connect on an Existing BYOVPC Cluster on GCP > ❗ **IMPORTANT** > > BYOVPC is an add-on feature that may require an additional purchase. To unlock this feature for your account, contact your Redpanda account team or [Redpanda Sales](https://www.redpanda.com/price-estimator). To enable Redpanda Connect on an existing BYOVPC cluster, you must update your configuration. You can also create [a new BYOVPC cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/vpc-byo-gcp/) with Redpanda Connect already enabled. Replace all `` with your own values. 1. Create two new service accounts with the necessary permissions and roles. Show commands ```bash # Account used to check for and read secrets, which are required to create Redpanda Connect pipelines. gcloud iam service-accounts create redpanda-connect-api \ --display-name="Redpanda Connect API Service Account" cat << EOT > redpanda-connect-api.role { "name": "redpanda_connect_api_role", "title": "Redpanda Connect API Role", "description": "Redpanda Connect API Role", "includedPermissions": [ "resourcemanager.projects.get", "secretmanager.secrets.get", "secretmanager.versions.access" ] } EOT gcloud iam roles create redpanda_connect_api_role --project= --file redpanda-connect-api.role gcloud projects add-iam-policy-binding \ --member="serviceAccount:redpanda-connect-api@.iam.gserviceaccount.com" \ --role="projects//roles/redpanda_connect_api_role" ``` ```bash # Account used to retrieve secrets and create Redpanda Connect pipelines. gcloud iam service-accounts create redpanda-connect \ --display-name="Redpanda Connect Service Account" cat << EOT > redpanda-connect.role { "name": "redpanda_connect_role", "title": "Redpanda Connect Role", "description": "Redpanda Connect Role", "includedPermissions": [ "resourcemanager.projects.get", "secretmanager.versions.access" ] } EOT gcloud iam roles create redpanda_connect_role --project= --file redpanda-connect.role gcloud projects add-iam-policy-binding \ --member="serviceAccount:redpanda-connect@.iam.gserviceaccount.com" \ --role="projects//roles/redpanda_connect_role" ``` 2. Bind the service accounts. The account ID of the GCP service account is used to configure service account bindings. This account ID is the local part of the email address for the GCP service account. For example, if the GCP service account is `my-gcp-sa@my-project.iam.gserviceaccount.com`, then the account ID is `my-gcp-sa`. Show commands ```none gcloud iam service-accounts add-iam-policy-binding @.iam.gserviceaccount.com \ --role roles/iam.workloadIdentityUser \ --member "serviceAccount:.svc.id.goog[redpanda-connect/]" ``` ```none gcloud iam service-accounts add-iam-policy-binding @.iam.gserviceaccount.com \ --role roles/iam.workloadIdentityUser \ --member "serviceAccount:.svc.id.goog[redpanda-connect/]" ``` 3. Make a [`PATCH /v1/clusters/{cluster-id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster) request to update the cluster configuration. Show request ```bash export CLUSTER_PATCH_BODY=`cat << EOF { "customer_managed_resources": { "gcp": { "redpanda_connect_api_service_account": { "email": "@.iam.gserviceaccount.com" }, "redpanda_connect_service_account": { "email": "@.iam.gserviceaccount.com" } } } } EOF` curl -v -X PATCH \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $AUTH_TOKEN" \ -d "$CLUSTER_PATCH_BODY" $PUBLIC_API_ENDPOINT/v1/clusters/ ``` 4. Check Redpanda Connect is available in the Cloud UI. 1. Log in to [Redpanda Cloud](https://cloud.redpanda.com). 2. Go to the **Connect** page and you should see Redpanda Connect. ## Next steps - Choose [connectors for your use case](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/about/). - Learn how to [configure, test, and run a data pipeline locally](https://docs.redpanda.com/connect/get-started/quickstarts/rpk/). - Try the [Redpanda Connect quickstart](https://docs.redpanda.com/cloud-data-platform/develop/connect/connect-quickstart/). - Try one of our [Redpanda Connect cookbooks](https://docs.redpanda.com/cloud-data-platform/develop/connect/cookbooks/). - Learn how to [add secrets to your pipeline](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/). --- # Page 376: Enable Secrets Management on an Existing BYOVPC Cluster on GCP **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/enable-secrets-byovpc-gcp.md --- # Enable Secrets Management on an Existing BYOVPC Cluster on GCP > ❗ **IMPORTANT** > > BYOVPC is an add-on feature that may require an additional purchase. To unlock this feature for your account, contact your Redpanda account team or [Redpanda Sales](https://www.redpanda.com/price-estimator). Storing secrets in your cluster allows you to keep your cloud infrastructure secure as you integrate your data across different systems, for example, REST catalogs with your Iceberg-enabled topics. If you do not have secrets management enabled on an existing BYOVPC cluster, you can do so by following the steps on this page to update your cluster configuration. You can also create [a new BYOVPC cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/vpc-byo-gcp/) with secrets management already enabled. Replace all `` with your own values. 1. Create one new service account with the necessary permissions and roles. Show commands ```bash # Account used to check for and read secrets gcloud iam service-accounts create redpanda-operator \ --display-name="Redpanda Operator Service Account" cat << EOT > redpanda-operator.role { "name": "redpanda_operator_role", "title": "Redpanda Operator Role", "description": "Redpanda Operator Role", "includedPermissions": [ "resourcemanager.projects.get", "secretmanager.secrets.get", "secretmanager.versions.access" ] } EOT gcloud iam roles create redpanda_operator_role --project= --file redpanda-operator.role gcloud projects add-iam-policy-binding \ --member="serviceAccount:redpanda-operator@.iam.gserviceaccount.com" \ --role="projects//roles/redpanda_operator_role" ``` 2. Update the existing Redpanda cluster service account with the necessary permissions to read secrets. Show commands ```bash cat << EOT > redpanda-cluster.role { "name": "redpanda_cluster_role", "title": "Redpanda Cluster Role", "description": "Redpanda Cluster Role", "includedPermissions": [ "resourcemanager.projects.get", "secretmanager.secrets.get", "secretmanager.versions.access" ] } EOT gcloud iam roles create redpanda_cluster_role --project= --file redpanda-cluster.role gcloud projects add-iam-policy-binding \ --member="serviceAccount:redpanda-cluster@.iam.gserviceaccount.com" \ --role="projects//roles/redpanda_cluster_role" ``` 3. Bind the new service account. The account ID of the GCP service account is used to configure service account bindings. This account ID is the local part of the email address for the GCP service account. For example, if the GCP service account is `my-gcp-sa@my-project.iam.gserviceaccount.com`, then the account ID is `my-gcp-sa`. Show commands ```none gcloud iam service-accounts add-iam-policy-binding @.iam.gserviceaccount.com \ --role roles/iam.workloadIdentityUser \ --member "serviceAccount:.svc.id.goog[redpanda-system/]" ``` 4. Make a [`PATCH /v1/clusters/{cluster-id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster) request to update the cluster configuration. Show request ```bash export CLUSTER_PATCH_BODY=`cat << EOF { "customer_managed_resources": { "gcp": { "redpanda_operator_service_account": { "email": "@.iam.gserviceaccount.com" } } } } EOF` curl -v -X PATCH \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $AUTH_TOKEN" \ -d "$CLUSTER_PATCH_BODY" $PUBLIC_API_ENDPOINT/v1/clusters/ ``` 5. Check secrets management is available in the Cloud UI. 1. Log in to [Redpanda Cloud](https://cloud.redpanda.com). 2. Go to the **Secrets Store** page of your cluster. You should be able to create a new secret. ## Next steps - [Reference a secret in a cluster property](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/#set-cluster-configuration-properties). - [Integrate a catalog](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/) for querying Iceberg topics in your cluster. --- # Page 377: Create a BYOVPC Cluster on GCP **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/vpc-byo-gcp.md --- # Create a BYOVPC Cluster on GCP > ❗ **IMPORTANT** > > BYOVPC/BYOVNet is an add-on feature that requires Premium support. To unlock this feature for your account, contact your Redpanda account team or [Redpanda Sales](https://www.redpanda.com/price-estimator). A Bring Your Own Virtual Private Cloud (BYOVPC) cluster allows you to deploy the Redpanda [data plane](https://docs.redpanda.com/home/glossary/#data-plane) into your existing VPC and manage the networking lifecycle. Compared to a standard Bring Your Own Cloud (BYOC) setup, where Redpanda manages the networking lifecycle for you, BYOVPC provides more control. To compare the two variants before you commit to one, see [Choose Between BYOC and BYOVPC](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/choose-byoc-or-byovpc/). See also: [BYOC architecture](https://docs.redpanda.com/cloud-data-platform/get-started/byoc-arch/). When you create a BYOVPC cluster, you specify your VPC and service account. You create the networking and security resources in advance, so the Redpanda Cloud agent doesn’t create or change them. The agent still deploys and operates the Redpanda cluster infrastructure, using the service account you supply and only the permissions you grant it. With BYOVPC: - You provide your own VPC in your Google Cloud account. - You maintain more control of your Google Cloud account, because Redpanda requires fewer permissions than standard BYOC clusters. - You control your security resources and policies, including subnets, service accounts, IAM roles, firewall rules, and storage buckets. If your clients need to connect from different GCP regions than where your cluster will be deployed, you must enable global access during cluster creation. To create a BYOVPC cluster with global access enabled, see [Enable Global Access](https://docs.redpanda.com/cloud-data-platform/networking/byoc/gcp/enable-global-access/). ## Prerequisites - A standalone GCP project is recommended. If your host project (where your VPC project is created) and your service project (where your Redpanda cluster is created) are in different projects, you must first provision a shared VPC in Google Cloud. For more information, see the [Google shared VPC documentation](https://cloud.google.com/vpc/docs/provisioning-shared-vpc). - Redpanda creates a private Google Kubernetes Engine (GKE) cluster in your VPC. The subnet and secondary IP ranges you provide must allow public internet access. The configuration requires you to provide reserved CIDR ranges for the subnet and GKE Pods, Services, and master IP addresses. See the [GKE service account documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/service-accounts) and [Configure your VPC](#configure-your-vpc). - Only primary CIDR ranges are supported for the VPC. - Redpanda requires access to certain Google APIs, storage buckets, and service accounts. See [Configure the service project](#configure-the-service-project). ### GCP quotas Ensure at least three nodes of headroom in the relevant GCP quotas in the same region as your cluster. During maintenance, Redpanda may temporarily create extra nodes. Quotas such as vCPUs per VM family (for example, N2D) and Local SSD total per VM family (quota key: `LOCAL_SSD_TOTAL_GB_PER_VM_FAMILY`) are listed for each tier on the **Create BYOC cluster** page in the Redpanda Cloud UI. Headroom formulas: - vCPU spare = `3 x (vCPUs per node)` - Local SSD spare (GB) = `3 x (Storage size per node in GB)` For example, with per-node storage **1500 GB** (4 × 375 GB Local SSD) and machine type **n2d-standard-4** (4 vCPUs), keep **4500 GB** Local SSD and **12 vCPUs** of spare quota. ## Limitations - Existing clusters cannot be moved to a BYOVPC cluster. - After creating a BYOVPC cluster, you cannot change to a different VPC. ## Configure your VPC 1. Create the primary and secondary subnets in your VPC using CIDR notation. Redpanda clusters require one subnet, and that subnet should have two secondary IP ranges: - Subnet IP range should be at least /24 CIDR, such as 10.0.0.0/24. - Secondary IP for GKE Pods is a /21 CIDR, such as 10.0.8.0/21. - Secondary IP for GKE Services is a /24 CIDR, such as 10.0.1.0/24. Replace all `` with your own values. ```bash gcloud compute networks subnets create \ --project \ --network \ --range 10.0.0.0/24 \ --region \ --secondary-range =10.0.8.0/21,=10.0.1.0/24 ``` Additionally, a /28 CIDR is required for the GKE master IP addresses. This CIDR is not used in the GCP networking configuration, but is input into the Redpanda UI; for example, 10.0.7.240/28. 2. To enable egress, create a cloud router and NAT at the host project: ```bash gcloud compute routers create \ --project \ --region \ --network gcloud compute addresses create --region gcloud compute routers nats create \ --project \ --router \ --region \ --nat-all-subnet-ip-ranges \ --nat-external-ip-pool \ --enable-endpoint-independent-mapping ``` 3. Create VPC firewall rules. - Redpanda ingress: ```bash gcloud compute firewall-rules create redpanda-ingress \ --description="Allow access to Redpanda cluster" \ --network="" \ --project="" \ --direction="INGRESS" \ --target-tags="redpanda-node" \ --source-ranges="10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,100.64.0.0/10" \ --allow="tcp:9092-9094,tcp:30081,tcp:30082,tcp:30092" ``` - Master webhooks: ```bash gcloud compute firewall-rules create gke-redpanda-cluster-webhooks \ --description="Allow master to hit pods for admission controllers/webhooks" \ --network="" \ --project="" \ --direction="INGRESS" \ --source-ranges="" \ --allow="tcp:9443,tcp:8443,tcp:6443" ``` Replace `` with a /28 CIDR. For example: 172.16.0.32/28. For information about the master CIDR, and how to set it using `--master-ipv4-cidr`, see the **gcloud** tab in [Creating a private cluster with no client access to the public endpoint](https://cloud.google.com/kubernetes-engine/docs/how-to/legacy/network-isolation#private_cp) 4. Grant permission to read the VPC and related resources. If the host project and service project are in different projects, it’s helpful for the Redpanda team to have read access to the VPC and related resources in the host project. If your host project and service project are the same, you can skip this step. - Redpanda Agent custom role: ```bash cat << EOT > redpanda-agent.role { "name": "redpanda_agent_role", "title": "Redpanda Agent Role", "description": "A role granting the redpanda agent permissions to view network resources in the project of the vpc.", "includedPermissions": [ "compute.firewalls.get", "compute.subnetworks.get", "resourcemanager.projects.get", "compute.networks.getRegionEffectiveFirewalls", "compute.networks.getEffectiveFirewalls" ] } EOT gcloud iam roles create redpanda_agent_role --project= --file redpanda-agent.role ``` ## Configure the service project 1. Enable Google APIs in the service project: ```bash gcloud services enable cloudresourcemanager.googleapis.com --project gcloud services enable dns.googleapis.com --project gcloud services enable secretmanager.googleapis.com --project gcloud services enable compute.googleapis.com --project gcloud services enable iam.googleapis.com --project gcloud services enable storage-api.googleapis.com --project gcloud services enable container.googleapis.com --project gcloud services enable serviceusage.googleapis.com --project ``` 2. Create storage buckets at the service project in the same region as the cluster: ```bash gcloud storage buckets create gs:// \ --location="" \ --uniform-bucket-level-access gcloud storage buckets create gs:// \ --location="" \ --uniform-bucket-level-access gcloud storage buckets update gs:// --versioning ``` - Redpanda uses the tiered storage bucket for writing log segments. This should not be versioned. - Redpanda uses the management storage bucket to store cluster metadata. This can have versioning enabled. 3. Create service accounts with necessary permissions and roles. - Redpanda Cloud agent service account Show commands ```bash gcloud iam service-accounts create redpanda-agent \ --display-name="Redpanda Agent Service Account" cat << EOT > redpanda-agent.role { "name": "redpanda_agent_role", "title": "Redpanda Agent Role", "description": "A role comprising general permissions allowing the agent to manage Redpanda cluster resources.", "includedPermissions": [ "compute.firewalls.get", "compute.disks.get", "compute.globalOperations.get", "compute.instanceGroupManagers.get", "compute.instanceGroupManagers.delete", "compute.instanceGroups.delete", "compute.instances.list", "compute.instanceTemplates.delete", "compute.networks.getRegionEffectiveFirewalls", "compute.networks.getEffectiveFirewalls", "compute.projects.get", "compute.subnetworks.get", "compute.zoneOperations.get", "compute.zoneOperations.list", "compute.zones.get", "compute.zones.list", "dns.changes.create", "dns.changes.get", "dns.changes.list", "dns.managedZones.create", "dns.managedZones.delete", "dns.managedZones.get", "dns.managedZones.list", "dns.managedZones.update", "dns.projects.get", "dns.resourceRecordSets.create", "dns.resourceRecordSets.delete", "dns.resourceRecordSets.get", "dns.resourceRecordSets.list", "dns.resourceRecordSets.update", "iam.roles.get", "iam.roles.list", "iam.serviceAccounts.actAs", "iam.serviceAccounts.get", "iam.serviceAccounts.getIamPolicy", "resourcemanager.projects.get", "resourcemanager.projects.getIamPolicy", "serviceusage.services.list", "storage.buckets.get", "storage.buckets.getIamPolicy", "compute.subnetworks.use", "compute.instances.use", "compute.networks.use", "compute.regionOperations.get", "compute.serviceAttachments.create", "compute.serviceAttachments.delete", "compute.serviceAttachments.get", "compute.serviceAttachments.list", "compute.serviceAttachments.update", "compute.forwardingRules.use", "compute.forwardingRules.create", "compute.forwardingRules.delete", "compute.forwardingRules.get", "compute.forwardingRules.setLabels", "compute.forwardingRules.setTarget", "compute.forwardingRules.pscCreate", "compute.forwardingRules.pscDelete", "compute.forwardingRules.pscSetLabels", "compute.forwardingRules.pscSetTarget", "compute.forwardingRules.pscUpdate", "compute.regionBackendServices.create", "compute.regionBackendServices.delete", "compute.regionBackendServices.get", "compute.regionBackendServices.use", "compute.regionNetworkEndpointGroups.create", "compute.regionNetworkEndpointGroups.delete", "compute.regionNetworkEndpointGroups.get", "compute.regionNetworkEndpointGroups.use", "compute.regionNetworkEndpointGroups.attachNetworkEndpoints", "compute.regionNetworkEndpointGroups.detachNetworkEndpoints", "compute.disks.list", "compute.disks.setLabels", "compute.instanceGroupManagers.update", "compute.instances.delete", "compute.instances.get", "compute.instances.setLabels" ] } EOT gcloud iam roles create redpanda_agent_role --project= --file redpanda-agent.role gcloud projects add-iam-policy-binding \ --member="serviceAccount:redpanda-agent@.iam.gserviceaccount.com" \ --role="projects//roles/redpanda_agent_role" gcloud projects add-iam-policy-binding \ --member="serviceAccount:redpanda-agent@.iam.gserviceaccount.com" \ --role="roles/container.admin" gcloud storage buckets add-iam-policy-binding gs:// \ --member="serviceAccount:redpanda-agent@.iam.gserviceaccount.com" \ --role="roles/storage.objectAdmin" # skip this step if host project and service project are the same gcloud projects add-iam-policy-binding \ --member="serviceAccount:redpanda-agent@.iam.gserviceaccount.com" \ --role="projects//roles/redpanda_agent_role" ``` - Redpanda cluster service account Show commands ```bash cat << EOT > redpanda-cluster.role { "name": "redpanda_cluster_role", "title": "Redpanda Cluster Role", "description": "Redpanda Cluster role", "includedPermissions": [ "resourcemanager.projects.get", "secretmanager.secrets.get", "secretmanager.versions.access" ] } EOT gcloud iam service-accounts create redpanda-cluster \ --display-name="Redpanda Cluster Service Account" gcloud storage buckets add-iam-policy-binding gs:// \ --member="serviceAccount:redpanda-cluster@.iam.gserviceaccount.com" \ --role="roles/storage.objectAdmin" gcloud iam roles create redpanda_cluster_role --project= --file redpanda-cluster.role gcloud projects add-iam-policy-binding \ --member="serviceAccount:redpanda-cluster@.iam.gserviceaccount.com" \ --role="projects//roles/redpanda_cluster_role" ``` - Redpanda operator service account Show commands ```bash gcloud iam service-accounts create redpanda-operator \ --display-name="Redpanda Operator Service Account" cat << EOT > redpanda-operator.role { "name": "redpanda_operator_role", "title": "Redpanda Operator Role", "description": "Redpanda Operator role", "includedPermissions": [ "resourcemanager.projects.get", "secretmanager.secrets.get", "secretmanager.versions.access" ] } EOT gcloud iam roles create redpanda_operator_role --project= --file redpanda-operator.role gcloud projects add-iam-policy-binding \ --member="serviceAccount:redpanda-operator@.iam.gserviceaccount.com" \ --role="projects//roles/redpanda_operator_role" ``` - Redpanda Connect service accounts Show commands ```bash # Account used to check for and read secrets, which are required to create Redpanda Connect pipelines. gcloud iam service-accounts create redpanda-connect-api \ --display-name="Redpanda Connect API Service Account" cat << EOT > redpanda-connect-api.role { "name": "redpanda_connect_api_role", "title": "Redpanda Connect API Role", "description": "Redpanda Connect API role", "includedPermissions": [ "resourcemanager.projects.get", "secretmanager.secrets.get", "secretmanager.versions.access" ] } EOT gcloud iam roles create redpanda_connect_api_role --project= --file redpanda-connect-api.role gcloud projects add-iam-policy-binding \ --member="serviceAccount:redpanda-connect-api@.iam.gserviceaccount.com" \ --role="projects//roles/redpanda_connect_api_role" ``` ```bash # Account used to retrieve secrets and create Redpanda Connect pipelines. gcloud iam service-accounts create redpanda-connect \ --display-name="Redpanda Connect Service Account" cat << EOT > redpanda-connect.role { "name": "redpanda_connect_role", "title": "Redpanda Connect Role", "description": "Redpanda Connect role", "includedPermissions": [ "resourcemanager.projects.get", "secretmanager.versions.access" ] } EOT gcloud iam roles create redpanda_connect_role --project= --file redpanda-connect.role gcloud projects add-iam-policy-binding \ --member="serviceAccount:redpanda-connect@.iam.gserviceaccount.com" \ --role="projects//roles/redpanda_connect_role" ``` - Redpanda Cloud secret manager Show commands ```bash gcloud iam service-accounts create redpanda-console \ --display-name="Redpanda Cloud Secret Manager" cat << EOT > redpanda-console.role { "name": "redpanda_console_secret_manager_role", "title": "Redpanda Cloud Secret Manager Writer", "description": "Redpanda Cloud Secret Manager Writer", "includedPermissions": [ "secretmanager.secrets.get", "secretmanager.secrets.create", "secretmanager.secrets.delete", "secretmanager.secrets.list", "secretmanager.secrets.update", "secretmanager.versions.add", "secretmanager.versions.destroy", "secretmanager.versions.disable", "secretmanager.versions.enable", "secretmanager.versions.list", "iam.serviceAccounts.getAccessToken" ] } EOT gcloud iam roles create redpanda_console_secret_manager_role --project= --file redpanda-console.role gcloud projects add-iam-policy-binding \ --member="serviceAccount:redpanda-console@.iam.gserviceaccount.com" \ --role="projects//roles/redpanda_console_secret_manager_role" ``` - Kafka Connect service account Show commands ```bash gcloud iam service-accounts create redpanda-connectors \ --display-name="Kafka Connect Service Account" cat << EOT > redpanda-connectors.role { "name": "redpanda_connectors_role", "title": "Kafka Connect Custom Role", "description": "Kafka Connect custom role", "includedPermissions": [ "resourcemanager.projects.get", "secretmanager.versions.access" ] } EOT gcloud iam roles create redpanda_connectors_role --project= --file redpanda-connectors.role gcloud projects add-iam-policy-binding \ --member="serviceAccount:redpanda-connectors@.iam.gserviceaccount.com" \ --role="projects//roles/redpanda_connectors_role" ``` - Redpanda GKE cluster service account Show commands ```bash gcloud iam service-accounts create redpanda-gke \ --display-name="Redpanda GKE cluster default node service account" cat << EOT > redpanda-gke.role { "name": "redpanda_gke_utility_role", "title": "Redpanda cluster utility node role", "description": "Redpanda cluster utility node role", "includedPermissions": [ "artifactregistry.dockerimages.get", "artifactregistry.dockerimages.list", "artifactregistry.files.get", "artifactregistry.files.list", "artifactregistry.locations.get", "artifactregistry.locations.list", "artifactregistry.mavenartifacts.get", "artifactregistry.mavenartifacts.list", "artifactregistry.npmpackages.get", "artifactregistry.npmpackages.list", "artifactregistry.packages.get", "artifactregistry.packages.list", "artifactregistry.projectsettings.get", "artifactregistry.pythonpackages.get", "artifactregistry.pythonpackages.list", "artifactregistry.repositories.downloadArtifacts", "artifactregistry.repositories.get", "artifactregistry.repositories.list", "artifactregistry.repositories.listEffectiveTags", "artifactregistry.repositories.listTagBindings", "artifactregistry.repositories.readViaVirtualRepository", "artifactregistry.tags.get", "artifactregistry.tags.list", "artifactregistry.versions.get", "artifactregistry.versions.list", "logging.logEntries.create", "logging.logEntries.route", "monitoring.metricDescriptors.create", "monitoring.metricDescriptors.get", "monitoring.metricDescriptors.list", "monitoring.monitoredResourceDescriptors.get", "monitoring.monitoredResourceDescriptors.list", "monitoring.timeSeries.create", "cloudnotifications.activities.list", "monitoring.alertPolicies.get", "monitoring.alertPolicies.list", "monitoring.dashboards.get", "monitoring.dashboards.list", "monitoring.groups.get", "monitoring.groups.list", "monitoring.notificationChannelDescriptors.get", "monitoring.notificationChannelDescriptors.list", "monitoring.notificationChannels.get", "monitoring.notificationChannels.list", "monitoring.publicWidgets.get", "monitoring.publicWidgets.list", "monitoring.services.get", "monitoring.services.list", "monitoring.slos.get", "monitoring.slos.list", "monitoring.snoozes.get", "monitoring.snoozes.list", "monitoring.timeSeries.list", "monitoring.uptimeCheckConfigs.get", "monitoring.uptimeCheckConfigs.list", "opsconfigmonitoring.resourceMetadata.list", "resourcemanager.projects.get", "stackdriver.projects.get", "stackdriver.resourceMetadata.list", "dns.changes.create", "dns.changes.get", "dns.changes.list", "dns.managedZones.list", "dns.resourceRecordSets.create", "dns.resourceRecordSets.delete", "dns.resourceRecordSets.get", "dns.resourceRecordSets.list", "dns.resourceRecordSets.update", "secretmanager.versions.access", "stackdriver.resourceMetadata.write", "storage.objects.get", "storage.objects.list", "compute.instances.use", "iam.serviceAccounts.getAccessToken", "compute.regionNetworkEndpointGroups.create", "compute.regionNetworkEndpointGroups.delete", "compute.regionNetworkEndpointGroups.get", "compute.regionNetworkEndpointGroups.use", "compute.regionNetworkEndpointGroups.attachNetworkEndpoints", "compute.regionNetworkEndpointGroups.detachNetworkEndpoints" ] } EOT gcloud iam roles create redpanda_gke_utility_role --project= --file redpanda-gke.role gcloud projects add-iam-policy-binding \ --member="serviceAccount:redpanda-gke@.iam.gserviceaccount.com" \ --role="projects//roles/redpanda_gke_utility_role" ``` 4. Bind the service accounts. The account ID of the GCP service account is used to configure service account bindings. This account ID is the local part of the email address for the GCP service account. For example, if the GCP service account is `my-gcp-sa@my-project.iam.gserviceaccount.com`, then the account ID is `my-gcp-sa`. - Redpanda cluster service account Show command ```bash gcloud iam service-accounts add-iam-policy-binding @.iam.gserviceaccount.com \ --role roles/iam.workloadIdentityUser \ --member "serviceAccount:.svc.id.goog[redpanda/rp-]" ``` - Redpanda operator service account Show command ```bash gcloud iam service-accounts add-iam-policy-binding @.iam.gserviceaccount.com \ --role roles/iam.workloadIdentityUser \ --member "serviceAccount:.svc.id.goog[redpanda-system/]" ``` - Redpanda Console service account Show command ```bash gcloud iam service-accounts add-iam-policy-binding @.iam.gserviceaccount.com \ --role roles/iam.workloadIdentityUser \ --member "serviceAccount:.svc.id.goog[redpanda/console-]" ``` - Redpanda Connect service accounts Show command ```bash gcloud iam service-accounts add-iam-policy-binding @.iam.gserviceaccount.com \ --role roles/iam.workloadIdentityUser \ --member "serviceAccount:.svc.id.goog[redpanda-connect/]" ``` ```bash gcloud iam service-accounts add-iam-policy-binding @.iam.gserviceaccount.com \ --role roles/iam.workloadIdentityUser \ --member "serviceAccount:.svc.id.goog[redpanda-connect/]" ``` - Kafka Connect service account Show command ```bash gcloud iam service-accounts add-iam-policy-binding @.iam.gserviceaccount.com \ --role roles/iam.workloadIdentityUser \ --member "serviceAccount:.svc.id.goog[redpanda-connectors/connectors-]" ``` - Cert-manager and external-DNS service accounts Show commands ```bash gcloud iam service-accounts add-iam-policy-binding @.iam.gserviceaccount.com \ --role roles/iam.workloadIdentityUser \ --member "serviceAccount:.svc.id.goog[cert-manager/cert-manager]" gcloud iam service-accounts add-iam-policy-binding @.iam.gserviceaccount.com \ --role roles/iam.workloadIdentityUser \ --member "serviceAccount:.svc.id.goog[external-dns/external-dns]" ``` - Private Service Connect Controller service account Show commands ```bash gcloud iam service-accounts add-iam-policy-binding @.iam.gserviceaccount.com \ --role roles/iam.workloadIdentityUser \ --member "serviceAccount:.svc.id.goog[redpanda-psc/psc-controller]" ``` ## Create cluster Log in to the [Redpanda Cloud UI](https://cloud.redpanda.com), and follow the steps to [create a BYOC cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/create-byoc-cluster-gcp/), with the following exceptions: 1. On the **Network** page, select the **BYOVPC** connection type, and enter the network, service account, storage bucket information, and GKE master CIDR range you created. 2. With customer-managed networks, you must grant yourself (the user deploying the cluster with `rpk`) the following permissions: Expand permissions - `compute.disks.create` - `compute.disks.setLabels` - `compute.instanceGroupManagers.create` - `compute.instanceGroupManagers.delete` - `compute.instanceGroupManagers.get` - `compute.instanceGroups.create` - `compute.instanceGroups.delete` - `compute.instanceTemplates.create` - `compute.instanceTemplates.delete` - `compute.instanceTemplates.get` - `compute.instanceTemplates.useReadOnly` - `compute.instances.create` - `compute.instances.setLabels` - `compute.instances.setMetadata` - `compute.instances.setTags` - `compute.subnetworks.get` - `compute.subnetworks.use` - `compute.zones.list` - `iam.roles.get` - `iam.serviceAccounts.actAs` - `iam.serviceAccounts.get` - `resourcemanager.projects.get` - `resourcemanager.projects.getIamPolicy` - `serviceusage.services.list` - `storage.buckets.get` - `storage.buckets.getIamPolicy` - `storage.objects.create` - `storage.objects.delete` - `storage.objects.get` - `storage.objects.list` This can be done through a Google account, a service account, or any principal identity supported by GCP. - If running `rpk` from a Google account, the user must acquire new user credentials to use for [Application Default Credentials](https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login). - If running `rpk` from a service account, the user must create a [service account key](https://cloud.google.com/iam/docs/keys-create-delete#creating), then [export GOOGLE_APPLICATION_CREDENTIALS](https://cloud.google.com/docs/authentication/application-default-credentials#GAC) and [set the account as the default in gcloud](https://cloud.google.com/sdk/gcloud/reference/config/set): ```bash export GOOGLE_APPLICATION_CREDENTIALS= gcloud config set account $SERVICE_ACCOUNT@$PROJECT_ID.iam.gserviceaccount.com ``` 3. To validate your configuration, run: ```bash rpk cloud byoc gcp apply --redpanda-id='' --project-id='' --validate-only ``` 4. Click **Next**. 5. On the **Deploy** page, similar to standard BYOC clusters, log in to Redpanda Cloud and deploy the agent. > 📝 **NOTE** > > Redpanda Cloud does not support customer access or modifications to any of the internal data plane resources. This restriction allows Redpanda Data to manage all configuration changes internally to ensure a 99.99% service level agreement (SLA) for BYOC clusters. ## Delete cluster You can delete the cluster in the Cloud UI. 1. Log in to [Redpanda Cloud](https://cloud.redpanda.com). 2. Select your cluster. 3. Go to the **Dataplane settings** page and click **Delete**, then confirm your deletion. ## Manage custom resource labels and network tags Your organization might require custom resource labels and network tags for cost allocation, audit compliance, or governance policies. After cluster creation, you can manage labels and network tags on your cluster’s **Dataplane settings** page in the Redpanda Cloud UI, or with the [Control Plane API](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-byoc-controlplane-api/). Redpanda reserves some label keys. See [Reserved label and network tag keys](#reserved-tag-keys). > ⚠️ **CAUTION** > > Do not add labels or network tags directly to the GCP node pools of a BYOC cluster, either in the GCP console or with commands such as `gcloud container node-pools update`. Google Kubernetes Engine (GKE) treats a node pool label or tag update as a node replacement and aggressively replaces all nodes, rather than performing a controlled rolling upgrade. This bypasses the failover process that Redpanda requires for safe node cycling. It can leave persistent volume claims (PVCs) in a pending state and may require recovering the entire cluster. > > The Dataplane settings page and the Control Plane API are the supported methods. With both, Redpanda applies labels directly to the Google Compute Engine (GCE) instances and disks in your cluster, and network tags directly to the instances. Because nothing is applied to the node pools, GKE does not replace any nodes. ### Use the Dataplane settings page To manage labels and network tags in the Redpanda Cloud UI: 1. In the Redpanda Cloud UI, open your [cluster](https://cloud.redpanda.com/clusters), and click **Dataplane settings**. 2. Under **Manage resource labels and network tags for your cluster**, click **Add**, and enter a key and value for each label. Keys and values are case-sensitive. To apply a network tag to the GCE instances in the cluster, use a key that starts with `gcp.network-tag.`. For example, the key `gcp.network-tag.web-servers` applies the `web-servers` [network tag](https://cloud.google.com/vpc/docs/add-remove-network-tags). You can add up to 10 entries on this page. To manage up to 16, use the [Control Plane API](#use-the-control-plane-api). 3. Click **Save**. ### Use the Control Plane API The Control Plane API allows up to 16 custom resource labels and network tags in GCP. Make sure you have: - The cluster ID. You can find this in the Redpanda Cloud UI, in the page header of the cluster overview. - A valid bearer token for the Control Plane API. For details, see [Authenticate to the API](https://docs.redpanda.com/api/doc/cloud-controlplane/authentication). Then complete the following steps: 1. To refresh agent permissions so the Redpanda agent can update labels and network tags, run: ```bash export CLUSTER_ID="" export PROJECT_ID="" rpk cloud byoc gcp apply --redpanda-id="$CLUSTER_ID" --project-id="$PROJECT_ID" ``` This step is required because label/tag management requires additional IAM permissions that may not have been granted during initial cluster creation: - `compute.disks.get` - `compute.disks.list` - `compute.disks.setLabels` - `compute.instances.setLabels` 2. To update labels and network tags, invoke the Control Plane API. First, set your authentication token: ```bash export AUTH_TOKEN="" ``` The `PATCH` call sets the labels and network tags specified under `"cloud_provider_tags"`. It replaces the existing labels and tags with the specified labels and tags. Include all desired labels and tags in the request. To remove a single entry, omit it from the map you send. ```bash cluster_patch_body=$(cat <<'JSON' { "cloud_provider_tags": { "environment": "production", "cost-center": "engineering", "gcp.network-tag.web-servers": "true", "gcp.network-tag.database-access": "true" } } JSON ) curl -X PATCH "https://api.redpanda.com/v1/clusters/$CLUSTER_ID" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $AUTH_TOKEN" \ -d "$cluster_patch_body" ``` To remove all labels and network tags, send an empty `cloud_provider_tags` object: ```bash cluster_patch_body='{"cloud_provider_tags": {}}' curl -X PATCH "https://api.redpanda.com/v1/clusters/$CLUSTER_ID" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $AUTH_TOKEN" \ -d "$cluster_patch_body" ``` Labels that Redpanda manages, such as the [Google Cloud Marketplace label](#marketplace-label), remain. ### Reserved label and network tag keys Redpanda rejects the following label keys when you create the cluster, when you add labels on the Dataplane settings page, and when you update labels with the Control Plane API: - `redpanda-org` - `redpanda-id` - `network-id` - `redpanda-client` If you enter a reserved key in the UI, the UI shows the error `This field is already in use by Redpanda`. Redpanda matches keys exactly. Label keys must start with a lowercase letter and can contain only lowercase letters, numbers, underscores, and dashes, except for the `gcp.network-tag.` prefix. Redpanda also reserves `goog-partner-solution` for all organizations. See [Google Cloud Marketplace consumption-tracking label](#marketplace-label). When you update labels with the Control Plane API, it rejects the request only if the request adds one of the four reserved keys or changes the value Redpanda set for it. You can send the reserved labels back unchanged, for example from a `GET` response, or leave them out. Also avoid the following keys: - Keys that start with `redpanda-`. Redpanda uses this prefix for its own labels, such as `redpanda-managed`. The Redpanda agent ignores custom labels with this prefix on GCE instances and disks, and the Redpanda Terraform provider drops them from state. - Keys that start with `goog-gke-` or `goog-k8s-`. GKE sets these labels on node instances, and the Redpanda agent ignores custom labels with these prefixes. Redpanda treats keys that start with `gcp.network-tag.` as network tag requests for the GCE instances in the cluster, not as labels. ### Google Cloud Marketplace consumption-tracking label If your organization subscribes to Redpanda Cloud through a Google Cloud Marketplace private offer, Redpanda adds the following label to the GCP resources it creates for your BYOC clusters: ```text goog-partner-solution=isol_plb32_0014m00001udwjbqaq_hsnezwtawmwgng3icvr677juyhbusiap ``` Google Cloud Marketplace requires this label for [partner consumption tracking](https://docs.cloud.google.com/marketplace/docs/partners/integrated-saas/partner-consumption-tracking). Google uses it to attribute the Google Cloud resources that run your cluster to the Redpanda Marketplace listing. The value identifies the Redpanda listing and contains no information about your organization or your data. The label appears on the following resources: - The GKE cluster - GCE instances and disks - Cloud DNS managed zones - Kubernetes node labels on Redpanda-managed node pools - The Tiered Storage bucket, the Compute Engine address resource, and the agent VM, which get the label the next time you run `rpk cloud byoc gcp apply` How the label behaves: - Redpanda applies the label to existing resources in place. Adding it doesn’t recreate resources, replace nodes, or restart brokers. This includes node pools: Redpanda adds it as a Kubernetes node label, which GKE updates without replacing nodes, not as a GCE label on the node pool. - Redpanda manages the label, so you can’t set or change it yourself. The Control Plane API rejects any update request that adds `goog-partner-solution` or changes its value, with the error `cloud tags cannot contain the reserved key "goog-partner-solution"`. If you include the key when you create a cluster, Redpanda ignores your value. If you omit the key from a `PATCH` request, Redpanda keeps the label on your cluster. - The label doesn’t replace or change your own labels. It counts toward GCP’s per-resource [label limit](https://cloud.google.com/compute/docs/labeling-resources#requirements). - To label GCE instances and disks, the Redpanda agent needs the IAM permissions listed in [Use the Control Plane API](#use-the-control-plane-api). On a BYOC cluster created before Redpanda added those permissions, run `rpk cloud byoc gcp apply` to grant them. On a BYOVPC cluster, make sure the agent’s custom role includes them. The role in [Configure the service project](#configure-the-service-project) already lists them. > 📝 **NOTE** > > For BYOVPC clusters, custom labels are not applied to the customer-managed resources that are deployed by the customer. ## Next steps - [Configure private networking](https://docs.redpanda.com/cloud-data-platform/networking/byoc/gcp/) - [Redpanda Access to Your Environment](https://docs.redpanda.com/cloud-data-platform/security/redpanda-access/) - [Enable Redpanda SQL on a BYOVPC Cluster on GCP](https://docs.redpanda.com/cloud-data-platform/sql/get-started/enable-sql-byovpc-gcp/) --- # Page 378: Create Remote Read Replicas **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/remote-read-replicas.md --- # Create Remote Read Replicas A remote read replica topic is a read-only topic that mirrors a topic on a different cluster. You can create a separate remote cluster just for consumers of this topic and populate its topics from object storage. A read-only topic on a remote cluster can serve any consumer, without increasing the load on the source cluster. Because these read-only topics access data directly from object storage, there’s no impact to the performance of the cluster. Remote read replica topics do not store any data. When a cluster running a remote read replica is terminated, the topic data only exists on the origin cluster. Redpanda Cloud supports remote read replica topics in BYOC clusters on AWS or GCP. These clusters can be ephemeral; that is, created temporarily to handle specific or transient workloads, but they don’t have to be. The ability to make them ephemeral provides flexibility and cost efficiency: you can scale resources up or down as needed and pay only for what you use. > ❗ **IMPORTANT** > > Creating the remote read replica topic is only one of several required steps. To set up a remote read replica, you must complete all of the following: > > 1. **BYOVPC only**: Grant the reader cluster’s service account read access to the source cluster’s storage bucket. See [BYOVPC: Grant storage permissions](#byovpc-storage-permissions). > > 2. Link the reader cluster to the source cluster by setting `read_replica_cluster_ids`. See [Link the reader cluster to the source cluster](#link-clusters). Creating the topic alone does _not_ link the clusters. > > 3. Create the remote read replica topic. See [Create remote read replica topic](#create-remote-read-replica-topic). ## Prerequisites To use remote read replicas, you need: - A BYOC reader cluster in Ready state. This separate reader cluster must exist in the same Redpanda organization as the source cluster. - AWS: The reader cluster must be in the same region and the same account as the source cluster. - GCP: The reader cluster can be in the same or a different region as the source cluster. The reader cluster must be in the same project as the source cluster. - Azure: Remote read replicas are not supported. ### BYOVPC: Grant storage permissions > 📝 **NOTE** > > This prerequisite only applies to BYOVPC deployments. Skip this step if you’re enabling remote read replicas on standard BYOC clusters. #### GCP To grant additional permissions to the cloud storage manager of the reader cluster, run: ```bash gcloud storage buckets add-iam-policy-binding \ gs:// \ --member="serviceAccount:" \ --role="roles/storage.objectViewer" ``` #### AWS To grant additional permissions to the cloud storage manager of the reader cluster, set the `source_cluster_bucket_names` and `reader_cluster_id` variables in [cloud-examples](https://github.com/redpanda-data/cloud-examples/blob/main/customer-managed/aws/terraform/variables.tf). This should be done in the Terraform of the reader cluster. If the reader cluster’s service account does not have read access to the source cluster’s storage bucket, creating the remote read replica topic fails with an error like `UNKNOWN_SERVER_ERROR: Unable to perform requested topic operation`. ## Link the reader cluster to the source cluster Linking is a required step. It does more than record the relationship between the clusters: - It orders upgrades safely across the linked clusters. - It prevents the source cluster from being deleted while it is linked to a reader cluster. The way linking interacts with storage permissions depends on your deployment type: - Standard BYOC: Linking the clusters grants the reader cluster read access to the source cluster’s storage bucket, so you cannot create a remote read replica topic until the clusters are linked. - BYOVPC: You grant the reader cluster read access to the bucket manually (see [BYOVPC: Grant storage permissions](#byovpc-storage-permissions)), so creating the topic succeeds even when the clusters are not linked. This makes the linking step easy to miss. > ⚠️ **WARNING** > > Creating a remote read replica topic does _not_ link the reader cluster to the source cluster. You must also set `read_replica_cluster_ids` as described in this section. Without this link, upgrades are not ordered safely across the clusters, and the source cluster is not protected from deletion, even if remote read replica topics exist. Add or remove reader clusters to a source cluster in Redpanda Cloud with the [Cloud Control Plane API](https://docs.redpanda.com/cloud-data-platform/manage/api/controlplane/). For information on accessing the Cloud API, see the [authentication guide](https://docs.redpanda.com/api/doc/cloud-controlplane/authentication). 1. To update your source cluster to add one or more reader cluster IDs, make a [`PATCH /v1/clusters/{cluster.id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster) request. The full list of clusters is expected on every call. If an ID is removed from the list, it is removed as a reader cluster. ```bash export SOURCE_CLUSTER_ID=....... export READER_CLUSTER_ID=....... curl -X PATCH $API_HOST/v1/clusters/$SOURCE_CLUSTER_ID \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_TOKEN" \ -d @- << EOF { "read_replica_cluster_ids": ["$READER_CLUSTER_ID"] } EOF ``` 2. Optional: To see the list of reader clusters on a given source cluster, make a [`GET /v1/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_getcluster) request: ```bash export SOURCE_CLUSTER_ID=....... curl -X GET $API_HOST/v1/clusters/$SOURCE_CLUSTER_ID \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_TOKEN" ``` > 📝 **NOTE** > > A source cluster cannot be deleted while any reader cluster IDs are set in its `read_replica_cluster_ids` list. This deletion protection is based on the link, not on the existence of remote read replica topics. When you delete a reader cluster, that cluster’s ID is automatically removed from any existing source cluster `read_replica_cluster_ids` lists. ## Create remote read replica topic To create a remote read replica topic, run: ```bash rpk topic create -c redpanda.remote.readreplica= --tls-enabled ``` - For ``, use the same name as the original topic. - For ``, use the bucket specified in the `cloud_storage_bucket` property for the origin cluster. For standard BYOC clusters, the source cluster bucket name follows the pattern: `redpanda-cloud-storage-${SOURCE_CLUSTER_ID}` ## Optional: Tune for live topics For remote read replicas reading from a live topic (that is, a topic that’s being actively written to by a source cluster), it may be advantageous to control how often segments are flushed to object storage. By default, this is set to 60 minutes. To tune `cloud_storage_segment_max_upload_interval_sec` on the source cluster, contact [Redpanda support](https://support.redpanda.com/hc/en-us/requests/new). (For cold topics, where segments are closed and older than 60 minutes, this configuration is unnecessary: the data is already uploaded to object storage.) --- # Page 379: Size and Price a BYOC Cluster **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/size-byoc-cluster.md --- # Size and Price a BYOC Cluster When you create a BYOC cluster, size it from your workload requirements instead of translating them into Redpanda tier terminology. Describe your workload, such as throughput and [partitions](https://docs.redpanda.com/home/glossary/#partition), and Redpanda recommends machine configurations with price estimates. Workload-based sizing is the recommended way to size a cluster. After reading this page, you will be able to: - Describe your workload to get recommended machine configurations with price estimates - Compare sizing options by RPU rate, machine type, and broker count > 📝 **NOTE** > > Workload-based sizing is available only to organizations on usage-based billing. If you don’t see the **Size your workload** section when you create a BYOC cluster, contact your Redpanda account team. Other organizations select a [usage tier](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/) instead. ## How sizing works You can size a cluster in two ways: - **Describe your workload.** Provide your partition count and your ingress and egress throughput, and optionally a latency target, producer count, and consumer count. Redpanda resolves the compute capacity your workload needs and recommends machine configurations that provide it. - **Specify capacity directly.** Provide a rate of Redpanda Processing Units (RPUs), from 1 to 384. One RPU represents two vCPUs of [broker](https://docs.redpanda.com/home/glossary/#broker) compute. Redpanda resolves the machine configurations that deliver that capacity. Use this mode only if you already know the capacity you need; describing your workload is the recommended path. Both ways return a ranked list of viable machine configurations. Each option shows its machine type, broker count, and RPU rate. The **Estimated costs** panel shows the hourly and monthly estimate for the selected configuration, covering Redpanda compute and SQL engine license costs. Price estimates use your organization’s rate card. ## Size a cluster in the Cloud UI 1. Log in to [Redpanda Cloud](https://cloud.redpanda.com). 2. On the Clusters page, click **Create cluster**, then click **Create** for BYOC. 3. Enter a cluster name, then select the resource group, provider, region, and availability. If your organization uses usage-based billing, the **Size your workload** section appears in place of the **Tier** selector. 4. Under **Size your workload**, choose how to size the cluster: - On the **Standard** tab, enter the **Number of Partitions**, **Ingress**, and **Egress** for your workload. Optionally, expand **Additional options** to set a **Latency target**, **Producer count**, and **Consumer count**. - On the **Advanced** tab, enter an **RPU Rate** if you already know the capacity you need. 5. Under **Recommended configuration**, review the machine configuration that Redpanda recommends and its calculated RPU. To use a different configuration, select one of the alternatives from the list. 6. Review **Estimated costs**, which shows the estimated hourly and monthly cost of the selected configuration. The estimate covers Redpanda compute and SQL engine license costs. Networking, storage license, and cloud infrastructure costs are not included. 7. Continue with the create flow for your cloud provider. See [AWS](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws/create-byoc-cluster-aws/), [GCP](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/create-byoc-cluster-gcp/), or [Azure](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/create-byoc-cluster-azure/). ## Next steps - [Create a BYOC cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/) - [BYOC tiers and regions](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/) --- # Page 380: Dedicated **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/create-dedicated-cloud-cluster.md --- # Dedicated Dedicated clusters are single-tenant clusters hosted in Redpanda’s cloud account on AWS, GCP, or Azure. Redpanda handles provisioning, operations, and maintenance. To see which security areas Redpanda owns and which you own, see [Shared responsibility model](#shared-responsibility-model). ## Shared responsibility model The following table lists the security areas owned by Redpanda and the security areas owned by customers for Dedicated clusters. For the BYOC model, see the [shared responsibility model](https://docs.redpanda.com/cloud-data-platform/get-started/cloud-overview/#shared-responsibility-model). | Resource | Redpanda responsibility | Customer responsibility | | --- | --- | --- | | Redpanda upgrades and hotfixes | ✓ | | | Cost management and attribution | ✓ | | | Software vulnerability remediation | ✓ | | | Infrastructure vulnerability remediation | ✓ | | | IAM (roles, service accounts, access segmentation) | ✓ | | | Compute | ✓ | | | Redpanda agent VM maintenance | ✓ | | | VPC (subnets, routing, firewall) | ✓ | | | VPC peering | ✓ | | | VPC private links (service endpoint) | ✓ | | | VPC private links (consumer endpoint) | | ✓ | | Local storage | ✓ | | | Tiered Storage | ✓ | | | Control plane | ✓ | | | Access controls and audit | ✓ | | | Managed disaster recovery | | ✓ | | Observability and monitoring (SLOs, SLIs, tracing, alerting, runbooks) | ✓ | | | Availability SLA | ✓ | | | Proactive threat detection | ✓ | | | Static secret rotation | ✓ | | | Incident response | ✓ | | | Resilience verification | ✓ | | | Kafka Connect infrastructure | ✓ | | | Kafka Connect tasks state | | ✓ | ## Create a Dedicated cluster After you log in to [Redpanda Cloud](https://cloud.redpanda.com), you land on the **Clusters** page. This page lists all the clusters in your organization. 1. On the Clusters page, click **Create cluster**, then click **Create** for Dedicated. Enter a cluster name, then select the resource group, cloud provider (AWS, GCP, or Azure), [region, tier](https://docs.redpanda.com/cloud-data-platform/reference/tiers/dedicated-tiers/), availability, and Redpanda version. > ❗ **IMPORTANT** > > Dedicated on Azure is in [limited availability](https://docs.redpanda.com/home/glossary/#limited-availability). It is production-ready and covered by Redpanda Support for early adopters. > 📝 **NOTE** > > - If you plan to create a private network in your own VPC, select the region where your VPC is located. > > - Three availability zones provide two backups in case one availability zone goes down. 2. Click **Next**. 3. On the Network page, enter the connection type: public or private. For private networks: - Your network name is used to identify this network. - For a [CIDR range](https://docs.redpanda.com/cloud-data-platform/networking/cidr-ranges/), choose one that does not overlap with your existing VPCs or your Redpanda network. Private networks require either a VPC peering connection or a private connectivity service, such as [AWS PrivateLink](https://docs.redpanda.com/cloud-data-platform/networking/configure-privatelink-in-cloud-ui/), [GCP Private Service Connect](https://docs.redpanda.com/cloud-data-platform/networking/configure-private-service-connect-in-cloud-ui/), or [Azure Private Link](https://docs.redpanda.com/cloud-data-platform/networking/azure-private-link/). - Clusters with private networking include a setting for API Gateway network access. Public access exposes endpoints for Redpanda Console, the Data Plane API, and the MCP Server API, but they remain protected by your authentication and authorization controls. Private access restricts endpoint access to your VPC/VNet only. On Azure, private access incurs an additional cost, since it involves deploying two network load balancers, instead of one. > 📝 **NOTE** > > After the cluster is created, you can change the API Gateway access on the Dataplane settings page. If you change from public to private access, users without VPN access to the Redpanda VPC will lose access to these services. 4. Click **Create**. After the cluster is created, you can select the cluster on the **Clusters** page to see the overview for it. ## Start streaming: example Use `rpk`, Redpanda’s CLI, to build a basic streaming application that creates a topic, produces messages to it, and consumes messages from it. To learn about `rpk`, see the [Introduction to rpk](https://docs.redpanda.com/cloud-data-platform/manage/rpk/intro-to-rpk/). 1. Login to Redpanda Cloud, and select your resource group using the interactive prompt. ```bash rpk cloud login ``` 2. On the **Overview** page, copy your bootstrap server address and set it as an environment variable on your local machine: ```bash export REDPANDA_BROKERS="" ``` 3. Go to **Security** > **Users**, click **Create user**, and create a user called **redpanda-chat-account** that uses the SCRAM-SHA-256 mechanism. 4. In the **User created successfully** dialog, copy the password and set the following environment variables on your local machine: ```bash export REDPANDA_SASL_USERNAME="redpanda-chat-account" export REDPANDA_SASL_PASSWORD="" export REDPANDA_SASL_MECHANISM="SCRAM-SHA-256" ``` 5. Click **Go to user details**. 6. Under **ACLs**, click **\+ Add ACL**, and define the following rule to grant the user full access to the `chat-room` topic: - **Resource Type**: Topic - **Pattern Type**: Literal - **Resource Name**: `chat-room` - **Operation**: All - **Permission**: Allow - **Host**: `*` 7. Click **Add ACL**. 8. Use `rpk` on your local machine to authenticate to Redpanda as the **redpanda-chat-account** user and get information about the cluster: ```bash rpk cluster info -X tls.enabled=true ``` 9. Create a topic called `chat-room`. You granted permissions to the **redpanda-chat-account** user to access only this topic. ```bash rpk topic create chat-room -X tls.enabled=true ``` Output: ``` TOPIC STATUS chat-room OK ``` 10. Produce a message to the topic: ```bash rpk topic produce chat-room -X tls.enabled=true ``` 11. Enter a message, then press Enter: ```text Pandas are fabulous! ``` Example output: ``` Produced to partition 0 at offset 0 with timestamp 1663282629789. ``` 12. Press Ctrl+C to finish producing messages to the topic. 13. Consume one message from the topic: ```bash rpk topic consume chat-room --num 1 -X tls.enabled=true ``` Your message is displayed along with its metadata: ```json { "topic": "chat-room", "value": "Pandas are fabulous!", "timestamp": 1663282629789, "partition": 0, "offset": 0 } ``` ### Explore your topic In Redpanda Cloud, go to **Topics** > **chat-room**. The message that you produced to the topic is displayed along with some other details about the topic. ### Clean up If you don’t want to continue experimenting with your cluster, you can delete it. Go to **Dataplane settings** and click **Delete cluster**. ## Next steps - [Learn more about Redpanda Cloud](https://docs.redpanda.com/cloud-data-platform/get-started/cloud-overview/) - [Learn about private networking](https://docs.redpanda.com/cloud-data-platform/networking/dedicated/) --- # Page 381: Serverless **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless.md --- # Serverless Serverless is the fastest and easiest way to start data streaming. With Serverless clusters, you host your data in Redpanda’s VPC, and Redpanda handles automatic scaling, provisioning, operations, and maintenance. This is a production-ready deployment option with a cluster available instantly, and you only pay for what you consume. You can view detailed billing activity for each cluster and edit payment methods on the **Billing** page. After reading this page, you will be able to: - Identify the use cases and usage limits for Serverless clusters - Describe how to create a Serverless cluster and connect a client - Recognize which features are supported and unsupported on Serverless ## Serverless usage limits Each Serverless cluster has the following maximum usage limits: - **Ingress**: 100 MB per second - **Egress**: 300 MB per second - **Partitions**: 5,000 - **Topics**: 300 - **Message size**: 20 MiB - **Retention**: unlimited - **Storage**: unlimited - **Users**: 30 - **ACLs**: 120 - **Consumer groups**: 200 - **Connections**: 10,000 - **Producer IDs**: 250 - **Schema Registry**: - **Max schemas**: 500 - **Max subjects**: 500 - **Rate limit**: 100 requests per second - **Redpanda Connect pipelines**: 100 > 📝 **NOTE** > > - The partition limit is the number of logical partitions before replication occurs. Redpanda Cloud uses a replication factor of 3. > > - To request a higher topic limit, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). When a cluster reaches its topic or partition limit, requests to create topics or add partitions fail with a `POLICY_VIOLATION` error. ## Prerequisites Make sure you have the latest version of `rpk`, the Redpanda CLI. See [Install or Update rpk](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/). ## Get started with Serverless > 📝 **NOTE** > > Serverless on GCP is currently in a [beta](https://docs.redpanda.com/home/glossary/#beta) release. Choose the option that fits how you want to subscribe: ### Free trial A [free trial on AWS](https://www.redpanda.com/try-redpanda) is the fastest way to get started with Serverless. Each free-trial customer qualifies for $100 (USD) in credits to spend in the first 30 days. This should be enough to run Redpanda with reasonable throughput. No credit card is required. To continue using Serverless after your trial expires, you can enter a credit card and pay as you go. Any remaining credit balance is used before you are charged. When either the credits expire or the days in the trial expire, the clusters move into a suspended state, and you won’t be able to access your data in either the Redpanda Cloud Console or with the Kafka API. There is a seven-day grace period following the end of the trial when you can add your credit card and restore service. After that, the data is permanently deleted. For questions about the trial, ask in the [Redpanda community on GitHub](https://github.com/redpanda-data/community). After you start a trial, Redpanda instantly prepares an account for you. The first time you sign in, you can answer a few quick questions about your project so Redpanda can tailor your experience. Your account includes a `welcome` cluster with a `hello-world` demo topic you can explore. It includes sample data so you can see how real-time messaging works before sending your own data. On that first visit, the **Overview** page shows a **Get started** option with guided ways to [interact with your cluster](#interact-with-your-cluster): create a Redpanda Connect [pipeline](https://docs.redpanda.com/home/glossary/#pipeline), use `rpk` from the command line, or connect with your own Kafka client. To get started with `rpk`: 1. Log in with `rpk cloud login`. 2. Consume from the `hello-world` topic with `rpk topic consume hello-world`. 3. In the [Redpanda Cloud Console](https://cloud.redpanda.com), navigate to the **Topics** page and open the `hello-world` topic to see the included messages. ### Redpanda Sales To request a private offer with possible discounts for annual committed use, contact [Redpanda Sales](https://www.redpanda.com/price-estimator). When you subscribe to Serverless through Redpanda Sales, you gain immediate access to Enterprise support. Redpanda creates a cloud organization for you and sends you a welcome email. ### AWS Marketplace New subscriptions to Redpanda Cloud through [AWS Marketplace](https://docs.redpanda.com/cloud-data-platform/billing/aws-pay-as-you-go/) receive $300 (USD) in free credits to spend in the first 30 days. AWS Marketplace charges for anything beyond $300, unless you cancel the subscription. After your free credits have been used, you can continue using your cluster without any commitment, only paying for what you consume and canceling anytime. > 📝 **NOTE** > > When you subscribe to Redpanda through AWS Marketplace, you do not have immediate access to Enterprise support, only the [Redpanda community on GitHub](https://github.com/redpanda-data/community). For Enterprise support, contact [Redpanda Sales](https://www.redpanda.com/price-estimator). Redpanda creates a cloud organization for you and sends you a welcome email. ### Google Cloud Marketplace New subscriptions to Redpanda Cloud through [Google Cloud Marketplace](https://docs.redpanda.com/cloud-data-platform/billing/gcp-pay-as-you-go/) receive $300 (USD) in free credits to spend in the first 30 days. Google Cloud Marketplace charges for anything beyond $300, unless you cancel the subscription. After your free credits have been used, you can continue using your cluster without any commitment, only paying for what you consume and canceling anytime. > 📝 **NOTE** > > When you subscribe to Redpanda through Google Cloud Marketplace, you do not have immediate access to Enterprise support, only the [Redpanda community on GitHub](https://github.com/redpanda-data/community). For Enterprise support, contact [Redpanda Sales](https://www.redpanda.com/price-estimator). Redpanda creates a cloud organization for you and sends you a welcome email. ## Create a Serverless cluster To create a Serverless cluster: 1. In the [Redpanda Cloud Console](https://cloud.redpanda.com), on the **Clusters** page, click **Create cluster**, then click **Create** for Serverless. 2. Enter a cluster name, then select the resource group. If you don’t have an existing resource group, you can create one. Refresh the page to see newly-created resource groups. 3. Select a cloud provider: AWS or GCP. (GCP is currently in a [beta](https://docs.redpanda.com/home/glossary/#beta) release.) 4. Select a [region](https://docs.redpanda.com/cloud-data-platform/reference/tiers/serverless-regions/). For best performance, select the region closest to your applications. Redpanda expects your applications to be deployed in the same cloud provider and region as your Serverless cluster. 5. **AWS only**: Clusters on AWS can enable private access between their VPC and Redpanda, so data does not traverse the public internet. Private connectivity is implemented using AWS PrivateLink for secure traffic. - When you enable both public access and private access on the cluster, you can choose between the public address or the private address. When the public address is used the data flows over the public internet. - You can either create a new PrivateLink or use an existing one from the same resource group. - You can enable or disable private access at any time on the cluster’s **Dataplane settings** page. - Enabling private access incurs additional charges. > 📝 **NOTE** > > After private access is disabled, attempts to reach the private endpoints will fail. However, the PrivateLink endpoint in your AWS account and the PrivateLink resource in Redpanda Cloud both remain provisioned and continue to incur charges until you explicitly delete them. 6. Click **Create cluster**. 7. To start working with your cluster, go to the **Topics** page to create a topic and produce messages to it. Add team members on the **Security** > **Users** page, then click into a user to add ACLs from their detail page. ## Interact with your cluster > 💡 **TIP** > > The cluster’s **Overview** page includes a **Get started** guide to help you start streaming data into and out of Redpanda. See also: [Redpanda Connect Quickstart](https://docs.redpanda.com/cloud-data-platform/develop/connect/connect-quickstart/) The **Overview** page lists your bootstrap server URL and security settings on the **Streaming** tab of the **How to connect** panel. Here you can add a Kafka client to interact with your cluster. For a full description of the overview page, see [Cluster Overview](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-overview/). Or, Redpanda can generate a sample application to interact with your cluster. Run [`rpk generate app`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-generate/rpk-generate-app/), and select Go as the language. Follow the commands in the terminal to run the application, create a demo topic, produce to the topic, and consume the data back. The first time you sign in, the **Overview** page shows a **Get started** option whose **Connect from your terminal** section walks you through using `rpk`. You can also use these `rpk` commands at any time: - [`rpk cloud login`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cloud/rpk-cloud-login/): Use this to log in to Redpanda Cloud or to refresh the session. - [`rpk topic`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-topic/rpk-topic/): Use this to manage topics, produce data, and consume data. - [`rpk profile print`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-profile/rpk-profile-print/): Use this to view your `rpk` configuration and see the URL for your Serverless cluster. - [`rpk security user`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-security/rpk-security-user/): Use this to manage users and permissions. > 📝 **NOTE** > > Redpanda Serverless is opinionated about Kafka configurations. For example, automatic topic creation is disabled. Some systems expect the Kafka service to automatically create topics when a message is produced to a topic that doesn’t exist. Create topics on the **Topics** page or with `rpk topic create`. ## Supported features - Redpanda Serverless supports the Kafka API. Serverless clusters work with all Kafka clients. See [Kafka Compatibility](https://docs.redpanda.com/cloud-data-platform/develop/kafka-clients/). - Serverless clusters support all major Apache Kafka messages for managing topics, producing/consuming data (including transactions), managing groups, managing offsets, and managing ACLs. (User management is available in the [Redpanda Cloud Console](https://cloud.redpanda.com) or with `rpk security acl`.) ### Unsupported features Not all features included in BYOC clusters are available in Serverless. For example, the following features are not supported: - HTTP Proxy API - Multiple availability zones (AZs) - Role-based access control (RBAC) in the data plane and mTLS authentication for Kafka API clients - Group-based access control (GBAC) - Kafka Connect - Configurable maintenance windows - [Throughput throttling](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/manage-throughput/) (client quotas) ## Maintenance and upgrades Redpanda manages all maintenance for Serverless clusters. Because Serverless runs on shared, multi-tenant infrastructure, you cannot configure a maintenance window or schedule upgrades for an individual cluster. Redpanda may run maintenance operations on Serverless clusters at any time. Continuous operations are integral to keeping Serverless clusters up to date and secure. Operations run in a rolling fashion and are designed to be non-disruptive. Mainstream Kafka client libraries reconnect automatically when broker connections restart. If you need control over when maintenance runs on your cluster, use a Dedicated or BYOC cluster, both of which support configurable maintenance windows. For more information, see [Upgrades and Maintenance](https://docs.redpanda.com/cloud-data-platform/manage/maintenance/). ## Next steps - [Set up private access for Serverless clusters](https://docs.redpanda.com/cloud-data-platform/networking/serverless/aws/) - [Manage Redpanda Cloud with Terraform](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/) - [Learn more about Redpanda Cloud](https://docs.redpanda.com/cloud-data-platform/get-started/cloud-overview/) - [Manage topics](https://docs.redpanda.com/cloud-data-platform/develop/topics/config-topics/) - [Learn about billing](https://docs.redpanda.com/cloud-data-platform/billing/billing/) --- # Page 382: Introduction to Redpanda **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/intro-to-events.md --- # Introduction to Redpanda Distributed systems often require data and system updates to happen as quickly as possible. In software architecture, these updates can be handled with either messages or events. - With messages, updates are sent directly from one component to another to trigger an action. - With events, updates indicate that an action occurred at a specific time, and are not directed to a specific recipient. An event is simply a record of something changing state. For example, the event of a credit card transaction includes the product purchased, the payment, the delivery, and the time of the purchase. The event occurred in the purchasing component, but it also impacted the inventory, the payment processing, and the shipping components. In an event-driven architecture, all actions are defined and packaged as events to precisely identify individual actions and how they’re processed throughout the system. Instead of processing updates in consecutive order, event-driven architecture lets components process events at their own pace. This helps developers build fast and scalable systems. ## What is Redpanda? Redpanda is an event streaming platform: it provides the infrastructure for streaming real-time data. Producers are client applications that send data to Redpanda in the form of events. Redpanda safely stores these events in sequence and organizes them into topics, which represent a replayable log of changes in the system. Consumers are client applications that subscribe to Redpanda topics to asynchronously read events. Consumers can store, process, or react to the events. Redpanda decouples producers from consumers to allow for asynchronous event processing, event tracking, event manipulation, and event archiving. Producers and consumers interact with Redpanda using the Apache Kafka® API. ![Producers and consumers in a cluster](https://docs.redpanda.com/cloud-data-platform/shared/_images/cluster.png) | Event-driven architecture (Redpanda) | Message-driven architecture | | --- | --- | | Producers send events to an event processing system (Redpanda) that acknowledges receipt of the write. This guarantees that the write is durable within the system and can be read by multiple consumers. | Producers send messages directly to each consumer. The producer must wait for acknowledgement that the consumer received the message before it can continue with its processes. | Event streaming lets you extract value out of each event by analyzing, mining, or transforming it for insights. You can: - Take one event and consume it in multiple ways. - Replay events from the past and route them to new processes in your application. - Run transformations on the data in real-time or historically. - Integrate with other event processing systems that use the Kafka API. ## Redpanda differentiators Redpanda is less complex and less costly than any other commercial mission-critical event streaming platform. It’s fast, it’s easy, and it keeps your data safe. - Redpanda is designed for maximum performance on any data streaming workload. It can scale up to use all available resources on a single machine and scale out to distribute performance across multiple nodes. Built on C++, Redpanda delivers greater throughput and up to 10x lower p99 latencies than other platforms. This enables previously unimaginable use cases that require high throughput, low latency, and a minimal hardware footprint. - Redpanda is packaged as a single binary: it doesn’t rely on any external systems. It’s compatible with the Kafka API, so it works with the full ecosystem of tools and integrations built on Kafka. Redpanda can be deployed on bare metal, containers, or virtual machines in a data center or in the cloud. And Redpanda Console makes it easy to set up, manage, and monitor your clusters. Additionally, Tiered Storage lets you offload log segments to object storage in near real-time, providing long-term data retention and topic recovery. - Redpanda uses the [Raft consensus algorithm](https://raft.github.io/) throughout the platform to coordinate writing data to log files and replicating that data across multiple servers. Raft facilitates communication between the nodes in a Redpanda cluster to make sure that they agree on changes and remain in sync, even if a minority of them are in a failure state. This allows Redpanda to tolerate partial environmental failures and deliver predictable performance, even at high loads. - Redpanda provides data sovereignty. With the Bring Your Own Cloud (BYOC) offering, you deploy Redpanda in your own virtual private cloud, and all data is contained in your environment. Redpanda handles provisioning, monitoring, and upgrades, but you manage your streaming data without Redpanda’s control plane ever seeing it. ## Redpanda Streaming versions You can deploy Redpanda in a self-hosted environment (Redpanda Streaming) or as a fully managed cloud service (Redpanda Cloud). Redpanda Streaming version numbers follow the convention AB.C.D, where AB is the two-digit year, C is the feature release, and D is the patch release. For example, version 22.3.1 indicates the first patch release on the third feature release of the year 2022. Patch releases include bug fixes and minor improvements, with no change to user-facing behavior. New and enhanced features are documented with each feature release. Redpanda Cloud releases on a continuous basis and uptakes Redpanda Streaming versions. --- # Page 383: Partner Integrations **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/partner-integration.md --- # Partner Integrations Learn about Redpanda integrations built and supported by our partners. | **Partner** | **Description** | **More information** | | --- | --- | --- | | [Superstream](https://superstream.ai/) | Superstream optimizes and improves Redpanda (and other Kafka platforms) for cost reduction, increased reliability, and improved visibility. | [Superstream for Redpanda](https://docs.superstream.ai/solution-briefs/superstream-for-redpanda) | | [Aklivity Zilla](https://www.aklivity.io/) | Zilla is a multi-protocol proxy that abstracts Redpanda for non-native clients, such as browsers and IoT devices, by exposing Redpanda topics using user-defined REST, Server-Sent Events (SSE), MQTT, or gRPC API entry points. | [Modern Eventing with CQRS, Redpanda and Zilla](https://www.aklivity.io/post/modern-eventing-with-cqrs-redpanda-and-zilla) | | [Bytewax](https://bytewax.io/) | Bytewax is an open source framework and distributed stream processing engine in Python. | [Enriching streaming data with Bytewax and Redpanda](https://bytewax.io/guides/enriching-streaming-data) | | [ClickHouse](https://clickhouse.com/) | ClickHouse is a high-performance, column-oriented SQL database management system (DBMS) for online analytical processing (OLAP). | [Building an OLAP database with ClickHouse and Redpanda](https://redpanda.com/blog/real-time-olap-database-clickhouse-redpanda) | | [Conduktor](https://www.conduktor.io/) | Conduktor provides simple, flexible, and powerful tooling for Kafka developers and infrastructure. | [Conduktor & Redpanda: Best of breed Kafka experience](https://www.conduktor.io/blog/conduktor-redpanda-best-breed-kafka-experience/) | | [Decodable](https://www.decodable.co/) | Decodable is a real-time data processing platform powered by Apache Flink and Debezium. | [Decodable + Redpanda](https://www.decodable.co/connectors/redpanda) | | [ElastiFlow](https://elastiflow.com/) | ElastiFlow captures and analyzes flow and SNMP data to provide detailed insights into network performance and security. | [Leveraging Redpanda for Enhanced Network Observability: ElastiFlow Integration](https://elastiflow.com/blog/posts/leveraging-redpanda-for-enhanced-network-observability-elastiflow) | | [Materialize](https://materialize.com/) | Materialize is a data warehouse purpose-built for operational workloads where an analytical data warehouse would be too slow, and a stream processor would be too complicated. | [Ingesting data from Redpanda with Materialize](https://materialize.com/docs/ingest-data/redpanda/) | | [PeerDB](https://peerdb.io/) | PeerDB provides a fast, simple, and cost-effective way to replicate data from Postgres to data warehouses, queues and storage. | [Quickstart guide](https://docs.peerdb.io/connect/kafka) | | [Pinecone](https://www.pinecone.io/) | Pinecone is a vector database for building accurate and performant AI applications at scale. The Pinecone connector for Redpanda Connect provides a production-ready integration from many existing data sources through simple YAML configuration. | [Redpanda Connect integration](https://docs.pinecone.io/integrations/redpanda) | | [RisingWave](https://risingwave.com/) | RisingWave is a distributed SQL streaming database that enables simple, efficient, and reliable processing of streaming data. | [Ingesting data from Redpanda with Risingwave](https://docs.risingwave.com/integrations/sources/redpanda) | | [Timeplus](https://www.timeplus.com/) | Timeplus is a stream processor that provides powerful end-to-end capabilities, leveraging the open source streaming engine Proton. | [Realizing low latency streaming analytics with Timeplus and Redpanda](https://redpanda.com/blog/low-latency-streaming-analytics-timeplus-redpanda) | | [Tinybird](https://www.tinybird.co/) | Tinybird is a data platform for data and engineering teams to solve complex real-time, operational, and user-facing analytics use cases at any scale. | [Building a complete IoT backend with Redpanda and Tinybird](https://www.tinybird.co/live-coding-sessions/end-to-end-iot-with-redpanda) | | [Quix](https://quix.io/) | Quix is a complete platform for building, deploying, and monitoring stream processing pipelines in Python. | [Integrating Redpanda with Quix](https://quix.io/docs/integrations/brokers/redpanda.html) | | [Yugabyte](https://www.yugabyte.com/) | YugabyteDB is an open-source, distributed SQL database that combines the capabilities of relational databases with the scalability of NoSQL systems. | [How to Integrate Yugabyte CDC Connector with Redpanda](https://www.yugabyte.com/blog/integrate-redpanda/) | ## Request a partner integration To request a partner integration with Redpanda Data, reach out to [partners@redpanda.com](mailto:partners@redpanda.com). Provide a link to your product documentation or a blogpost explaining how your product integrates with Redpanda. --- # Page 384: What’s New in Redpanda Cloud **URL**: https://docs.redpanda.com/cloud-data-platform/get-started/whats-new-cloud.md --- # What’s New in Redpanda Cloud This page lists new features added to Redpanda Cloud. ## 2026 Features and updates released in 2026, listed by month. ### November 2026 #### Load Factor dashboard for BYOC BYOC clusters running Redpanda version 26.2 or later export the metrics used by the Redpanda Load Factor Grafana dashboard. The dashboard shows how close each broker is running to the capacity of its host, so you can see which resource saturates first before you scale. Disk IOPS and network load factors are available on AWS only. See [Monitor Cluster Load with the Load Factor Dashboard](https://docs.redpanda.com/cloud-data-platform/manage/monitor-load-factor/). #### Redpanda Connect updates - Inputs: - [sap_hana](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/sap_hana/): Reads rows from a SAP HANA table. ### October 2026 #### BYOVNet on Azure: GA [BYOVNet clusters on Azure](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/vnet-azure/) are now generally available (GA). You can deploy a BYOVNet cluster end to end with Terraform: the Redpanda BYOVNet Terraform module creates the VNet, subnets, managed identities, storage, and key vaults in your subscription, and the Redpanda Terraform provider creates the Redpanda network and cluster from the module outputs and runs the Redpanda agent bootstrap for you. You no longer need Cloud API calls or `rpk cloud byoc azure apply` to create a BYOVNet cluster. BYOVNet requires Premium support. #### Self-service cluster scaling for BYOC If your organization uses usage-based billing, you can now scale a BYOC cluster up or down directly from the Redpanda Cloud UI, the Control Plane API, or the Redpanda Terraform provider, without contacting Redpanda Support. Add or remove brokers to absorb short-term traffic changes, or move to a different machine type to right-size for sustained throughput changes. Scaling starts immediately and the cluster stays available throughout. See [Scale a BYOC Cluster](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/scale-cluster/). #### Google Cloud Marketplace label on GCP BYOC resources For organizations that subscribe through a Google Cloud Marketplace private offer, Redpanda now adds the `goog-partner-solution` label to the GCP resources it creates for BYOC clusters. Google Cloud Marketplace requires this label for partner consumption tracking. Redpanda applies the label in place, with no impact on your cluster. See [Google Cloud Marketplace consumption-tracking label](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/create-byoc-cluster-gcp/#marketplace-label). #### Tiers 6-9 for BYOC clusters on Azure BYOC clusters on Azure now support usage tiers 6 through 9, the same tiers available on AWS and GCP. Tier 9 supports up to 2,000 MBps ingress, 4,000 MBps egress, 112,500 partitions (pre-replication), and 450,000 connections. See [BYOC Tiers and Regions](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/). #### Redpanda SQL: views Redpanda SQL now supports views. A view is a named query that you can reference like a table. Create a view with `CREATE VIEW`, and remove it with `DROP VIEW`. A view runs its query with the privileges of the view owner. See [`CREATE VIEW`](https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-statements/create-view/) and [Tables and Views](https://docs.redpanda.com/cloud-data-platform/sql/query-data/tables-and-views/). ### September 2026 #### Dual listener mode on AWS: beta Redpanda Cloud clusters on AWS can now serve a public and a private listener at the same time on each cluster service (Kafka API, HTTP Proxy, and Schema Registry), each with its own endpoint and its own SASL/SCRAM or mTLS authentication. Clients inside your VPC connect over the private listener and avoid internet gateway data-processing fees, while external clients continue to connect over the public listener. Configure it with the Terraform provider or the Cloud API, or migrate an existing public cluster to dual listener mode through Terraform or the Cloud API. Dual listener mode is in a [beta](https://docs.redpanda.com/home/glossary/#beta) release and is enabled per organization. Contact [Redpanda Support](https://support.redpanda.com/) to enable it. See [Configure Dual Listener Mode](https://docs.redpanda.com/cloud-data-platform/networking/byoc/aws/dual-listener-mode/). #### Topic configuration properties reference Redpanda Cloud docs now have a [topic configuration properties reference](https://docs.redpanda.com/cloud-data-platform/reference/properties/topic-properties/), covering the topic properties available on Redpanda Cloud clusters, grouped by what they control, along with the cluster property that sets each default. #### Tiered Storage v2: beta BYOC and Dedicated clusters can now choose Tiered Storage v2 (beta) for new topics by setting the `default_redpanda_storage_mode_tiered_impl` cluster property. Tiered Storage v2 runs compaction on the data in object storage, including tombstone removal, so a compacted partition eventually retains only the latest value for each key. Rollout across Redpanda Cloud is progressive. Serverless clusters use Tiered Storage v1. See [Tiered Storage Versions](https://docs.redpanda.com/cloud-data-platform/manage/tiered-storage-versions/). #### Redpanda SQL: query map fields as the `map` type Redpanda SQL now represents map fields from a topic’s registered schema (Avro or Protobuf) as the `map` data type, for both the topic’s live records and its Iceberg-committed history. A `map` stores key-value pairs with a uniform key type and a uniform value type. See the [`map` reference](https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-data-types/map/). ### August 2026 #### Redesigned cluster overview page BYOC and Serverless clusters have a redesigned **Overview** page in the Redpanda Cloud Console. The page header shows the cluster’s health at a glance, along with a copyable cluster ID, and a **Needs attention** indicator jumps to the affected product card when a product reports a problem. The **How to connect** panel gathers the connection details clients need, product cards summarize each product’s status and offer self-service setup, and a network card presents the cluster’s private connectivity options. See [Cluster Overview](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-overview/). #### Migrate schemas from Confluent Schema Registry BYOC and Dedicated clusters can now use Shadowing’s API-mode Schema Registry replication to migrate schemas from a Confluent Schema Registry. A shadow link polls the source registry over HTTP and continuously imports subjects, versions, and compatibility settings, with filtering by context or subject and source-to-destination context mapping. While the link is active, the destination contexts it owns are read-only; pause replication to cut applications over to Redpanda. Configure the link in the Cloud UI, or with `rpk`, the Control Plane API, or the Terraform provider. See [Migrate Schemas from Confluent Schema Registry](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/migrate-schemas-confluent/). #### Shadowing: RBAC role synchronization Shadow links on BYOC and Dedicated clusters can now replicate RBAC role definitions and memberships from a Redpanda source cluster. Combined with ACL synchronization, this keeps role-based permissions working on the shadow cluster after a failover. The Roles Migrator task mirrors the roles that match your filters, creating, updating, and deleting roles on the shadow cluster to match the source. Choose **All roles** or specify include and exclude filters in the Cloud UI, or configure `role_sync_options` with `rpk`, the Control Plane API, or the Terraform provider (v2.3.0 or later), where no roles sync until you add an include filter. Both clusters must run Redpanda 26.2 or later. Shadowing does not replicate user credentials, so provision users on the shadow cluster before failover. See [Role filtering](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/#role-filtering). #### Fetch read coalescing BYOC and Dedicated clusters now support [fetch read coalescing](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/fetch-read-coalescing/), which reduces read CPU and fetch-response memory for high consumer fan-out workloads: the broker reads and serializes each unique read once and shares the result with every concurrent consumer of the same data. Fetch read coalescing is disabled by default, and the cluster property that controls it is managed by Redpanda. Request it only for high fan-out workloads. #### Redpanda SQL on GCP Redpanda SQL is now available on GCP, for both BYOC and BYOVPC clusters. Run real-time SQL queries on your Redpanda topics, including the Iceberg history of Iceberg-enabled topics through a GCP Lakehouse (formerly BigLake) catalog, using standard PostgreSQL syntax. - On a BYOC cluster, enable the SQL engine from the Cloud Console, Cloud API, or Terraform provider. See [Enable Redpanda SQL](https://docs.redpanda.com/cloud-data-platform/sql/get-started/deploy-sql-cluster/). - On a BYOVPC cluster, provision the SQL-specific GCP resources with the Redpanda BYOVPC Terraform module, then supply them as customer-managed resources when enabling the engine. See [Enable Redpanda SQL on a BYOVPC Cluster on GCP](https://docs.redpanda.com/cloud-data-platform/sql/get-started/enable-sql-byovpc-gcp/). #### Redpanda SQL: BYOVPC support on AWS Redpanda SQL is now available on BYOVPC clusters on AWS. Provision the required SQL-specific AWS resources using the Redpanda BYOVPC Terraform module, then supply them as customer-managed resources when enabling the SQL engine via the Cloud Console, Cloud API, or Terraform provider. See [Enable Redpanda SQL on a BYOVPC Cluster on AWS](https://docs.redpanda.com/cloud-data-platform/sql/get-started/enable-sql-byovpc-aws/). #### Translate Iceberg keys, values, and headers, and query them with SQL On BYOC and BYOVPC clusters with Iceberg-enabled topics, you can now control how Redpanda translates record keys, values, and headers into the Iceberg table — including decoding keys and header values using a schema or as UTF-8 strings instead of the default raw bytes — and read the decoded keys and headers with Redpanda SQL. - Use the section-based syntax of the `redpanda.iceberg.mode` topic property to independently control how Redpanda translates the record key, value, and headers into the Iceberg table. See [Configure key, value, and header translation](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/specify-iceberg-schema/#configure-key-value-and-header-translation). - Set `key_decode_mode` and `header_value_type` on `CREATE TABLE`, matching the topic’s translation, to expose the decoded key and header values when you query the topic with Redpanda SQL. See [Query decoded keys and headers](https://docs.redpanda.com/cloud-data-platform/sql/query-data/query-iceberg-topics/#query-decoded-keys-and-headers). #### Redpanda SQL: read UUID columns as the `uuid` type Redpanda SQL now reads UUID columns as the `uuid` type, exposed to PostgreSQL clients as `uuid`. This applies to UUID columns in a Redpanda topic, whether in the topic’s Avro-encoded live records or in its history committed to an Iceberg table. Because text and string functions don’t operate on `uuid` values directly, cast a UUID to text explicitly (`id::text`) to get the 36-character canonical form. Previously, these columns were read as `text` (and returned garbled values when read from Iceberg), so the switch to `uuid` can change how queries that relied on the old `text` columns behave. If a query breaks, cast the column to text (`id::text`) to restore the previous behavior. See [UUID](https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-data-types/uuid/) and [Query Iceberg-enabled topics](https://docs.redpanda.com/cloud-data-platform/sql/query-data/query-iceberg-topics/). #### Resolve Iceberg topic schemas within a Schema Registry context On BYOC and BYOVPC clusters, you can now set the `redpanda.schema.registry.context` topic property on an Iceberg-enabled topic to resolve its schemas within a specific [Schema Registry context](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-contexts/) instead of the default context. See [Resolve schemas within a Schema Registry context](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/specify-iceberg-schema/#resolve-schemas-within-a-context). #### Expanded Kafka client validation Redpanda now validates additional non-Java Kafka clients at their current versions, aligned with Kafka 4.x: confluent-kafka-go, Sarama, and confluent-kafka-python. See [Kafka Compatibility](https://docs.redpanda.com/cloud-data-platform/develop/kafka-clients/). #### Visual tab in the Redpanda Connect pipeline editor The pipeline editor has a new **Visual** tab alongside the existing **YAML** editor. The **Visual** tab renders a pipeline as an interactive node diagram, so you can inspect and edit inputs, processors, outputs, and control-flow constructs (`switch`, `branch`, `try`/`catch`, and others) without hand-writing YAML. The two tabs stay in sync. See [Explore the Visual editor](https://docs.redpanda.com/cloud-data-platform/develop/connect/connect-quickstart/#visual-editor). ### July 2026 #### Schema Registry contexts enabled by default On BYOC and Dedicated clusters, [Schema Registry contexts](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-contexts/) are now enabled by default, so you can register and manage schemas in isolated namespaces without an enablement step. See [Upgrade considerations](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-contexts/#upgrade-considerations) if any of your existing subject names start with `:.`. #### SerDes client support for Schema Registry contexts Any SerDes client, in any language, can now target a Schema Registry context through the base URL alone: append `/contexts/{context}` to your cluster’s Schema Registry URL in the client’s `schema.registry.url` setting. Schema ID lookups sent through the prefix are scoped to that context automatically. Previously, only the Java Confluent SerDes could target non-default contexts. See [Use contexts with SerDes clients](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-contexts/#serdes-clients). #### Egress allowlist for Redpanda Connect pipelines You can now allow Redpanda Connect pipelines on BYOC and Dedicated clusters to open outbound connections to destinations that the data plane firewall blocks by default. Add up to 16 CIDR and port range combinations to a cluster with the `redpanda_connect.allowed_destination_cidr_ports` field in the Cloud API, or with the same attribute on a `redpanda_cluster` resource in the Redpanda Terraform provider (v2.1.1+). See [Configure Egress for Redpanda Connect Pipelines](https://docs.redpanda.com/cloud-data-platform/networking/connect-egress-allowlist/). #### Cloud Topics enabled by default [Cloud Topics](https://docs.redpanda.com/cloud-data-platform/develop/topics/cloud-topics/) are now enabled by default: create a Cloud Topic by setting its storage mode during topic creation, with no cluster-level enablement step. You can use Cloud Topics exclusively or together with standard topics on the same cluster. #### New AWS regions for BYOC For [BYOC clusters](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/#byoc-supported-regions), Redpanda added support for the following AWS regions: - ap-northeast-2 (Seoul) - ap-south-2 (Hyderabad) #### Centralized egress for BYOC on Azure: beta You can route all Azure BYOC cluster egress through your own Azure Firewall and hub VNet instead of a per-cluster NAT Gateway, so outbound traffic exits through your centralized inspection point. This is useful for regulated environments that require a single, predictable public IP for outbound allowlisting or that prohibit per-cluster NAT Gateways. You can set this up in the Cloud UI or Cloud API when you create the network, or add or change it on an existing network through the Cloud API. Centralized egress is in a [beta](https://docs.redpanda.com/home/glossary/#beta) release and is enabled per organization. Contact your account team for access. See [Configure Centralized Egress with Azure Firewall](https://docs.redpanda.com/cloud-data-platform/networking/byoc/azure/nat-free-egress/). #### Improved Serverless trial onboarding New Serverless free-trial users now get a guided start in the Redpanda Cloud UI. After you sign up, a few quick questions help Redpanda tailor your experience. The welcome cluster’s **Overview** page summarizes your trial credits, and the **Get started** menu offers options to start streaming: create a Redpanda Connect pipeline, use `rpk` from the command line, or connect with your own Kafka client. See [Get started with Serverless](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/#get-started-with-serverless). #### SQL editor in Redpanda Cloud Console Redpanda Cloud Console now includes a built-in SQL editor. For SQL-enabled environments, you can write and run `SELECT` queries against your Redpanda topics directly in the Console without installing a separate PostgreSQL client. The editor supports syntax highlighting, autocomplete, query history, and CSV and JSON export. For Iceberg-enabled topics, an indicator shows when results span both live topic data and Iceberg-committed history. To enable Redpanda SQL, see [Enable Redpanda SQL](https://docs.redpanda.com/cloud-data-platform/sql/get-started/deploy-sql-cluster/). To use the editor, see [Use the SQL Editor](https://docs.redpanda.com/cloud-data-platform/sql/query-data/sql-editor/). #### Self-service organization deletion for Serverless You can now permanently delete a Serverless organization (free trial and pay-as-you-go plans) directly from the Cloud UI, without contacting Redpanda Support. The new **Manage organization** page, available from your profile icon, shows your plan and organization-wide resource counts, and walks you through the deletion prerequisites: delete all clusters, delete all private links, and settle any pending or outstanding invoices. See [Manage Your Organization](https://docs.redpanda.com/cloud-data-platform/manage/manage-organization/). #### Redpanda Connect updates - Inputs: - [jira](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/jira/): Streams Jira issues, comments, or changelog entries via JQL with incremental polling. ### June 2026 #### Terraform provider: Redpanda SQL support The Redpanda Terraform provider (v2.1.0+) now supports enabling and managing Redpanda SQL on BYOC clusters on AWS. Use the `rpsql` block on a `redpanda_cluster` resource to enable SQL, configure compute replicas, and retrieve the SQL endpoint URL. See [Enable Redpanda SQL on a BYOC cluster](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/#enable-redpanda-sql-on-a-byoc-cluster). #### Terraform provider: Secrets management The Redpanda Terraform provider (v2.0.0+) now supports managing cluster secrets with the new `redpanda_secret` resource. The secret value is a write-only attribute, so Terraform never stores it in your state file, and scopes control which features can use the secret, such as Redpanda Connect pipelines. See [Manage cluster secrets](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/#manage-cluster-secrets). #### Terraform provider: Shadow link management The Redpanda Terraform provider (v2.0.0+) now supports managing shadow links for disaster recovery on BYOC and Dedicated clusters with the new `redpanda_shadow_link` resource. Define the link between source and shadow clusters, client connection settings, and topic, consumer group, ACL, and Schema Registry synchronization options in code, with the source cluster password stored as a cluster secret rather than in your state file. See the [`redpanda_shadow_link` reference](https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs/resources/shadow_link) and [Configure Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/). #### Centralized egress for BYOC on GCP: beta You can route all GCP BYOC cluster egress through your own GCP hub VPC and NAT VM instead of a per-cluster Cloud NAT, so outbound traffic exits through your centralized inspection point. This is useful for regulated environments that require a single, predictable public IP for outbound allowlisting or that prohibit per-cluster Cloud NAT. Centralized egress is in a [beta](https://docs.redpanda.com/home/glossary/#beta) release and is enabled per organization. Contact your account team for access. See [Configure Centralized Egress with GCP VPC Peering](https://docs.redpanda.com/cloud-data-platform/networking/byoc/gcp/nat-free-egress/). #### GCP Lakehouse catalog for Iceberg topics BYOC clusters on GCP can now use GCP Lakehouse as an Iceberg REST catalog. See [Use Iceberg Topics with GCP Lakehouse](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-topics-gcp-biglake/). #### Customer-managed default topic settings You can now set cluster-wide defaults for new topics on BYOC and Dedicated clusters. The [`default_topic_partitions`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#default_topic_partitions), [`log_retention_ms`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#log_retention_ms), and [`retention_bytes`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#retention_bytes) cluster properties are now customer-managed. The default topic retention period (`log_retention_ms`) previously could only be changed by Redpanda support. See [Configure Cluster Properties](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/). #### Redpanda Connect updates - Processors: - [try_catch](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/try_catch/): Combines the behavior of the `try` and `catch` processors into a single block with an explicit recovery path. ### May 2026 #### Redpanda Console: redesigned Security page Redpanda Console has a redesigned Security page with three tabs (**Users**, **Roles**, and **Permissions**). Each user and role has a detail page for managing its permissions. - The **Users** tab lists each user with their assigned roles and a count of their ACLs. Filter the list by name using regular expressions; for example, `^prod-` matches every user starting with `prod-`. - Open a user or role to manage permissions on its detail page. The **ACLs** section shows one row per rule, with columns for type, resource, operation, permission, and host, and supports three actions: - **\+ Add ACL** opens a focused form where you specify the resource type, pattern type, resource name, operation, permission, and host. - **Allow all operations** grants full wildcard access across all resource types in a single step. Use this for testing only; it is too broad for production. - Select rows with the checkboxes and click **Delete selected** to remove ACLs in bulk. - The **Permissions** tab is a unified, cluster-wide view of every principal with ACLs. Each row shows direct ACL counts and ACLs inherited from roles, with a red badge highlighting any principal that has Deny rules. Expand a row to see all of that principal’s ACLs in one table: direct rules first, then sections labeled **VIA ROLE: ** for each role they inherit from. Search across principals, resources, and roles, or click **Create ACL** to add a rule from scratch. See [Configure ACLs](https://docs.redpanda.com/cloud-data-platform/security/authorization/acl/) for the full ACL reference and [Configure RBAC in the Data Plane](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac_dp/) for role management. #### Redpanda SQL Redpanda SQL is available on BYOC clusters running on AWS. Run real-time SQL queries on Redpanda topic data, including the Iceberg history of Iceberg-enabled topics, using standard PostgreSQL syntax. Connect with `psql` or any PostgreSQL driver. See the [Quickstart](https://docs.redpanda.com/cloud-data-platform/sql/get-started/sql-quickstart/) and [Overview](https://docs.redpanda.com/cloud-data-platform/sql/get-started/overview/). #### Centralized egress for BYOC on AWS: beta You can route all BYOC cluster egress through your own AWS Transit Gateway and hub VPC instead of a per-VPC NAT Gateway, so outbound traffic exits through your centralized inspection point. This is useful for regulated environments that prohibit per-VPC NAT Gateways and for consolidating egress behind a single, predictable public IP for outbound allowlisting. Centralized egress is in a [beta](https://docs.redpanda.com/home/glossary/#beta) release and is enabled per organization. Contact your account team for access. See [Configure Centralized Egress with AWS Transit Gateway](https://docs.redpanda.com/cloud-data-platform/networking/byoc/aws/nat-free-egress/). #### Schema Registry Authorization enabled by default Schema Registry Authorization is now enabled automatically on all new BYOC and Dedicated clusters. The [`schema_registry_enable_authorization`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#schema_registry_enable_authorization) cluster property is set to `true` at provisioning, and the predefined Admin, Writer, and Reader roles include Schema Registry permissions for the `subject` and `registry` ACL resource types. You can use ACLs and RBAC roles to grant fine-grained access to schemas and subjects without any additional setup. See [Schema Registry Authorization](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-authorization/) and [Predefined roles](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac/#predefined-roles). #### Account impersonation: Schema Registry support [Account impersonation](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/#account-impersonation) now supports Schema Registry in addition to the Kafka API. With Schema Registry impersonation enabled, the schemas and subjects users see in the Redpanda Cloud UI match exactly what they can access with the Cloud API or `rpk`. You can enable impersonation independently for each subsystem from the **Dataplane settings** page. #### Redpanda Connect updates - Inputs: - [salesforce](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce/): Executes a SOQL query against Salesforce and emits one message per record. - [salesforce_cdc](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce_cdc/): Captures change data from Salesforce objects using the Pub/Sub API. - [salesforce_graphql](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce_graphql/): Executes GraphQL queries against Salesforce. - Outputs: - [gcp_bigquery_write_api](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/gcp_bigquery_write_api/): Writes records to BigQuery using the Storage Write API for higher throughput and lower latency than the streaming insert API. - Metrics: - [open_telemetry_collector](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/metrics/open_telemetry_collector/): Pushes metrics using the OpenTelemetry Protocol (OTLP) over HTTP or gRPC. - Tracers: - [open_telemetry_collector](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/tracers/open_telemetry_collector/): Pushes tracing data using the OpenTelemetry Protocol (OTLP) over HTTP or gRPC. - Behavior changes: - [`gcp_bigquery_write_api`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/gcp_bigquery_write_api/) output: The default value of `max_in_flight` has been reduced from `64` to `4`. If you rely on the previous behavior for throughput, set `max_in_flight` explicitly in your pipeline configuration. The output also gained new fields for tuning Storage Write API behavior: `max_cached_streams`, `schema_resolve_timeout`, and `schema_evolution_timeout`. - New field support: - Kafka producer tuning fields on the [`kafka_franz`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/kafka_franz/) and [`redpanda`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda/) outputs: `acks`, `max_in_flight_requests`, `max_buffered_records`, `max_buffered_bytes`, `record_retries`, and `record_delivery_timeout`. Use these to align pipeline producers with broker durability and back-pressure requirements. - Removed components: - `salesforce` processor (introduced in April 2026): Replaced with the dedicated [`salesforce`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce/), [`salesforce_cdc`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce_cdc/), and [`salesforce_graphql`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce_graphql/) inputs. The [`salesforce_sink`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/salesforce_sink/) output remains available. #### Extended Serverless free trial The free trial for Redpanda Serverless now lasts 30 days, up from 14 days. The $100 (USD) credit allowance and 7-day grace period are unchanged. Sign up at [redpanda.com](https://www.redpanda.com/try-data-streaming). See [Serverless clusters](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/). #### Service account token rate limits A daily limit now applies to service account access token requests for each organization. Clients that exceed the limit receive `HTTP 429` responses. Cache tokens until close to expiry to stay within the limit, and contact Redpanda Support if your workload requires a higher daily limit. See [Service account token rate limits](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/#service-account-token-rate-limits). ### April 2026 #### Self-service sign-up through Google Cloud Marketplace You can now subscribe to Redpanda Cloud directly through Google Cloud Marketplace with pay-as-you-go billing, with no sales contact required. Self-service sign-up provisions Serverless and Dedicated clusters only. New subscriptions receive $300 (USD) in free credits to spend in the first 30 days. See [Use GCP Pay As You Go](https://docs.redpanda.com/cloud-data-platform/billing/gcp-pay-as-you-go/). #### Iceberg: Configurable table namespace You can now set a custom namespace for Iceberg tables instead of the default `redpanda` namespace, using the `iceberg_default_catalog_namespace` cluster property. A custom namespace is useful when multiple clusters write to the same catalog provider (such as AWS Glue), because each cluster must use a distinct namespace to avoid table name collisions. This property must be set when you first enable Iceberg and cannot be changed afterward. See [Enable Iceberg integration](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/about-iceberg-topics/#enable-iceberg-integration). #### Group-based access control (GBAC) - With [GBAC in the control plane](https://docs.redpanda.com/cloud-data-platform/security/authorization/gbac/gbac/), you can manage access to organization-level resources using OIDC groups from your identity provider. Assign OIDC groups to roles so that users inherit access based on their group membership. - With [GBAC in the data plane](https://docs.redpanda.com/cloud-data-platform/security/authorization/gbac/gbac_dp/), you can configure cluster-level permissions for provisioned users at scale using OIDC groups. Because group membership is managed by your identity provider, onboarding and offboarding require no changes in Redpanda. GBAC is available for BYOC and Dedicated clusters. In addition to the predefined roles (including Reader, Writer, and Admin) that you cannot modify or delete, you can now create custom roles. #### Remote MCP: Deprecated Remote MCP has been deprecated and removed from Redpanda Cloud. #### Increased Serverless limits for Redpanda Connect pipelines Serverless clusters now support up to 100 Redpanda Connect pipelines. See [Serverless usage limits](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/#_serverless_usage_limits). #### Terraform provider: Write-only attributes for sensitive fields The Redpanda Terraform provider (v1.6.0+) now supports [Terraform 1.11+ write-only attributes](https://developer.hashicorp.com/terraform/plugin/framework/resources/write-only-arguments) for sensitive fields such as user passwords and pipeline client secrets. Use the new `password_wo` and `password_wo_version` attributes (and equivalents for other sensitive fields) to keep credentials out of your `.tfstate` file. See [Manage sensitive attributes with write-only fields](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/#manage-sensitive-attributes-with-write-only-fields). #### Redpanda Connect updates - The Redpanda Connect pipeline creation and editing workflow has been simplified. The new UI replaces the previous multi-page wizard with a visual pipeline diagram, an IDE-like configuration editor, slash commands for inserting variables, and inline links to component documentation. See the [Redpanda Connect quickstart](https://docs.redpanda.com/cloud-data-platform/develop/connect/connect-quickstart/) to try it out. - Outputs: - [arc](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/arc/): Send data to an Arc columnar analytical database using its high-performance MessagePack ingestion endpoint. - [salesforce_sink](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/salesforce_sink/): Write messages to Salesforce, routing each Kafka topic to its own sObject configuration. Supports both realtime (sObject Collections REST API) and bulk modes (Bulk API 2.0). - Processors: - [string_split](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/string_split/): Splits strings into multiple parts using a delimiter, creating new messages or fields for each part. - `salesforce` (deprecated May 2026): Replaced with dedicated [salesforce](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce/), [salesforce_cdc](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce_cdc/), and [salesforce_graphql](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/salesforce_graphql/) inputs. ### March 2026 #### Redpanda Console: unlimited pagination for messages Redpanda Console now supports paginating past the previous 500-record cap when you browse topic messages, so you can inspect large topics without being limited to the initial result set. See [Paginate Messages in Redpanda Console](https://docs.redpanda.com/cloud-data-platform/develop/consume-data/paginate-messages-events/). #### Redpanda Connect updates - Inputs: - [oracledb_cdc](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/oracledb_cdc/): Stream changes from an Oracle database for Change Data Capture (CDC). - [aws_cloudwatch_logs](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_cloudwatch_logs/): Consume log events from AWS CloudWatch Logs. Supports filtering by log streams, CloudWatch filter patterns, and configurable start times. - [aws_dynamodb_cdc](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/aws_dynamodb_cdc/): Consume item-level changes from DynamoDB Streams with automatic checkpointing and shard management. - Outputs: - [iceberg](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/iceberg/): Write data to Apache Iceberg tables using the REST catalog. - Bloblang methods: - [`escape_url_path`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#escape_url_path): Escapes a string for safe use in URL path segments using percent-encoding. - [`parse_logfmt`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#parse_logfmt): Parses a logfmt-encoded string into an object of key-value pairs. - [`unescape_url_path`](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/bloblang/methods/#unescape_url_path): Unescapes a URL path segment, converting percent-encoded sequences back to their original characters. - Removed components: - `legacy_redpanda_migrator` input and output - `legacy_redpanda_migrator_offsets` input and output - `redpanda_migrator_bundle` input and output Use the unified [`redpanda_migrator`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/redpanda_migrator/) input and [`redpanda_migrator`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/redpanda_migrator/) output instead. #### Cloud Topics [Cloud Topics](https://docs.redpanda.com/cloud-data-platform/develop/topics/cloud-topics/) are now available, making it possible to use durable cloud storage (S3, ADLS, GCS) as the primary backing store instead of local disk, eliminating over 90% of cross-AZ replication costs. This makes them ideal for latency-tolerant, high-throughput workloads such as observability streams, analytics pipelines, and AI/ML training data feeds, where cross-AZ networking charges are the dominant cost driver. You can use Cloud Topics exclusively or in combination with standard topics on a cluster supporting low-latency workloads. #### Schema Registry metadata properties [Schema Registry metadata properties](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-overview/#metadata-properties) let you store and retrieve arbitrary key-value pairs alongside schemas. Properties such as `owner`, `team`, or `application.version` travel with the schema through its lifecycle, making it easier to track ownership and lineage without modifying the schema itself. You can set metadata when registering a schema using the `POST /subjects/{subject}/versions` endpoint or with the `--metadata-properties` flag in `rpk registry schema create`. Metadata is returned in API responses and viewable with `rpk registry schema get --print-metadata` or in Redpanda Cloud Console. #### Schema Registry Contexts [Schema Registry contexts](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-contexts/) provide isolated namespaces that separate schemas, subjects, and configuration within a single Schema Registry instance. Each context maintains its own schema ID counter, mode settings, and compatibility settings. On Serverless clusters, Redpanda uses contexts internally for per-tenant isolation. Contexts are not exposed to end users on Serverless. On BYOC and Dedicated clusters, contexts are available and user-configurable. #### User-based throughput quotas Redpanda now supports throughput quotas based on authenticated user principals. Unlike client-based quotas (which rely on self-declared `client-id` values), [user-based quotas](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/manage-throughput/#set-user-based-quotas) enforce limits using verified identities from SASL, mTLS, or OIDC authentication. You can set quotas for individual users, default users, or fine-grained user/client combinations. #### Iceberg: Expanded JSON Schema support Redpanda now supports additional JSON Schema patterns when translating to Iceberg tables: - `$ref` support: Internal references using `$ref` (for example, `"$ref": "#/definitions/myType"`) are resolved from schema resources declared in the same document. External references are not yet supported. - Map type from `additionalProperties`: `additionalProperties` objects that contain subschemas now translate to Iceberg `map`. - `oneOf` nullable pattern: The `oneOf` keyword is now supported for the standard nullable pattern if exactly one branch is `{"type":"null"}` and the other is a non-null schema. See [Specify Iceberg Schema](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/specify-iceberg-schema/#how-iceberg-modes-translate-to-table-format) for JSON types mapping and updated requirements. #### Ordered rack preference for leader pinning [Leader pinning](https://docs.redpanda.com/cloud-data-platform/develop/produce-data/leader-pinning/) now supports the `ordered_racks` configuration value, which lets you specify preferred racks in priority order. Unlike `racks`, which distributes leaders uniformly across all listed racks, `ordered_racks` places leaders in the highest-priority available rack and fails over to subsequent racks only when higher-priority racks become unavailable. #### BYOVPC on AWS: GA [BYOVPC on AWS](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws/vpc-byo-aws/) is now generally available (GA). With Bring Your Own VPC (BYOVPC), you deploy the Redpanda data plane into your own VPC and manage security policies and resources yourself, including subnets, IAM roles, firewall rules, and storage buckets. The Redpanda BYOVPC Terraform Module contains Terraform code that deploys the resources required for a BYOVPC cluster on AWS. Secrets management is enabled by default with the Terraform module. #### Iceberg topics with Snowflake Open Catalog: GA The [Snowflake and Open Catalog integration](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/redpanda-topics-iceberg-snowflake-catalog/) for Iceberg topics is now generally available (GA). #### Billing notifications Redpanda Cloud now sends email notifications to organization admins when credit or commit balances reach spending thresholds (50%, 30%, 10%, and 0% remaining). You can manage your notification preferences or opt out at any time. See [Manage Billing Notifications](https://docs.redpanda.com/cloud-data-platform/billing/billing-notifications/). ### February 2026 #### Serverless on AWS: GA [Serverless](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/) on AWS is now generally available (GA). This release includes private networking with AWS PrivateLink. You can use the Cloud Console, the Cloud API, or the Redpanda Terraform provider to create and manage Serverless private links. Serverless is the easiest and fastest way to begin streaming data with Redpanda. #### Enable schema ID validation You can now enable [schema ID validation](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-id-validation/) by [configuring the `enable_schema_id_validation` cluster property](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/). This controls whether or not Redpanda validates schema IDs in records and which topic properties are enforced. Use caution when enabling this property, because it could cause decompression across topics and increase CPU load. #### Cross-region AWS PrivateLink AWS PrivateLink now supports cross-region connectivity, allowing clients in different AWS regions to connect to your Redpanda cluster through PrivateLink. Configure supported regions in the [Cloud Console](https://docs.redpanda.com/cloud-data-platform/networking/configure-privatelink-in-cloud-ui/#cross-region-privatelink), using the [Cloud API](https://docs.redpanda.com/cloud-data-platform/networking/aws-privatelink/#cross-region-privatelink), or with the Redpanda Terraform provider (v1.7.0+) using the `supported_regions` attribute of the `aws_private_link` block. See [Configure cross-region AWS PrivateLink](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/#configure-cross-region-aws-privatelink). This feature requires multi-AZ cluster deployments. ### January 2026 #### SASL/PLAIN authentication for shadow links Shadow links on BYOC and Dedicated clusters can now authenticate to the source cluster with SASL/PLAIN, in addition to SASL/SCRAM, for source clusters that support only PLAIN. As with SCRAM, the password must be stored as a secret on the shadow cluster and referenced by its ID. PLAIN sends credentials unhashed, so use it only over a TLS-encrypted connection. See [Configure Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/#network-and-authentication). #### Redpanda Connect updates - Inputs: - [otlp_grpc](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/otlp_grpc/): Receive OpenTelemetry traces, logs, and metrics via OTLP/gRPC protocol. Exposes an OpenTelemetry Collector gRPC receiver that accepts traces, logs, and metrics, converting them to individual Redpanda OTEL v1 protobuf messages optimized for Kafka partitioning. - [otlp_http](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/otlp_http/): Receive OpenTelemetry traces, logs, and metrics via OTLP/HTTP protocol. Supports both protobuf and JSON formats at standard OTLP endpoints, converting telemetry data to individual messages with embedded Resource and Scope metadata. - Outputs: - [otlp_grpc](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/otlp_grpc/): Send OpenTelemetry traces, logs, and metrics via OTLP/gRPC protocol. Accepts batches of Redpanda OTEL v1 protobuf messages and converts them to OTLP format for transmission to OpenTelemetry collectors. - [otlp_http](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/otlp_http/): Send OpenTelemetry traces, logs, and metrics via OTLP/HTTP protocol. Supports both protobuf and JSON content types for flexible integration with OpenTelemetry backends. #### Redpanda Connect and Roles in Terraform provider The [Redpanda Terraform provider](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/) now supports managing roles and Redpanda Connect pipelines. Use the provider to create and manage role-based access control and data pipelines in Redpanda Cloud. ## 2025 Features and updates released in 2025, listed by month. ### December 2025 #### Shadowing Redpanda Cloud now supports [Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/overview/), a disaster recovery solution that provides asynchronous, offset-preserving replication between distinct Redpanda clusters. Shadowing enables cross-region data protection by replicating topic data, configurations, consumer group offsets, ACLs, and Schema Registry data with byte-level fidelity. The shadow cluster operates in read-only mode while continuously receiving updates from the source cluster. During a disaster, you can failover individual topics or an entire shadow link to make resources fully writable for production traffic. Shadowing is supported on BYOC and Dedicated clusters running Redpanda version 25.3 and later. #### Metrics for Serverless You can now view and export metrics from Serverless clusters to third-party monitoring systems like Prometheus and Grafana. See [Monitor Redpanda Cloud](https://docs.redpanda.com/cloud-data-platform/manage/monitor-cloud/) for details on configuring monitoring for your Serverless cluster and [Metrics Reference](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/) for a list of metrics available in Serverless. #### Account impersonation BYOC and Dedicated clusters now support unified authentication and authorization between the Redpanda Cloud UI and Redpanda with [account impersonation](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/#account-impersonation). This means you can authenticate to fine-grained access within Redpanda using the same credentials you use to authenticate to Redpanda Cloud. With account impersonation (originally called user impersonation), the topics users see in the UI are identical to what they can access with the Cloud API or `rpk`, ensuring consistent permissions across all interfaces and clear auditing of data plane user actions. #### Redpanda Connect updates - Tracers: - [Redpanda](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/tracers/redpanda/): The Redpanda tracer exports distributed tracing data to a Redpanda topic, enabling you to monitor and debug your Redpanda Connect pipelines. Traces are exported in OpenTelemetry format as JSON, allowing integration with observability platforms like Jaeger, Grafana Tempo, or custom trace consumers. ### November 2025 #### Serverless on GCP: beta You can now create [Serverless clusters](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/) on Google Cloud Platform (GCP). Serverless on GCP is in a [beta](https://docs.redpanda.com/home/glossary/#beta) release. #### Support for additional regions [BYOC clusters](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/#byoc-supported-regions) on Azure now support the Sweden Central and Germany West Central regions. #### Connected client monitoring You can view details about Kafka client connections using `rpk` or the Data Plane API. This allows you to view detailed information about active client connections on a cluster, and identify and troubleshoot problematic clients. For more information, see the [connected client details](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/manage-throughput/#view-connected-client-details) example in the Manage Throughput guide. #### Increased message size limit Redpanda Cloud increased the [message size limit](https://docs.redpanda.com/cloud-data-platform/develop/topics/create-topic/) on newly-created topics. BYOC and Dedicated clusters have a default message size limit of 20 MiB with a maximum of 32 MiB. Serverless clusters have a default message size limit of 8 MiB with a maximum of 20 MiB. Configure the message size limit with the `max.message.bytes` topic property. The message size setting on existing topics is not changed, but the message size limit on existing topics can only be updated to the new maximum. #### Redpanda Connect updates Redpanda Connect provides a simplified [quickstart](https://docs.redpanda.com/cloud-data-platform/develop/connect/connect-quickstart/) experience in the UI that helps you to start building data pipelines. The quickstart creates pipelines to stream data into and out of Redpanda using the pipeline editor. #### Get Started with Serverless A Serverless cluster’s **Overview** page now provides a **Get Started** guide to help you start streaming your own data with a [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/connect-quickstart/) pipeline. It lets you stream data into and out of Redpanda without writing producer/consumer code. #### Remote read replicas: GA [Remote read replicas](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/remote-read-replicas/) are now generally available (GA) for BYOC clusters on AWS and GCP. This feature allows you to create read-only topics that mirror a topic on a different cluster, providing greater flexibility and scalability for your data streaming needs. #### Schema Registry and ACLs in Terraform provider The [Redpanda Terraform provider](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/) now supports managing schemas and Schema Registry ACLs. You can use the provider to register schemas in formats such as Avro, Protobuf, or JSON Schema, and control access to Schema Registry subjects and operations through ACLs. ### October 2025 #### API Gateway access BYOC and Dedicated clusters with private networking now allow control of API Gateway network access, independent of the Redpanda cluster. When you create a cluster, you can choose either public or private access for the API Gateway: - Public access exposes Redpanda Console, Data Plane API, and MCP Server API endpoints over the internet, although they remain protected by your authentication and authorization controls. - Private access restricts endpoint access to your private network (VPC or VNet) only. After the cluster is created, you can change the API Gateway access on the Dataplane settings page. If you change from public to private access, users without VPN access to the Redpanda VPC will lose access to these services. #### Redpanda Connect updates - Inputs: - [Microsoft SQL Server CDC](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/microsoft_sql_server_cdc/): Streams change data from a Microsoft SQL Server database into Redpanda Connect using Change Data Capture (CDC). - Outputs: - [CyborgDB](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/cyborgdb/): Write vectors to a CyborgDB encrypted index. CyborgDB provides end-to-end encrypted vector storage with automatic dimension detection and index optimization. - Processors: - [`jira`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/jira/): Executes Jira API queries based on input messages and returns structured results. The processor handles pagination, retries, and field expansion automatically. - Deprecated components: - `redpanda_migrator` input and output (renamed to `legacy_redpanda_migrator`) - `redpanda_migrator_offsets` input and output (renamed to `legacy_redpanda_migrator_offsets`) Migrate from these deprecated components to the new unified `redpanda_migrator` input/output pair. For detailed migration instructions, see [Migrate to the Unified Redpanda Migrator](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/migrate-unified-redpanda-migrator/). - `redpanda_migrator_bundle` input and output (these are part of the legacy migration architecture and internally depend on the deprecated `legacy_redpanda_migrator` and `legacy_redpanda_migrator_offsets` components) - `kafka`, `kafka_franz`, and `redpanda_common` inputs and outputs. These components have been consolidated into the unified `redpanda` input and output components. Migrate existing configurations to use the new `redpanda` components for continued support and access to the latest features. For detailed information about recent component updates, see [What’s New in Redpanda Connect](https://docs.redpanda.com/connect/get-started/whats-new/). ### September 2025 #### Multi-factor authentication Enable multi-factor authentication (MFA) to add an extra layer of security to your Redpanda Cloud account. After you enable MFA, you’ll enter your credentials, then be prompted for a one-time code from your authenticator app when you log in. Administrators can also [enforce MFA](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/#multi-factor-authentication-mfa) for all members of an organization. #### Redpanda Cloud Management MCP Server: beta Connect AI assistants like Claude directly to your Redpanda Cloud account with the new Redpanda Cloud Management MCP Server. This server runs on your computer and provides AI tools for managing clusters, topics, and other cloud resources through natural language commands. Ask your AI assistant to "Create a new topic called user-events" or "List all clusters in my account" and it will handle the technical details automatically. Get started with the [rpk cloud mcp install](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cloud/rpk-cloud-mcp-install/) command. The Redpanda Cloud Management MCP Server uses the Model Context Protocol (MCP) to extend AI assistants with Redpanda-specific capabilities, making cloud operations more accessible through conversational interfaces. #### Automatic topic creation and topic limit For BYOC and Dedicated clusters, you can now configure the `auto_create_topics_enabled` cluster property to automatically create a topic if a client produces to a non-existent topic. For BYOC and Dedicated clusters: each cluster now has a limit of 40,000 topics. ### August 2025 #### Manage custom resource tags in BYOC After cluster creation, you can manage custom cloud provider tags and labels on BYOC and BYOVPC/BYOVNet clusters for [AWS](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws/create-byoc-cluster-aws/#manage-custom-tags), [Azure](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/create-byoc-cluster-azure/#manage-custom-tags), and [GCP](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/create-byoc-cluster-gcp/#manage-custom-resource-labels-and-network-tags) using the Cloud Control Plane API. This involves refreshing Redpanda agent permissions with `rpk cloud byoc` due to new IAM permissions. #### Iceberg topics with AWS Glue A new [integration with AWS Glue Data Catalog](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-topics-aws-glue/) allows you to add Redpanda topics as Iceberg tables in your data lakehouse. The AWS Glue catalog integration is available in BYOC clusters with Redpanda version 25.2 and later. See [Integrate with REST Catalogs](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/rest-catalog/) for supported Iceberg REST catalog integrations. #### Manage throughput Redpanda Cloud now lets you [manage throughput](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/manage-throughput/) configuration at the broker and client levels. You can manage client quotas with [`rpk cluster quotas`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cluster/rpk-cluster-quotas/) or with the Kafka API. When no quotas apply, the client has unlimited throughput. ### July 2025 #### Iceberg topics in Redpanda Cloud: GA [Iceberg topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/about-iceberg-topics/) are now generally available (GA) in Redpanda Cloud. #### BYOC on Azure: GA [BYOC for Azure](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/create-byoc-cluster-azure/) is now generally available (GA). #### Schema Registry Authorization You can now use [Schema Registry Authorization](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-authorization/) to control access to Schema Registry subjects and operations. Schema Registry Authorization offers more granular control over who can do what with your Redpanda Schema Registry resources. ACLs used for Schema Registry access also support RBAC roles. #### Kafka Connect disabled on new clusters [Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/) is now disabled by default on all new clusters. To unlock this feature for your account, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). If you previously enabled Kafka Connect on a cluster and want to [disable it](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/), you can use the Cloud API. #### Allowlist NAT gateway IP The [Redpanda NAT gateway IP address](https://docs.redpanda.com/cloud-data-platform/networking/cloud-security-network/#nat-gateways) is now provided in the Cloud UI and the Cloud API for BYOC and Dedicated clusters. If necessary, you can use this IP address to allowlist egress traffic from your Redpanda Connect data sources. #### mTLS and SASL authentication for Kafka API on AWS You can now enable mTLS and SASL authentication simultaneously for the Kafka API on AWS clusters. If you enable both mTLS and SASL on AWS clusters, Redpanda creates two distinct listeners: an mTLS listener operating on one port and a SASL listener operating on a different port. See [Authentication](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/#service-authentication) for details on available authentication methods in Redpanda Cloud. #### Azure Private Link in the UI: GA You can now [configure Azure Private Link](https://docs.redpanda.com/cloud-data-platform/networking/azure-private-link-in-ui/) for a new BYOC or Dedicated cluster using the Cloud UI. The Azure Private Link service is generally available (GA) in both the Cloud UI and the Cloud API. #### Redpanda Connect in Redpanda Cloud: GA [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/) is now generally available (GA) in all Redpanda Cloud clusters: BYOC (including BYOVPC/BYOVNet), Dedicated, and Serverless. #### Redpanda Connect updates Redpanda Connect includes the following updates: - The [GCP Spanner CDC](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gcp_spanner_cdc/) component lets you capture changes from Google Cloud Spanner and stream them into Redpanda. You can use it to ingest data from GCP Spanner databases, enabling real-time data processing and analytics. - The [Slack Reaction](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/outputs/slack_reaction/) component lets you send messages to a Slack channel in response to events in Redpanda. You can use it to create alerts, notifications, or other automated responses based on data changes in Redpanda. - The [Redpanda Cache](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/caches/redpanda/) component lets you cache data in Redpanda, improving performance and reducing latency for data access. You can use it to store frequently accessed data, such as configuration settings or user profiles, in Redpanda. For more detailed information about recent component updates, see [What’s New in Redpanda Connect](https://docs.redpanda.com/connect/get-started/whats-new/). #### Serverless client connections [Serverless](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/) clusters have a new usage limit of 10,000 connections. ### June 2025 #### Schema Registry UI for Serverless The [Schema Registry UI](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-ui/) is now available for Serverless clusters. #### Amazon VPC Transit Gateway For BYOC and BYOVPC clusters on AWS, you can set up an [Amazon VPC Transit Gateway](https://docs.redpanda.com/cloud-data-platform/networking/byoc/aws/transit-gateway/) to connect VPCs to Redpanda services while maintaining control over network traffic. #### Support for additional regions Serverless clusters now support the following new [regions on AWS](https://docs.redpanda.com/cloud-data-platform/reference/tiers/serverless-regions/): ap-northeast-1 (Tokyo), ap-southeast-1 (Singapore), and eu-west-2 (London). #### HTTP gateway The [`gateway`](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/gateway/) component is now available in Redpanda Connect for Redpanda Cloud. This component allows you to create an HTTP endpoint that can receive data from any HTTP client and stream it into Redpanda. You can use the gateway to ingest data from IoT devices, web applications, or any other HTTP-based source. See the [Ingest Real-Time Sensor Telemetry with the HTTP Gateway](https://docs.redpanda.com/cloud-data-platform/develop/connect/guides/cloud/gateway/) guide for more information. ### May 2025 #### Redpanda Connect for BYOVNet on Azure: beta [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/) is now enabled when you create a BYOVNet cluster on [Azure](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/vnet-azure/). #### Secrets management for BYOVPC clusters on AWS and GCP You can now create new BYOVPC clusters with secrets management enabled by default on [AWS](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws/vpc-byo-aws/) and [GCP](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/vpc-byo-gcp/). You can also enable secrets management for existing BYOVPC clusters on AWS and GCP. For GCP, see [Enable Secrets Management for BYOVPC Clusters on GCP](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/enable-secrets-byovpc-gcp/). For AWS, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). #### Serverless Standard: deprecated Serverless Standard is deprecated. All existing clusters will be migrated to the new [Serverless](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/) platform (with higher usage limits, 99.9% SLA, and additional regions) on August 31, 2025. - Retirement date: August 30, 2025 #### Cloud API beta versions: deprecated The Cloud Control Plane API versions v1beta1 and v1beta2, and Data Plane API versions v1alpha1 and v1alpha2 are deprecated. These Cloud API versions will be removed in a future release and are not recommended for use. The deprecation timeline is: - Announcement date: May 27, 2025 - End-of-support date: November 28, 2025 - Retirement date: May 28, 2026 See the [Cloud API Deprecation Policy](https://docs.redpanda.com/api/doc/cloud-controlplane/topic/topic-deprecation-policy) for more information. #### Read-only cluster configuration properties You can now [view the value of read-only cluster configuration properties](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/#view-cluster-property-values) with `rpk cluster config` or with the Cloud API. Available properties are listed in [Cluster Properties](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/) and [Object Storage Properties](https://docs.redpanda.com/cloud-data-platform/reference/properties/object-storage-properties/). #### Iceberg topics in Azure: beta [Iceberg topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/about-iceberg-topics/) are now supported for BYOC clusters in Azure. #### Support for additional region [BYOC clusters](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/#byoc-supported-regions) on GCP now support the us-west2 (Los Angeles) region. #### Redpanda Terraform provider: GA The [Redpanda Terraform provider](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/) is now generally available (GA). The provider lets you create and manage resources in Redpanda Cloud, such as clusters, topics, users, ACLs, networks, and resource groups. ### April 2025 #### mTLS and SASL authentication for Kafka API on GCP You can now enable mTLS and SASL authentication simultaneously for the Kafka API on GCP clusters. If you enable both mTLS and SASL on GCP clusters, Redpanda creates two distinct listeners: an mTLS listener operating on one port and a SASL listener operating on a different port. See [Authentication](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/#service-authentication) for details on available authentication methods in Redpanda Cloud. #### Increased number of supported partitions The number of partitions (pre-replication) Redpanda Cloud supports for each [usage tier](https://docs.redpanda.com/cloud-data-platform/reference/tiers/) has been doubled. For example, the number of supported partitions in tier 1 went from 1,000 to 2,000, and tier 5 went from 22,800 to 45,600. #### Iceberg topics: beta The [Iceberg integration for Redpanda](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/about-iceberg-topics/) allows you to store topic data in the cloud in the Iceberg open table format. This makes your streaming data immediately available in downstream analytical systems without setting up and maintaining additional ETL pipelines. You can also integrate your data directly into commonly-used big data processing frameworks, standardizing and simplifying the consumption of streams as tables in a wide variety of data analytics pipelines. Iceberg topics are supported for BYOC clusters in AWS and GCP. #### Cluster configuration You can now [configure certain cluster properties](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/) with `rpk cluster config` or with the Cloud API. For example, you can enable and manage [Iceberg topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/about-iceberg-topics/), [data transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/), and [audit logging](https://docs.redpanda.com/cloud-data-platform/manage/audit-logging/). Available properties are listed in [Cluster Configuration Properties](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/). Iceberg topics properties are available for clusters running Redpanda version 25.1 or later. #### Manage secrets for cluster configuration Redpanda Cloud now supports managing secrets that you can reference in cluster properties, for example, to configure Iceberg topics. You can create, update, and delete secrets and reference a secret in cluster properties using `rpk` or the Cloud API. See also: - Manage secrets using [`rpk security secret`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-security/rpk-security-secret/) - Manage secrets using the [Data Plane API](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-dataplane-api/#manage-secrets) - Reference a secret in a cluster property using [`rpk cluster config set`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cluster/rpk-cluster-config-set/) - Reference a secret in a cluster property using the [Control Plane API](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/) #### Data transforms: GA WebAssembly [data transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/) are now generally available in Redpanda Cloud. Data transforms let you run common data streaming tasks within Redpanda, like filtering, scrubbing, and transcoding. Data transforms are supported for BYOC and Dedicated clusters running Redpanda version 24.3 and later. #### Redpanda Connect for BYOVPC on AWS and GCP: beta Redpanda Connect is now enabled when you create a BYOVPC cluster on [AWS](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws/vpc-byo-aws/) or [GCP](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/vpc-byo-gcp/). You can also add Redpanda Connect to an [existing BYOVPC GCP cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/enable-rpcn-byovpc-gcp/). ### March 2025 #### Serverless For a better customer experience, the Serverless Standard and Serverless Pro products have merged into a single offering. [Serverless clusters](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/) now include the higher usage limits, 99.9% SLA, additional AWS regions, and the free trial. #### Cloud API: GA The Cloud API is now generally available. It includes endpoints for [managing Serverless clusters](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-serverless-controlplane-api/), configuring RBAC in [BYOC](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-byoc-controlplane-api/#manage-rbac), [Serverless](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-serverless-controlplane-api/#manage-rbac), and [Dedicated](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-dedicated-controlplane-api/#manage-rbac) clusters, and [using Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-dataplane-api/#use-redpanda-connect). To get started, see the [Redpanda Cloud API overview](https://docs.redpanda.com/api/doc/cloud-controlplane/topic/topic-cloud-api-overview) or try the [Cloud API Quickstart](https://docs.redpanda.com/api/doc/cloud-controlplane/topic/topic-quickstart). For full reference documentation, see [Control Plane API](https://docs.redpanda.com/api/doc/cloud-controlplane/) and [Data Plane API](https://docs.redpanda.com/api/doc/cloud-dataplane/). #### Support for additional regions [BYOC clusters](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/#byoc-supported-regions) on GCP now support the europe-southwest1 (Madrid) region. #### BYOVPC support in the Redpanda Terraform provider 0.14.0: Beta The [Redpanda Terraform provider](https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs/resources/cluster#byovpc) now supports BYOVPC clusters on AWS and GCP. You can use the provider to create and manage BYOVPC clusters in Redpanda Cloud. ### February 2025 #### Role-based access control (RBAC) With [RBAC in the control plane](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac/), you can manage access to organization-level resources like clusters, resource groups, and networks. For example, you could grant everyone access to clusters in a development resource group while limiting access to clusters in a production resource group. Or, you could limit access to geographically-dispersed clusters in accordance with data residency laws. With [RBAC in the data plane](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac_dp/), you can configure cluster-level permissions for provisioned users at scale. #### Improved Private Service Connect support with AZ affinity The latest version of the Redpanda [GCP Private Service Connect](https://docs.redpanda.com/cloud-data-platform/networking/gcp-private-service-connect/) service provides the ability to allow requests from Private Service Connect endpoints to stay within the same availability zone, avoiding additional networking costs. The service is now fully supported (GA). To upgrade, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). > ❗ **IMPORTANT** > > Deprecated: The original GCP Private Service Connect service is deprecated and will be removed in a future release. #### Serverless Pro usage limits increased Usage limits for Serverless Pro clusters increased to: ingress = 100 MBps, egress = 300 MBps, partitions = 5000. #### Cloud API reference The Cloud API reference is now provided as separate references for the [Control Plane API](https://docs.redpanda.com/api/doc/cloud-controlplane/) and [Data Plane APIs](https://docs.redpanda.com/api/doc/cloud-dataplane/). The Control Plane API and Data Plane APIs follow separate OpenAPI specifications, so the reference is updated to better reflect the structure of the Cloud APIs and to improve usability of the documentation. See also: [Cloud API Overview](https://docs.redpanda.com/api/doc/cloud-controlplane/topic/topic-cloud-api-overview). ### January 2025 #### New tiers and regions on Azure [Tiers 1-5](https://docs.redpanda.com/cloud-data-platform/reference/tiers/) are now supported for BYOC and Dedicated clusters running on Azure. Also, the following [regions](https://docs.redpanda.com/cloud-data-platform/reference/tiers/dedicated-tiers/#dedicated-supported-regions) were added for Dedicated clusters: Central US, East US 2, Norway East. #### Serverless Pro: LA Serverless Pro is a new enterprise-level cluster option. It is similar to Serverless Standard, but with higher usage limits and Enterprise support. This is a limited availability (LA) release. To start using Serverless Pro, contact [Redpanda Sales](https://redpanda.com/try-redpanda?section=enterprise-trial). #### AWS PrivateLink: GA AWS PrivateLink is now generally available for private networking in the [Cloud UI](https://docs.redpanda.com/cloud-data-platform/networking/configure-privatelink-in-cloud-ui/) and the [Cloud API](https://docs.redpanda.com/cloud-data-platform/networking/aws-privatelink/). ## 2024 Features and updates released in 2024, listed by month. ### December 2024 #### Support for additional regions For [BYOC clusters](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/#byoc-supported-regions), Redpanda added support for the following regions: - GCP: europe-west9 (Paris), southamerica-west1 (Santiago) - AWS: ap-southeast-3 (Jakarta), eu-north-1 (Stockholm), eu-south-1 (Milan), eu-west-3 (Paris) #### Redpanda Connect updates Redpanda Connect is now available on Dedicated clusters. This is a limited availability (LA) release. [Secret management](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) is also available on BYOC, Dedicated, and Serverless clusters so that you can add secrets to your pipelines without exposing them. #### Leader pinning For a Redpanda cluster deployed across multiple availability zones (AZs), [leader pinning](https://docs.redpanda.com/cloud-data-platform/develop/produce-data/leader-pinning/) ensures that a topic’s partition leaders are geographically closer to clients. Leader pinning can lower networking costs and help guarantee lower latency by routing produce and consume requests to brokers located in certain AZs. ### November 2024 #### BYOVPC on AWS: beta With standard BYOC clusters, Redpanda manages security policies and resources for your VPC, including subnetworks, service accounts, IAM roles, firewall rules, and storage buckets. For the highest level of security, you can manage these resources yourself with a [BYOVPC on AWS](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws/vpc-byo-aws/), previously known as _customer-managed VPC_. #### Customer-managed VNet on Azure: LA With standard BYOC clusters, Redpanda manages security policies and resources for your virtual network (VNet), including subnetworks, managed identities, IAM roles, security groups, and storage accounts. For the highest level of security, you can manage these resources yourself with a [customer-managed VNet on Azure](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/vnet-azure/). Because Azure functionality is provided in limited availability, to unlock this feature, contact [Redpanda support](https://support.redpanda.com/hc/en-us/requests/new). ### October 2024 #### BYOC support in the Terraform provider 0.10 The [Terraform provider](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/) now supports BYOC clusters. You can use the provider to create and manage BYOC clusters in Redpanda Cloud. #### Azure Marketplace for Dedicated clusters You can contact [Redpanda sales](https://redpanda.com/try-redpanda?section=enterprise-trial) to request a private offer for monthly or annual [committed use through the Azure Marketplace](https://docs.redpanda.com/cloud-data-platform/billing/azure-commit/). You can then quickly provision Dedicated clusters in Redpanda Cloud, and you can view your bills and manage your subscription directly in Azure Marketplace. #### Support for AWS Graviton3 Redpanda now supports compute-optimized tiers with AWS Graviton3 processors. This saves over 50% in instance costs in all [BYOC tiers](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/). #### Redpanda Terraform Provider for Redpanda Cloud: beta The [Redpanda Terraform provider](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/) lets you create and manage resources in Redpanda Cloud, such as clusters, topics, users, ACLs, networks, and resource groups. ### September 2024 #### Schedule maintenance windows Redpanda Cloud now offers greater flexibility to schedule upgrades to your cluster. By default, Redpanda Cloud may run maintenance operations on any day at any time. You can override this default and * [schedule a maintenance window](https://docs.redpanda.com/cloud-data-platform/manage/maintenance/#maintenance-windows), which requires Redpanda Cloud to run operations on your specified day and time. #### Redpanda Connect: LA for BYOC, beta for Serverless [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/) is now integrated into Redpanda Cloud and available as a fully-managed service. This is a limited availability (LA) release for BYOC and a beta release for Serverless. [Choose from a range of connectors, processors, and other components](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/about/) to quickly build and deploy streaming data pipelines or AI applications from the [Cloud UI](https://docs.redpanda.com/cloud-data-platform/develop/connect/connect-quickstart/) or using the [Data Plane API](https://docs.redpanda.com/api/doc/cloud-dataplane/group/endpoint-redpanda-connect-pipeline). Comprehensive metrics, monitoring, and per pipeline scaling are also available. To start using Redpanda Connect, [try this quickstart](https://docs.redpanda.com/cloud-data-platform/develop/connect/connect-quickstart/). For more detailed information about recent component updates, see [What’s New in Redpanda Connect](https://docs.redpanda.com/connect/get-started/whats-new/). #### Dedicated on Azure: LA Redpanda now supports [Dedicated clusters on Azure](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/create-dedicated-cloud-cluster/). This is a limited availability (LA) release for Dedicated clusters. #### Remote read replicas on customer-managed VPC The beta release of [remote read replicas](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/remote-read-replicas/) has been extended to support customer-managed VPC deployments. ### July 2024 #### Redpanda Cloud docs The [Redpanda Docs site](https://docs.redpanda.com/home/) has been redesigned for an easier experience navigating Redpanda Cloud docs. We hope that our docs help and inspire our users. Please share your feedback with the links at the bottom of any doc page. #### BYOC on Azure: LA Redpanda now supports [BYOC clusters on Azure](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/azure/create-byoc-cluster-azure/). This is a limited availability (LA) release for BYOC clusters. #### Enhancements to Serverless: LA - The [Redpanda Cloud API](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-serverless-controlplane-api/) now includes support for [Serverless](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/). - The Redpanda Schema Registry API is now exposed for Serverless. - Serverless subscriptions can now see detailed billing activity on the **Billing** page. - Serverless added a 99.5% uptime [SLA](https://www.redpanda.com/legal/redpanda-cloud-service-level-agreement) (service level agreement). #### Self service sign up for Dedicated on AWS Marketplace To start using Dedicated, sign up on the [AWS Marketplace](https://docs.redpanda.com/cloud-data-platform/billing/aws-pay-as-you-go/). New subscriptions receive $300 (USD) in free credits to spend in the first 30 days. AWS Marketplace charges for anything beyond $300, unless you cancel the subscription. After your credits have been used, you can continue using your cluster without any commitment, only paying for what you consume. #### Support for additional regions For [BYOC clusters](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/#byoc-supported-regions) and [Dedicated clusters](https://docs.redpanda.com/cloud-data-platform/reference/tiers/dedicated-tiers/#dedicated-supported-regions), Redpanda added support for the following regions: - GCP: asia-east1 (Taiwan), asia-northeast1 (Tokyo), southamerica-east1 (São Paulo) - AWS: ap-east-1 (Hong Kong), ap-northeast-1 (Tokyo), me-central-1 (UAE) ### June 2024 #### Remote read replica topics on BYOC: beta You can now create [remote read replica topics](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/remote-read-replicas/) on a BYOC cluster with the Cloud API. A remote read replica topic is a read-only topic that mirrors a topic on a different cluster. It can serve any consumer, without increasing the load on the source cluster. #### Higher connection limits in usage tiers Redpanda has increased the number of client connections in all [tiers](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/). For example, tier 1 now supports up to 9,000 maximum connections, and tier 9 supports up to 450,000 maximum connections. Connections are regulated per broker for best performance. ### May 2024 #### Cloud API: beta The Cloud API allows you to programmatically manage clusters and resources in your Redpanda Cloud organization. For more information, see the [Cloud API Quickstart](https://docs.redpanda.com/api/doc/cloud-controlplane/topic/topic-quickstart), the [Cloud API Overview](https://docs.redpanda.com/api/doc/cloud-controlplane/topic/topic-cloud-api-overview), and the full [Control Plane API](https://docs.redpanda.com/api/doc/cloud-controlplane/) and [Data Plane API](https://docs.redpanda.com/api/doc/cloud-dataplane/) reference documentation. #### mTLS authentication for Kafka API clients mTLS authentication is now available for Kafka API clients. You can [enable mTLS](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/#mtls) for your cluster using the Cloud API. #### Manage private connectivity in the UI You can now manage GCP Private Service Connect and AWS PrivateLink connections to your BYOC or Dedicated cluster on the **Dataplane settings** page in Redpanda Cloud. See the steps for [PrivateLink](https://docs.redpanda.com/cloud-data-platform/networking/configure-privatelink-in-cloud-ui/) and [Private Service Connect](https://docs.redpanda.com/cloud-data-platform/networking/configure-private-service-connect-in-cloud-ui/). #### Single message transforms Redpanda now provides [single message transforms (SMTs)](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/transforms/) to help you modify data as it passes through a connector, without needing additional stream processors. #### Support for additional regions - For [BYOC clusters](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/#byoc-supported-regions), Redpanda added support for the GPC us-west1 region (Oregon) and the AWS ap-south-1 region (Mumbai). - For [Dedicated clusters](https://docs.redpanda.com/cloud-data-platform/reference/tiers/dedicated-tiers/#dedicated-supported-regions), Redpanda added support for the AWS ap-south-1 region. #### Simplified navigation and namespaces renamed resource groups Redpanda Cloud has a simplified navigation, with clusters and networks available at the top level. It now has a global view of all resources in your organization. Namespaces are now called [resource groups](https://docs.redpanda.com/home/glossary/#resource-group), although the functionality remains the same. ### April 2024 #### Additional cloud tiers for BYOC When you create a BYOC or Dedicated cluster, you select a [cloud tier](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/) with the expected usage for your cluster, including the maximum ingress, egress, partitions (pre-replication), and connections. Redpanda has added tiers 8 and 9 for BYOC clusters, which provide higher supported configurations. ### March 2024 #### Serverless: limited availability [Redpanda Serverless](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/) moved out of beta and into limited availability (LA). This means that it has usage limits. During LA, existing clusters can scale to the usage limits, but new clusters may need to wait for availability. Serverless is the fastest and easiest way to start data streaming. It is a production-ready deployment option with automatically-scaling clusters available instantly. To start using Serverless, [sign up for a free trial](https://redpanda.com/try-redpanda/cloud-trial#serverless). This is no base cost, and with pay-as-you-go billing after the trial, you only pay for what you consume. #### Authentication with SSO Redpanda Cloud now supports OpenID Connect (OIDC) integration, so administrators can leverage existing identity providers for user authentication to your Redpanda organization with [single sign-on](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/#single-sign-on) (SSO). Redpanda uses OIDC to delegate the authentication process to an external IdP, such as Okta. To enable this for your account, contact [Redpanda support](https://support.redpanda.com/hc/en-us/requests/new). ### February 2024 #### AWS PrivateLink [AWS PrivateLink](https://docs.redpanda.com/cloud-data-platform/networking/aws-privatelink/) is now available as an easy and highly secure way to connect to Redpanda Cloud from your VPC. You can set up the PrivateLink endpoint service for a new cluster or an existing cluster. To enable AWS PrivateLink for your account, contact [Redpanda support](https://support.redpanda.com/hc/en-us/requests/new). #### Additional cloud tiers When you create a cluster, you select a [cloud tier](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/) with the expected throughput for your cluster, including the maximum ingress, egress, partitions, and connections. On February 5, Redpanda added tiers 6 and 7 for BYOC clusters, which provide higher throughput limits. ### January 2024 #### Usage-based billing in marketplace Redpanda Cloud now supports [usage-based billing](https://docs.redpanda.com/cloud-data-platform/billing/billing/) for Dedicated clusters. Contact [Redpanda sales](https://redpanda.com/try-redpanda?section=enterprise-trial) to request a private offer for monthly or annual committed use. You can then use existing Google Cloud Marketplace or AWS Marketplace credits to quickly provision Dedicated Cloud clusters, and you can view your bills and manage your subscription directly in the marketplace. ## 2023 Features and updates released in 2023, listed by month. ### December 2023 #### Serverless clusters: beta [Redpanda Serverless](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/serverless/) is a managed streaming service (Kafka API) that completely abstracts users from scaling and operational concerns, and you only pay for what you consume. It’s the fastest and easiest way to start event streaming in the cloud. You can try the beta release of Redpanda Serverless with a free trial. ### November 2023 #### AWS BYOC support for ARM-based Graviton2 BYOC clusters on AWS now support ARM-based Graviton2 instances. This lowers VM costs and supports increased partition count. #### Iceberg Sink connector With the [managed connector for Apache Iceberg](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/create-iceberg-sink-connector/), you can write data into Iceberg tables. This enables integration with the data lake ecosystem and efficient data management for complex analytics. #### Schema Registry management In the Redpanda Console UI, you can [perform Schema Registry operations](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-ui/), such as registering a schema, creating a new version of it, and configuring compatibility. The **Schema Registry** page lists verified schemas, including their serialization format and versions. Select an individual schema to see which topics it applies to. #### Maintenance windows With maintenance windows, you have greater flexibility to plan upgrades to your cluster. By default, Redpanda Cloud upgrades take place on Tuesdays. Optionally, on the **Dataplane settings** page, you can select a window of specific off-hours for your business for Redpanda to apply updates. All times are in Coordinated Universal Time (UTC). Updates may start at any time during that window. --- # Page 385: Manage **URL**: https://docs.redpanda.com/cloud-data-platform/manage.md --- # Manage - [Manage Your Organization](https://docs.redpanda.com/cloud-data-platform/manage/manage-organization/) View details about your Redpanda Cloud organization and delete your Serverless organization from the Manage organization page. - [Redpanda CLI](https://docs.redpanda.com/cloud-data-platform/manage/rpk/) The `rpk` tool is a single binary application that provides a way to interact with your Redpanda clusters from the command line. - [Cluster Maintenance](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/) Learn about cluster maintenance and configuration properties. - [Tiered Storage Versions](https://docs.redpanda.com/cloud-data-platform/manage/tiered-storage-versions/) Compare Tiered Storage v1 and v2, and select the version for new topics in your Redpanda Cloud cluster. - [Mountable Topics](https://docs.redpanda.com/cloud-data-platform/manage/mountable-topics/) Safely attach and detach Tiered Storage topics to and from a cluster. - [Integrate Redpanda with Iceberg](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/) Generate Iceberg tables for your Redpanda topics for data lakehouse access. - [Schema Registry](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/) Redpanda's Schema Registry provides the interface to store and manage event schemas. - [Disaster Recovery](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/) Learn about disaster recovery options for Redpanda Cloud. - [Redpanda Cloud API](https://docs.redpanda.com/cloud-data-platform/manage/api/) Use REST APIs to manage Redpanda Cloud resources. - [Redpanda Terraform Provider](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/) Use the Redpanda Terraform provider to create and manage Redpanda Cloud resources. - [Monitor Redpanda Cloud](https://docs.redpanda.com/cloud-data-platform/manage/monitor-cloud/) Learn how to configure monitoring on your BYOC or Dedicated cluster to maintain system health and optimize performance. --- # Page 386: Redpanda Cloud API **URL**: https://docs.redpanda.com/cloud-data-platform/manage/api.md --- # Redpanda Cloud API - [Use the Control Plane API](https://docs.redpanda.com/cloud-data-platform/manage/api/controlplane/) Use the Control Plane API to manage resources in your Redpanda Cloud organization. - [Use the Data Plane APIs](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-dataplane-api/) Use the Data Plane APIs to manage your Redpanda Cloud clusters. --- # Page 387: Use the Control Plane API with BYOC **URL**: https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-byoc-controlplane-api.md --- # Use the Control Plane API with BYOC The Redpanda Cloud API is a collection of REST APIs that allow you to interact with different parts of Redpanda Cloud. The Control Plane API enables you to programmatically manage your organization’s Redpanda infrastructure outside of the Cloud UI. You can call the API endpoints directly, or use tools like Terraform or Python scripts to automate cluster management. See [Control Plane API](https://docs.redpanda.com/api/doc/cloud-controlplane/) for the full API reference documentation. ## Control Plane API The Control Plane API is one central API that allows you to provision clusters, networks, and resource groups. The Control Plane API consists of the following endpoint groups: - [Clusters](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-clusters) - [Networks](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-networks) - [Operations](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-operations) - [Resource Groups](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-resource-groups) - [Control Plane Role Bindings](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-control-plane-role-bindings) - [Control Plane Users](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-control-plane-users) - [Control Plane Service Accounts](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-control-plane-service-accounts) ## Long-running operations Some endpoints do not directly return the resource itself, but instead return an operation. The following is an example response of [`POST /clusters`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_createcluster): ```bash { "operation": { "id": "cqfc6vdmvio001r4vu4", "metadata": { "@type": "type.googleapis.com/redpanda.api.controlplane.v1.CreateClusterMetadata", "cluster_id": "cqg168balf4e4pm8ptu" }, "state": "STATE_IN_PROGRESS", "started_at": "2024-07-23T20:31:29.948Z", "type": "TYPE_CREATE_CLUSTER", "resource_id": "cqg168balf4e4pm8ptu" } } ``` The response object represents the long-running operation of creating a cluster. Cluster creation is an example of an operation that can take a longer period of time to complete. ### Check operation state To check the progress of an operation, make a request to the [`GET /operations/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-operationservice_getoperation) endpoint using the operation ID as a parameter: ```bash curl -H "Authorization: Bearer " https://api.redpanda.com/v1/operations/ ``` > 💡 **TIP** > > When using a shell substitution variable for the token, use double quotes to wrap the header value. The response contains the current state of the operation: `IN_PROGRESS`, `COMPLETED`, or `FAILED`. ## Cluster tiers When you create a BYOC or Dedicated cluster, you select a usage tier. Each tier provides tested and guaranteed workload configurations for throughput, partitions (pre-replication), and connections. Availability depends on the region and the cluster type. See the full list of regions, zones, and tiers available with each provider in the [Control Plane API reference](https://docs.redpanda.com/api/doc/cloud-controlplane/topic/topic-regions-and-usage-tiers). ## Create a cluster To create a new cluster, first create a resource group and network, if you have not already done so. ### Create a resource group Create a resource group by making a POST request to the [`/v1/resource-groups`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-resourcegroupservice_createresourcegroup) endpoint. Pass a name for your resource group in the request body. ```bash curl -H 'Content-Type: application/json' \ -H "Authorization: Bearer " \ -d '{ "resource_group": { "name": "" } }' -X POST https://api.redpanda.com/v1/resource-groups ``` A resource group ID is returned. Pass this ID later when you call the Create Cluster endpoint. ### Create a network Create a network by making a request to [`POST /v1/networks`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-networkservice_createnetwork). Choose a [CIDR range](https://docs.redpanda.com/cloud-data-platform/networking/cidr-ranges/) that does not overlap with your existing VPCs or your Redpanda network. ```bash curl -d \ '{ "network": { "cidr_block": "10.0.0.0/20", "cloud_provider": "CLOUD_PROVIDER_GCP", "cluster_type": "TYPE_BYOC", "name": "", "resource_group_id": "", "region": "us-west1" } }' -H "Content-Type: application/json" \ -H "Authorization: Bearer " -X POST https://api.redpanda.com/v1/networks ``` This endpoint returns a [long-running operation](#lro). ### Create a new cluster After the network is created, make a request to the [`POST /v1/clusters`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_createcluster) with the resource group ID and network ID in the request body. ```bash curl -d \ '{ "cluster": { "cloud_provider": "CLOUD_PROVIDER_GCP", "connection_type": "CONNECTION_TYPE_PUBLIC", "name": "my-new-cluster", "resource_group_id": "", "network_id": "", "region": "us-west1", "throughput_tier": "", "type": "TYPE_BYOC", "zones": [ "us-west1-a", "us-west1-b", "us-west1-c" ], "cluster_configuration": { "custom_properties": { "audit_enabled":true } } } }' -H "Content-Type: application/json" \ -H "Authorization: Bearer " -X POST https://api.redpanda.com/v1/clusters ``` Replace `` with a usage tier that is valid for your region and cluster type. For example, `tier-1-gcp-v2-x86`. See the [Control Plane API reference](https://docs.redpanda.com/api/doc/cloud-controlplane/topic/topic-regions-and-usage-tiers) for the full list of regions, zones, and tiers. The Create Cluster endpoint returns a [long-running operation](#lro). When the operation completes, you can retrieve cluster details by calling [`GET /v1/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_getcluster), and passing the cluster ID as a parameter. #### Additional steps to create a BYOC cluster 1. Ensure that you have installed `rpk`. 2. After making a Create Cluster request, run `rpk cloud byoc`. Pass `metadata.cluster_id` from the Create Cluster response: ##### AWS ```bash rpk cloud byoc aws apply --redpanda-id= ``` ##### Azure ```bash rpk cloud byoc azure apply --redpanda-id= --subscription-id= ``` ##### GCP ```bash rpk cloud byoc gcp apply --redpanda-id= --project-id= ``` ## Update cluster configuration To update your cluster configuration properties, make a request to the [`PATCH /v1/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster) endpoint, passing the cluster ID as a parameter. Include the properties to update in the request body. ```bash curl -H "Authorization: Bearer " \ -H 'accept: application/json'\ -H 'content-type: application/json' \ -d '{ "cluster_configuration": { "custom_properties": { "iceberg_enabled":true, "iceberg_catalog_type":"rest" } } }' -X PATCH "https://api.cloud.redpanda.com/v1/clusters/" ``` The Update Cluster endpoint returns a [long-running operation](#lro). [Check the operation state](#check-operation-state) to verify that the update is complete. ## Delete a cluster To delete a cluster, make a request to the [`DELETE /v1/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_deletecluster) endpoint, passing the cluster ID as a parameter. This is a [long-running operation](#lro). ```bash curl -H "Authorization: Bearer " -X DELETE https://api.redpanda.com/v1/clusters/ ``` ### Additional steps to delete a BYOC cluster 1. Make a request to [`GET /v1/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_getcluster) to check the state of the cluster. Wait until the state is `STATE_DELETING_AGENT`. 2. After the state changes to `STATE_DELETING_AGENT`, run `rpk cloud byoc` to destroy the agent. #### AWS ```bash rpk cloud byoc aws destroy --redpanda-id= ``` #### Azure ```bash rpk cloud byoc azure destroy --redpanda-id= ``` #### GCP ```bash rpk cloud byoc gcp destroy --redpanda-id= --project-id= ``` 3. When the cluster is deleted, the delete operation’s state changes to `STATE_COMPLETED`. At this point, you may make a DELETE request to the [`/v1/networks/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-networkservice_deletenetwork) endpoint to delete the network. This is a long running operation. 4. Optional: After the network is deleted, make a request to [`DELETE /v1/resource-groups/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-resourcegroupservice_deleteresourcegroup) to delete the resource group. ## Manage RBAC You can also use the Control Plane API to manage [RBAC configurations](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac/). ### List role bindings To see role assignments for IAM user and service accounts, make a GET request to the [`/v1/role-bindings`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-rolebindingservice_listrolebindings) endpoint. ```bash curl https://api.redpanda.com/v1/role-bindings?filter.role_name=&filter.scope.resource_type=SCOPE_RESOURCE_TYPE_CLUSTER \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" ``` ### Get role binding To see roles assignments for a specific IAM account, make a GET request to the [`/v1/role-bindings/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-rolebindingservice_getrolebinding) endpoint, passing the role binding ID as a parameter. ```bash curl "https://api.redpanda.com/v1/role-bindings/ \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" ``` ### Get user To see details of an IAM user account, make a GET request to the [`/v1/users/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-userservice_getuser) endpoint, passing the user account ID as a parameter. ```bash curl "https://api.redpanda.com/v1/users/ \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" ``` ### Create role binding To assign a role to an IAM user or service account, make a POST request to the [`/v1/role-bindings`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-rolebindingservice_createrolebinding) endpoint. Specify the role and scope, which includes the specific resource ID and an optional resource type, in the request body. ```bash curl -X POST "https://api.redpanda.com/v1/role-bindings" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "role_name": "", "account_id": "", "scope": { "resource_type": "SCOPE_RESOURCE_TYPE_CLUSTER", "resource_id": "" } }' ``` For ``, use one of roles listed in [Predefined roles](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac/#predefined-roles) (`Reader`, `Writer`, `Admin`). ### Create service account > 📝 **NOTE** > > Service accounts are assigned the Admin role for all resources in the organization. To create a new service account, make a POST request to the [`/v1/service-accounts`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-serviceaccountservice_createserviceaccount) endpoint, with a service account name and optional description in the request body. ```bash curl -X POST "https://api.redpanda.com/v1/service-accounts" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "service_account": { "name": "", "description": "" } }' ``` ## Next steps - [Use the Data Plane APIs](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-dataplane-api/) --- # Page 388: Use the Data Plane APIs **URL**: https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-dataplane-api.md --- # Use the Data Plane APIs The Redpanda Cloud API is a collection of REST APIs that allow you to interact with different parts of Redpanda Cloud. The Data Plane APIs enable you to programmatically manage the resources within your clusters, including topics, users, access control lists (ACLs), and connectors. You can call the API endpoints directly, or use tools like Terraform or Python scripts to automate resource management. See [Data Plane API](https://docs.redpanda.com/api/doc/cloud-dataplane/) for the full Data Plane API reference documentation. The [data plane](https://docs.redpanda.com/api/doc/cloud-dataplane/topic/topic-cloud-api-overview#topic-cloud-api-architecture) contains the actual Redpanda clusters. Every cluster is its own data plane, and so it has its own distinct [Data Plane API URL](https://docs.redpanda.com/api/doc/cloud-dataplane/topic/topic-cloud-api-overview#topic-data-plane-apis-url). ## Get Data Plane API URL ### BYOC or Dedicated To retrieve the Data Plane API URL of a cluster, make a request to the [`GET /v1/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_getcluster) endpoint of the Control Plane API. ### Serverless To retrieve the Data Plane API URL of a cluster, make a request to the [`GET /v1/serverless/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-serverlessclusterservice_getserverlesscluster) endpoint of the Control Plane API. The response includes a `dataplane_api.url` value: ```bash "id": "....", "name": "my-cluster", .... "dataplane_api": { "url": "https://api-xyz.abc.fmc.ppd.cloud.redpanda.com" }, ... ``` ## Data Plane APIs ### Create a user To create a new user in your Redpanda cluster, make a POST request to the [`/v1/users`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-userservice_createuser) endpoint, including the SASL mechanism, username, and password in the request body: ```bash curl -X POST "https:///v1/users" \ -H "Authorization: Bearer " \ -H "accept: application/json" \ -H "content-type: application/json" \ -d '{"mechanism":"SASL_MECHANISM_SCRAM_SHA_256","name":"payment-service","password":"secure-password"}' ``` > 💡 **TIP** > > When using a shell substitution variable for the token, use double quotes to wrap the header value. The success response returns the newly-created username and SASL mechanism: ``` { "user": { "name": "payment-service", "mechanism": "SASL_MECHANISM_SCRAM_SHA_256" } } ``` ### Create an ACL To create a new ACL in your Redpanda cluster, make a [`POST /v1/acls`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-aclservice_createacl) request. The following example ACL allows all operations on any Redpanda topic for a user with the name `payment-service`. ```bash curl -X POST "https:///v1/acls" \ -H "Authorization: Bearer " \ -H "accept: application/json" \ -H "content-type: application/json" \ -d '{"host":"*","operation":"OPERATION_ALL","permission_type":"PERMISSION_TYPE_ALLOW","principal":"User:payment-service","resource_name":"*","resource_pattern_type":"RESOURCE_PATTERN_TYPE_LITERAL","resource_type":"RESOURCE_TYPE_TOPIC"}' ``` The success response is empty, with a 201 status code. ``` {} ``` ### Create a topic To create a new Redpanda topic without specifying any further parameters, such as the desired topic-level configuration or partition count, make a POST request to [`/v1/topics`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-topicservice_createtopic) endpoint: ```bash curl -X POST "/v1/topics" \ -H "Authorization: Bearer " \ -H "accept: application/json" \ -H "content-type: application/json" \ -d '{"name":""}' ``` ### Manage secrets Secrets are stored externally in your cloud provider’s secret management service. Redpanda fetches the secrets when you reference them in cluster properties. #### Create a secret Make a request to [`POST /v1/secrets`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-secretservice_createsecret). You must use a Base64-encoded secret. ```bash curl -X POST "https:///v1/secrets" \ -H "accept: application/json" \ -H "authorization: Bearer " \ -H "content-type: application/json" \ -d '{"id":"","scopes":["SCOPE_REDPANDA_CLUSTER"],"secret_data":""}' ``` You must include the following values: - ``: The base URL for the Data Plane API. - ``: The API key you generated during authentication. - ``: The name of the secret you want to add. Use only the following characters: `^[A-Z][A-Z0-9_]*$`. - ``: The Base64-encoded secret. - This scope: `"SCOPE_REDPANDA_CLUSTER"`. The response returns the name and scope of the secret. You can then use the Control Plane API or `rpk` to [set a cluster property value](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/) to reference a secret, using the secret name. For the Control Plane API, you must use the following notation with the secret name in the request body to correctly reference the secret: ```bash "iceberg_rest_catalog_client_secret": "${secrets.}" ``` #### Update a secret Make a request to [`PUT /v1/secrets/{id}`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-secretservice_updatesecret). You can only update the secret value, not its name. You must use a Base64-encoded secret. ```bash curl -X PUT "https:///v1/secrets/" \ -H "accept: application/json" \ -H "authorization: Bearer " \ -H "content-type: application/json" \ -d '{"scopes":["SCOPE_REDPANDA_CLUSTER"],"secret_data":""}' ``` You must include the following values: - ``: The base URL for the Data Plane API. - ``: The name of the secret you want to update. The secret’s name is also its ID. - ``: The API key you generated during authentication. - This scope: `"SCOPE_REDPANDA_CLUSTER"`. - ``: Your new Base64-encoded secret. The response returns the name and scope of the secret. It might take several minutes for the new secret value to propagate to any cluster properties that reference it. #### Delete a secret Before you delete a secret, make sure that you remove references to it from your cluster configuration. Make a request to [`DELETE /v1/secrets/{id}`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-secretservice_deletesecret). ```bash curl -X DELETE "https:///v1/secrets/" \ -H "accept: application/json" \ -H "authorization: Bearer " \ ``` You must include the following values: - ``: The base URL for the Data Plane API. - ``: The name of the secret you want to delete. - ``: The API key you generated during authentication. ### Use Redpanda Connect Use the API to manage [Redpanda Connect pipelines](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/) in Redpanda Cloud. > 📝 **NOTE** > > The Pipeline APIs for Redpanda Connect are supported in BYOC and Serverless clusters only. #### Get Redpanda Connect pipeline To get details of a specific pipeline, make a [`GET /v1/redpanda-connect/pipelines/{id}`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-redpandaconnectservice_getpipeline) request. ```bash curl "https:///v1/redpanda-connect/pipelines/" ``` #### Stop a Redpanda Connect pipeline To stop a running pipeline, make a [`PUT /v1/redpanda-connect/pipelines/{id}/stop`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-redpandaconnectservice_stoppipeline) request. ```bash curl -X PUT "https:///v1/redpanda-connect/pipelines//stop" ``` #### Start a Redpanda Connect pipeline To start a previously stopped pipeline, make a [`PUT /v1/redpanda-connect/pipelines/{id}/start`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-redpandaconnectservice_startpipeline) request. ```bash curl -X PUT "https:///v1/redpanda-connect/pipelines//start" ``` #### Update a Redpanda Connect pipeline To update a pipeline, make a [`PUT /v1/redpanda-connect/pipelines/{id}`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-redpandaconnectservice_updatepipeline) request. You update a pipeline configuration to scale resources, for example the number of CPU cores and amount of memory allocated. ```bash curl -X PUT "https://api.redpanda.com/v1/redpanda-connect/pipelines/" \ -H 'accept: application/json'\ -H 'content-type: application/json' \ -d '{"resources":{"cpu_shares":"8","memory_shares":"8G"}}' ``` ### Manage Kafka Connect Use the API to configure your [Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/) clusters. > ❗ **IMPORTANT** > > - To enable this feature, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). To disable this feature, see [Disable Kafka Connect](https://docs.redpanda.com/cloud-data-platform/develop/managed-connectors/disable-kc/). > > - Redpanda Support does not manage or monitor Kafka Connect. For fully-supported connectors, consider [Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/). > > - When Kafka Connect is enabled, there is a dedicated node running even when no connectors are deployed. > 📝 **NOTE** > > Kafka Connect is supported in BYOC and Dedicated clusters only. #### Create a Kafka Connect cluster secret Kafka Connect cluster secret data must first be in JSON format, and then Base64-encoded. 1. Prepare the secret data in JSON format: ```none {"secret.access.key": ""} ``` 2. Encode the secret data in Base64: ```none echo '{"secret.access.key": ""}' | base64 ``` 3. Use the [Secrets API](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-kafkaconnectservice_createsecret) to create a secret that stores the Base64-encoded secret data: ```bash curl -X POST "https:///v1/kafka-connect/clusters/redpanda/secrets" \ -H 'accept: application/json'\ -H 'content-type: application/json' \ -d '{"name":"","secret_data":""}' ``` The response returns an `id` that you can use to [create the Kafka Connect connector](#create-a-kafka-connect-connector). #### Create a Kafka Connect connector To create a connector, make a POST request to [`/v1/kafka-connect/clusters/{cluster_name}/connectors`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-kafkaconnectservice_createconnector). The following example shows how to create an S3 sink connector with the name `my-connector`: ```bash curl -X POST "/v1/kafka-connect/clusters/redpanda/connectors" \ -H "Authorization: Bearer " \ -H "accept: application/json" \ -H "content-type: application/json" \ -d '{"config":{"connector.class":"com.redpanda.kafka.connect.s3.S3SinkConnector","topics":"test-topic","aws.secret.access.key":"${secretsManager::secret.access.key}","aws.s3.bucket.name":"bucket-name","aws.access.key.id":"access-key","aws.s3.bucket.check":"false","region":"us-east-1"},"name":"my-connector"}' ``` > ⚠️ **CAUTION** > > The field `aws.secret.access.key` in this example contains sensitive information that usually shouldn’t be added to a configuration directly. Redpanda recommends that you first create a secret and then use the secret ID to inject the secret in your Create Connector request. > > If you had created a secret following the example from the previous section [Create a Kafka Connect cluster secret](#create-a-kafka-connect-cluster-secret), use the `id` returned in the Create Secret response to replace the placeholder `` in this Create Connector example. The syntax `${secretsManager::secret.access.key}` tells the Kafka Connect cluster to load ``, specifying the key `secret.access.key` from the secret JSON. Example success response: ``` { "name": "my-connector", "config": { "aws.access.key.id": "access-key", "aws.s3.bucket.check": "false", "aws.s3.bucket.name": "bucket-name", "aws.secret.access.key": "secret-key", "connector.class": "com.redpanda.kafka.connect.s3.S3SinkConnector", "name": "my-connector", "region": "us-east-1", "topics": "test-topic" }, "tasks": [], "type": "sink" } ``` #### Restart a Kafka Connect connector To restart a connector, make a POST request to the [`/v1/kafka-connect/clusters/{cluster_name}/connectors/{name}/restart`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-kafkaconnectservice_restartconnector) endpoint: ```bash curl -X POST "/v1/kafka-connect/clusters/redpanda/connectors/my-connector/restart" \ -H "Authorization: Bearer " \ -H "accept: application/json"\ -H "content-type: application/json" \ -d '{"include_tasks":false,"only_failed":false}' ``` ## Limitations - Client SDKs are not available. --- # Page 389: Use the Control Plane API with Dedicated Cloud **URL**: https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-dedicated-controlplane-api.md --- # Use the Control Plane API with Dedicated Cloud The Redpanda Cloud API is a collection of REST APIs that allow you to interact with different parts of Redpanda Cloud. The Control Plane API enables you to programmatically manage your organization’s Redpanda infrastructure outside of the Cloud UI. You can call the API endpoints directly, or use tools like Terraform or Python scripts to automate cluster management. See [Control Plane API](https://docs.redpanda.com/api/doc/cloud-controlplane/) for the full API reference documentation. ## Control Plane API The Control Plane API is one central API that allows you to provision clusters, networks, and resource groups. The Control Plane API consists of the following endpoint groups: - [Clusters](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-clusters) - [Networks](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-networks) - [Operations](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-operations) - [Resource Groups](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-resource-groups) - [Control Plane Role Bindings](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-control-plane-role-bindings) - [Control Plane Users](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-control-plane-users) - [Control Plane Service Accounts](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-control-plane-service-accounts) ## Long-running operations Some endpoints do not directly return the resource itself, but instead return an operation. The following is an example response of [`POST /clusters`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_createcluster): ```bash { "operation": { "id": "cqfc6vdmvio001r4vu4", "metadata": { "@type": "type.googleapis.com/redpanda.api.controlplane.v1.CreateClusterMetadata", "cluster_id": "cqg168balf4e4pm8ptu" }, "state": "STATE_IN_PROGRESS", "started_at": "2024-07-23T20:31:29.948Z", "type": "TYPE_CREATE_CLUSTER", "resource_id": "cqg168balf4e4pm8ptu" } } ``` The response object represents the long-running operation of creating a cluster. Cluster creation is an example of an operation that can take a longer period of time to complete. ### Check operation state To check the progress of an operation, make a request to the [`GET /operations/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-operationservice_getoperation) endpoint using the operation ID as a parameter: ```bash curl -H "Authorization: Bearer " https://api.redpanda.com/v1/operations/ ``` > 💡 **TIP** > > When using a shell substitution variable for the token, use double quotes to wrap the header value. The response contains the current state of the operation: `IN_PROGRESS`, `COMPLETED`, or `FAILED`. ## Cluster tiers When you create a BYOC or Dedicated cluster, you select a usage tier. Each tier provides tested and guaranteed workload configurations for throughput, partitions (pre-replication), and connections. Availability depends on the region and the cluster type. See the full list of regions, zones, and tiers available with each provider in the [Control Plane API reference](https://docs.redpanda.com/api/doc/cloud-controlplane/topic/topic-regions-and-usage-tiers). ## Create a cluster To create a new cluster, first create a resource group and network, if you have not already done so. ### Create a resource group Create a resource group by making a POST request to the [`/v1/resource-groups`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-resourcegroupservice_createresourcegroup) endpoint. Pass a name for your resource group in the request body. ```bash curl -H 'Content-Type: application/json' \ -H "Authorization: Bearer " \ -d '{ "resource_group": { "name": "" } }' -X POST https://api.redpanda.com/v1/resource-groups ``` A resource group ID is returned. Pass this ID later when you call the Create Cluster endpoint. ### Create a network Create a network by making a request to [`POST /v1/networks`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-networkservice_createnetwork). Choose a [CIDR range](https://docs.redpanda.com/cloud-data-platform/networking/cidr-ranges/) that does not overlap with your existing VPCs or your Redpanda network. ```bash curl -d \ '{ "network": { "cidr_block": "10.0.0.0/20", "cloud_provider": "CLOUD_PROVIDER_GCP", "cluster_type": "TYPE_DEDICATED", "name": "", "resource_group_id": "", "region": "us-central1" } }' -H "Content-Type: application/json" \ -H "Authorization: Bearer " -X POST https://api.redpanda.com/v1/networks ``` This endpoint returns a [long-running operation](#lro). ### Create a new cluster After the network is created, make a request to the [`POST /v1/clusters`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_createcluster) with the resource group ID and network ID in the request body. ```bash curl -d \ '{ "cluster": { "cloud_provider": "CLOUD_PROVIDER_GCP", "connection_type": "CONNECTION_TYPE_PUBLIC", "name": "my-new-cluster", "resource_group_id": "", "network_id": "", "region": "us-central1", "throughput_tier": "", "type": "TYPE_DEDICATED", "zones": [ "us-central1-a", "us-central1-b", "us-central1-c" ], "cluster_configuration": { "custom_properties": { "audit_enabled":true } } } }' -H "Content-Type: application/json" \ -H "Authorization: Bearer " -X POST https://api.redpanda.com/v1/clusters ``` Replace `` with a usage tier that is valid for your region and cluster type. For example, `tier-1-gcp-v2-x86`. See the [Control Plane API reference](https://docs.redpanda.com/api/doc/cloud-controlplane/topic/topic-regions-and-usage-tiers) for the full list of regions, zones, and tiers. The Create Cluster endpoint returns a [long-running operation](#lro). When the operation completes, you can retrieve cluster details by calling [`GET /v1/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_getcluster), and passing the cluster ID as a parameter. ## Update cluster configuration To update your cluster configuration properties, make a request to the [`PATCH /v1/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster) endpoint, passing the cluster ID as a parameter. Include the properties to update in the request body. ```bash curl -H "Authorization: Bearer " \ -H 'accept: application/json'\ -H 'content-type: application/json' \ -d '{ "cluster_configuration": { "custom_properties": { "audit_enabled":true } } }' -X PATCH "https://api.cloud.redpanda.com/v1/clusters/" ``` The Update Cluster endpoint returns a [long-running operation](#lro). [Check the operation state](#check-operation-state) to verify that the update is complete. ## Delete a cluster To delete a cluster, make a request to the [`DELETE /v1/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_deletecluster) endpoint, passing the cluster ID as a parameter. This is a [long-running operation](#lro). ```bash curl -H "Authorization: Bearer " -X DELETE https://api.redpanda.com/v1/clusters/ ``` ## Manage RBAC You can also use the Control Plane API to manage [RBAC configurations](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac/). ### List role bindings To see role assignments for IAM user and service accounts, make a GET request to the [`/v1/role-bindings`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-rolebindingservice_listrolebindings) endpoint. ```bash curl https://api.redpanda.com/v1/role-bindings?filter.role_name=&filter.scope.resource_type=SCOPE_RESOURCE_TYPE_CLUSTER \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" ``` ### Get role binding To see roles assignments for a specific IAM account, make a GET request to the [`/v1/role-bindings/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-rolebindingservice_getrolebinding) endpoint, passing the role binding ID as a parameter. ```bash curl "https://api.redpanda.com/v1/role-bindings/ \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" ``` ### Get user To see details of an IAM user account, make a GET request to the [`/v1/users/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-userservice_getuser) endpoint, passing the user account ID as a parameter. ```bash curl "https://api.redpanda.com/v1/users/ \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" ``` ### Create role binding To assign a role to an IAM user or service account, make a POST request to the [`/v1/role-bindings`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-rolebindingservice_createrolebinding) endpoint. Specify the role and scope, which includes the specific resource ID and an optional resource type, in the request body. ```bash curl -X POST "https://api.redpanda.com/v1/role-bindings" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "role_name": "", "account_id": "", "scope": { "resource_type": "SCOPE_RESOURCE_TYPE_CLUSTER", "resource_id": "" } }' ``` For ``, use one of roles listed in [Predefined roles](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac/#predefined-roles) (`Reader`, `Writer`, `Admin`). ### Create service account > 📝 **NOTE** > > Service accounts are assigned the Admin role for all resources in the organization. To create a new service account, make a POST request to the [`/v1/service-accounts`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-serviceaccountservice_createserviceaccount) endpoint, with a service account name and optional description in the request body. ```bash curl -X POST "https://api.redpanda.com/v1/service-accounts" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "service_account": { "name": "", "description": "" } }' ``` ## Next steps - [Use the Data Plane APIs](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-dataplane-api/) --- # Page 390: Use the Control Plane API with Serverless **URL**: https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-serverless-controlplane-api.md --- # Use the Control Plane API with Serverless The Redpanda Cloud API is a collection of REST APIs that allow you to interact with different parts of Redpanda Cloud. The Control Plane API enables you to programmatically manage your organization’s Redpanda infrastructure outside of the Cloud UI. You can call the API endpoints directly, or use tools like Terraform or Python scripts to automate cluster management. See [Control Plane API](https://docs.redpanda.com/api/doc/cloud-controlplane/) for the full API reference documentation. ## Control Plane API The Control Plane API is one central API that allows you to provision clusters, networks, and resource groups. The Control Plane API consists of the following endpoint groups: - [Operations](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-operations) - [Resource Groups](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-resource-groups) - [Serverless Clusters](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-serverless-clusters) - [Serverless Regions](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-serverless-regions) - [Control Plane Role Bindings](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-control-plane-role-bindings) - [Control Plane Users](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-control-plane-users) - [Control Plane Service Accounts](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-control-plane-service-accounts) ## Create a cluster To create a new serverless cluster, you can use the default resource group, or create a new resource group if you like. You need to choose a region where your cluster is hosted. ### Create a resource group > 📝 **NOTE** > > This step is optional. Serverless includes a default resource group. To retrieve the default resource group ID, make a GET request to the [`/v1/resource-groups`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-resourcegroupservice_listresourcegroups) endpoint: > > ```bash > curl -H "Authorization: Bearer " https://api.redpanda.com/v1/resource-groups > ``` Create a resource group by making a POST request to the [`/v1/resource-groups`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-resourcegroupservice_createresourcegroup) endpoint. Pass a name for your resource group in the request body. ```bash curl -H 'Content-Type: application/json' \ -H "Authorization: Bearer " \ -d '{ "name": "" }' -X POST https://api.redpanda.com/v1/resource-groups ``` A resource group ID is returned. Pass this ID later when you call the Create Serverless Cluster endpoint. ### Choose a region To see the available regions for Redpanda Serverless, make a GET request to the [`/v1/serverless/regions`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-serverlessregionservice_listserverlessregions) endpoint. You can specify a cloud provider in your request. Serverless currently only supports AWS. ```bash curl -H "Authorization: Bearer " 'https://api.redpanda.com/v1/serverless/regions?cloud_provider=CLOUD_PROVIDER_AWS' ``` > 💡 **TIP** > > When using a shell substitution variable for the token, use double quotes to wrap the header value. ```json { "serverless_regions": [ { "name": "eu-central-1", "display_name": "eu-central-1", "default_timezone": { "id": "Europe/Berlin", "version": "" }, "cloud_provider": "CLOUD_PROVIDER_AWS", "available": true }, ... ], "next_page_token": "" } ``` You can also see a list of supported regions in [Serverless regions](https://docs.redpanda.com/cloud-data-platform/reference/tiers/serverless-regions/). ### Create a new serverless cluster Create a Serverless cluster by making a request to [`POST /v1/serverless/clusters`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-serverlessclusterservice_createserverlesscluster) with the resource group ID and serverless region name in the request body. ```bash curl -H 'Content-Type: application/json' \ -H "Authorization: Bearer " \ -d '{ "serverless_cluster": { "name": "", "resource_group_id": "", "serverless_region": "us-east-1" } }' -X POST https://api.redpanda.com/v1/serverless/clusters ``` The Create Serverless Cluster endpoint returns a [long-running operation](#lro-serverless). When the operation completes, you can retrieve cluster details by calling [`GET /v1/serverless/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-serverlessclusterservice_getserverlesscluster), and passing the cluster ID as a parameter. ## Update cluster configuration To update your cluster configuration properties, make a request to the [`PATCH /v1/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster) endpoint, passing the cluster ID as a parameter. Include the properties to update in the request body. ```bash curl -H "Authorization: Bearer " \ -H 'accept: application/json'\ -H 'content-type: application/json' \ -d '{ "cluster_configuration": { "custom_properties": { "audit_enabled":true } } }' -X PATCH "https://api.cloud.redpanda.com/v1/clusters/" ``` The Update Cluster endpoint returns a [long-running operation](#lro). [Check the operation state](#check-operation-state) to verify that the update is complete. ## Delete a cluster To delete a cluster, make a request to the [`DELETE /v1/serverless/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-serverlessclusterservice_getserverlesscluster) endpoint, passing the cluster ID as a parameter. This is a [long-running operation](#lro-serverless). ```bash curl -H "Authorization: Bearer " -X DELETE https://api.redpanda.com/v1/serverless/clusters/ ``` Optional: When the cluster is deleted, the delete operation’s state changes to `STATE_COMPLETED`. At this point, you may make a DELETE request to the [`/v1/resource-groups/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-resourcegroupservice_deleteresourcegroup) endpoint to delete the resource group. ## Long-running operations Some endpoints do not directly return the resource itself, but instead return an operation. The following is an example response of [`POST /serverless/clusters`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-serverlessclusterservice_createserverlesscluster): ```bash { "operation": { "id": "cqaramrndjr40k3qei50", "metadata": null, "state": "STATE_IN_PROGRESS", "started_at": { "seconds": "1721087323", "nanos": 888601218 }, "finished_at": null, "type": "TYPE_CREATE_SERVERLESS_CLUSTER" } } ``` The response object represents the long-running operation of creating a cluster. Cluster creation is an example of an operation that can take a longer period of time to complete. ### Check operation state To check the progress of an operation, make a request to the [`GET /operations/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-operationservice_getoperation) endpoint using the operation ID as a parameter: ```bash curl -H "Authorization: Bearer " https://api.redpanda.com/v1/operations/ ``` The response contains the current state of the operation: `IN_PROGRESS`, `COMPLETED`, or `FAILED`. ## Manage RBAC You can also use the Control Plane API to manage [RBAC configurations](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac/). ### List role bindings To see role assignments for IAM user and service accounts, make a GET request to the [`/v1/role-bindings`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-rolebindingservice_listrolebindings) endpoint. ```bash curl https://api.redpanda.com/v1/role-bindings?filter.role_name=&filter.scope.resource_type=SCOPE_RESOURCE_TYPE_CLUSTER \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" ``` ### Get role binding To see roles assignments for a specific IAM account, make a GET request to the [`/v1/role-bindings/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-rolebindingservice_getrolebinding) endpoint, passing the role binding ID as a parameter. ```bash curl "https://api.redpanda.com/v1/role-bindings/ \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" ``` ### Get user To see details of an IAM user account, make a GET request to the [`/v1/users/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-userservice_getuser) endpoint, passing the user account ID as a parameter. ```bash curl "https://api.redpanda.com/v1/users/ \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" ``` ### Create role binding To assign a role to an IAM user or service account, make a POST request to the [`/v1/role-bindings`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-rolebindingservice_createrolebinding) endpoint. Specify the role and scope, which includes the specific resource ID and an optional resource type, in the request body. ```bash curl -X POST "https://api.redpanda.com/v1/role-bindings" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "role_name": "", "account_id": "", "scope": { "resource_type": "SCOPE_RESOURCE_TYPE_CLUSTER", "resource_id": "" } }' ``` For ``, use one of roles listed in [Predefined roles](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac/#predefined-roles) (`Reader`, `Writer`, `Admin`). ### Create service account > 📝 **NOTE** > > Service accounts are assigned the Admin role for all resources in the organization. To create a new service account, make a POST request to the [`/v1/service-accounts`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-serviceaccountservice_createserviceaccount) endpoint, with a service account name and optional description in the request body. ```bash curl -X POST "https://api.redpanda.com/v1/service-accounts" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "service_account": { "name": "", "description": "" } }' ``` ## Next steps - [Use the Data Plane APIs](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-dataplane-api/) --- # Page 391: Use the Control Plane API **URL**: https://docs.redpanda.com/cloud-data-platform/manage/api/controlplane.md --- # Use the Control Plane API - [Use the Control Plane API with BYOC](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-byoc-controlplane-api/) Use the Control Plane API to manage resources in your Redpanda Cloud BYOC environment. - [Use the Control Plane API with Dedicated Cloud](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-dedicated-controlplane-api/) Use the Control Plane API to manage resources in your Redpanda Cloud Dedicated environment. - [Use the Control Plane API with Serverless](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-serverless-controlplane-api/) Use the Control Plane API to manage resources in your Redpanda Serverless environment. --- # Page 392: Audit Logging **URL**: https://docs.redpanda.com/cloud-data-platform/manage/audit-logging.md --- # Audit Logging > 📝 **NOTE** > > Audit logging is supported on BYOC and Dedicated clusters running Redpanda version 24.3 and later. To configure audit logging, see [Configure Cluster Properties](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/). Many scenarios for streaming data include the need for fine-grained auditing of user activity related to the system. This is especially true for regulated industries such as finance, healthcare, and the public sector. Complying with [PCI DSS v4](https://www.pcisecuritystandards.org/document_library/?document=pci_dss) standards, for example, requires verbose and detailed activity auditing, alerting, and analysis capabilities. Redpanda’s auditing capabilities support recording both administrative and operational interactions with topics and with users. Redpanda complies with the Open Cybersecurity Schema Framework (OCSF), providing a predictable and extensible solution that works seamlessly with industry standard tools. With audit logging enabled, there should be no noticeable changes in performance other than slightly elevated CPU usage. ## Audit log flow The Redpanda audit log mechanism functions similar to the Kafka flow. When a user interacts with another user or with a topic, Redpanda writes an event to a specialized audit topic. The audit topic is immutable. Only Redpanda can write to it. Users are prevented from writing to the audit topic directly and the Kafka API cannot create or delete it. ![Audit log flow](https://docs.redpanda.com/cloud-data-platform/shared/_images/audit-logging-flow.png) By default, any management and authentication actions performed on the cluster yield messages written to the audit log topic that are retained for seven days. Interactions with all topics by all principals are audited. Actions performed using the Kafka API and Admin API are all audited, as are actions performed directly through `rpk`. Messages recorded to the audit log topic comply with the [open cybersecurity schema framework](https://schema.ocsf.io/). Any number of analytics frameworks, such as Splunk or Sumo Logic, can receive and process these messages. Using an open standard ensures Redpanda’s audit logs coexist with those produced by other IT assets, powering holistic monitoring and analysis of your assets. ## Audit log configuration options Redpanda’s audit logging mechanism supports several options to control the volume and availability of audit records. Configuration is applied at the cluster level. To configure audit logging, see [Configure Cluster Properties](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/). - [`audit_enabled`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#audit_enabled): Boolean value to enable audit logging. When you set this to `true`, Redpanda checks for an existing topic named `_redpanda.audit_log`. If none is found, Redpanda automatically creates one for you. Default: `true`. - [`audit_enabled_event_types`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#audit_enabled_event_types): List of strings in JSON style identifying the event types to include in the audit log. This may include any of the following: `management, produce, consume, describe, heartbeat, authenticate, schema_registry, admin`. Default: `'["management","authenticate","admin"]'`. - [`audit_excluded_principals`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#audit_excluded_principals): List of strings in JSON style identifying the principals the audit logging system should ignore. Principals can be listed as `User:name` or `name`, both are accepted. Default: `null`. ## Enable audit logging Audit logging is enabled by default. Cluster administrators can configure the audited topics and principals. However, only the Redpanda team can configure the type of audited events. For more information or support, contact your Redpanda account team. ## Configure retention for audit logs You can export audit events to your SIEM for long-term retention to support audit and compliance needs. Redpanda Data recommends that you retain audit logs for at least one year in a separate system like your SIEM, so if there is an issue with the Redpanda cluster you have access to the audit logs. If you need to change the default seven-day retention period, update the retention settings using the `retention.ms` property for the `_redpanda.audit_log` topic: ```bash # Set 1-year retention (in milliseconds) on the audit log topic rpk topic alter-config _redpanda.audit_log --set retention.ms=31536000000 ``` > 📝 **NOTE** > > In Redpanda Cloud, both `retention.ms` (time-based) and `retention.bytes` (size-based) retention policies are applied simultaneously. Data becomes eligible for deletion when either limit is reached, depending on whichever occurs first. This means neither setting strictly takes precedence; the earliest limit (by time or size) triggers data cleanup. When updating audit log retention, check to make sure you do not already have a size-based retention policy that might remove logs before the period you specify. ## Next steps [See samples of audit log messages](https://docs.redpanda.com/cloud-data-platform/manage/audit-logging/audit-log-samples/) --- # Page 393: Sample Audit Log Messages **URL**: https://docs.redpanda.com/cloud-data-platform/manage/audit-logging/audit-log-samples.md --- # Sample Audit Log Messages Redpanda’s audit logs comply with version 1.0.0 of the [Open Cybersecurity Schema Framework (OCSF)](https://github.com/ocsf). This provides a predictable and extensible solution that works seamlessly with industry standard tools. This page aggregates several sample log files covering a range of scenarios. ## Standard OCSF messages Redpanda produces the following standard OCSF class messages: - Authentication (3002) for all authentication events - Application Lifecycle (6002) for when the audit system is enabled or disabled or when Redpanda starts or stops (if auditing is enabled when Redpanda starts or stops) - API Activity (6003) for any access to the Kafka API, Admin API, or Schema Registry Refer to the [OCSF Schema Definition](https://schema.ocsf.io/) for the field definitions for each event class. ## Authentication events These messages illustrate various scenarios around successful and unsuccessful authentication events. Authentication successful This scenario shows the message resulting from an admin using rpk with successful authentication. This is an authentication type event. ```json { "category_uid": 3, "class_uid": 3002, "metadata": { "product": { "name": "Redpanda", // This is the Node ID of the broker that produced this audit event "uid": "2", "vendor_name": "Redpanda Data, Inc.", "version": "v23.3.0-dev-2457-g76dc896f8c" }, "version": "1.0.0" }, "severity_id": 1, "time": 1700533469078, "type_uid": 300201, "activity_id": 1, "auth_protocol": "SASL-SCRAM", "auth_protocol_id": 99, // This is the IP address of the Kafka broker that received the authorization request "dst_endpoint": { "ip": "127.0.0.1", "port": 19092, // Name of the Redpanda kafka server "svc_name": "kafka rpc protocol" }, // Indicates that credentials were not encrypted using TLS "is_cleartext": true, "is_mfa": false, "service": { "name": "kafka rpc protocol" }, // This is the IP address of the client that generated the authorization request "src_endpoint": { "ip": "127.0.0.1", // This is the client ID of the kafka client "name": "rpk", "port": 42906 }, "status_id": 1, "user": { "name": "user", "type_id": 1 } } ``` Authentication successful (OIDC with group claims) This scenario shows a successful OIDC authentication event that includes the user’s IdP group memberships in the `user.groups` field. Group memberships are extracted from the OIDC token and included in all authentication events for OIDC users. ```json { "category_uid": 3, "class_uid": 3002, "metadata": { "product": { "name": "Redpanda", "uid": "0", "vendor_name": "Redpanda Data, Inc.", "version": "v26.1.1" }, "version": "1.0.0" }, "severity_id": 1, "time": 1700533469078, "type_uid": 300201, "activity_id": 1, "auth_protocol": "SASL-OAUTHBEARER", "auth_protocol_id": 99, "dst_endpoint": { "ip": "127.0.0.1", "port": 9092, "svc_name": "kafka rpc protocol" }, "is_cleartext": false, "is_mfa": false, "service": { "name": "kafka rpc protocol" }, "src_endpoint": { "ip": "10.0.1.50", "name": "kafka-client", "port": 48210 }, "status_id": 1, // IdP group memberships extracted from the OIDC token "user": { "name": "alice@example.com", "type_id": 1, "groups": [ {"type": "idp_group", "name": "engineering"}, {"type": "idp_group", "name": "analytics"} ] } } ``` Authentication failed This scenario illustrates a common failure where a user entered the wrong credentials. This is an authentication type event. ```json { "category_uid": 3, "class_uid": 3002, "metadata": { "product": { "name": "Redpanda", "uid": "1", "vendor_name": "Redpanda Data, Inc.", "version": "v23.3.0-dev-2457-g76dc896f8c" }, "version": "1.0.0" }, "severity_id": 1, "time": 1700534756350, "type_uid": 300201, "activity_id": 1, "auth_protocol": "SASL-SCRAM", "auth_protocol_id": 99, "dst_endpoint": { "ip": "127.0.0.1", "port": 19092, "svc_name": "kafka rpc protocol" }, "is_cleartext": true, "is_mfa": false, "service": { "name": "kafka rpc protocol" }, "src_endpoint": { "ip": "127.0.0.1", "name": "rpk", "port": 45236 }, "status_id": 2, "status_detail": "SASL authentication failed: security: Invalid credentials", "user": { "name": "admin", "type_id": 1 } } ``` ## Kafka API events The Redpanda Kafka API offers a wide array of options for interacting with your Redpanda clusters. Following are examples of messages from common interactions with the API. Create ACL entry This example illustrates an ACL update that also requires a superuser authentication. It lists the edited ACL and the updated permissions. This is a management type event. ```json { "category_uid": 6, "class_uid": 6003, "metadata": { "product": { "name": "Redpanda", "vendor_name": "Redpanda Data, Inc.", "version": "v23.3.0-dev-2457-g76dc896f8c" }, "profiles": [ "cloud" ], "version": "1.0.0" }, "severity_id": 1, "time": 1700533393776, "type_uid": 600303, "activity_id": 3, "actor": { "authorizations": [ { "decision": "authorized", // This shows a superuser level authorization "policy": { "desc": "superuser", "name": "aclAuthorization" } } ], "user": { "name": "admin", "type_id": 2 } }, "api": { // The API operation performed "operation": "create_acls", "service": { "name": "kafka rpc protocol" } }, "cloud": { "provider": "" }, "dst_endpoint": { "ip": "127.0.0.1", "port": 19092, "svc_name": "kafka rpc protocol" }, // List of resources accessed "resources": [ // The created ACL { "name": "create acl", "type": "acl_binding", "data": { "resource_type": "topic", "resource_name": "*", "pattern_type": "literal", "acl_principal": "{type user name user}", "acl_host": "{{any_host}}", "acl_operation": "all", "acl_permission": "allow" } }, // Below indicates that the user had cluster level authorization { "name": "kafka-cluster", "type": "cluster" } ], "src_endpoint": { "ip": "127.0.0.1", "name": "rpk", "port": 50276 }, "status_id": 1, "unmapped": { // Provides a more parsable output of how the // authorization decision was made "authorization_metadata": { "acl_authorization": { "host": "", "op": "", "permission_type": "AUTHORIZED", "principal": "" }, "resource": { "name": "", "pattern": "", "type": "" } } } } ``` Authorization matched on a group ACL This example shows an API Activity (6003) where the authorization decision matched an ALLOW ACL on a `Group:` principal. The `actor.user.groups` field includes the matched group with type `idp_group`, and the `authorization_metadata` shows the group ACL that granted access. See [Group-Based Access Control](https://docs.redpanda.com/cloud-data-platform/security/authorization/gbac/). ```json { "category_uid": 6, "class_uid": 6003, "metadata": { "product": { "name": "Redpanda", "uid": "0", "vendor_name": "Redpanda Data, Inc.", "version": "v26.1.0" }, "version": "1.0.0" }, "severity_id": 1, "time": 1774544504327, "type_uid": 600303, "activity_id": 3, "actor": { "authorizations": [ { "decision": "authorized", "policy": { "desc": "acl: {principal type {group} name {/sales} host {{any_host}} op all perm allow}, resource: type {topic} name {sales-topic} pattern {literal}", "name": "aclAuthorization" } } ], // The matched group appears in the user's groups field "user": { "name": "alice", "type_id": 1, "groups": [ { "type": "idp_group", "name": "/sales" } ] } }, "api": { "operation": "produce", "service": { "name": "kafka rpc protocol" } }, "dst_endpoint": { "ip": "127.0.1.1", "port": 9092, "svc_name": "kafka rpc protocol" }, "resources": [ { "name": "sales-topic", "type": "topic" } ], "src_endpoint": { "ip": "127.0.0.1", "name": "rdkafka", "port": 42728 }, "status_id": 1, "unmapped": { "authorization_metadata": { "acl_authorization": { "host": "{{any_host}}", "op": "all", "permission_type": "allow", "principal": "type {group} name {/sales}" }, "resource": { "name": "sales-topic", "pattern": "literal", "type": "topic" } } } } ``` Metadata request (with counts) This shows a message for a scenario where a user requests a set of metadata using rpk. It provides detailed information on the type of request and the information sent to the user. This is a describe type event. ```json { "category_uid": 6, "class_uid": 6003, // If present, indicates that >1 of the same authz check was performed // within the period of the audit log collecting entries // This provides start and end time (the time period these events were // observed) "count": 2, "end_time": 1700533480725, "metadata": { "product": { "name": "Redpanda", "uid": "0", "vendor_name": "Redpanda Data, Inc.", "version": "v23.3.0-dev-2457-g76dc896f8c" }, "profiles": [ "cloud" ], "version": "1.0.0" }, "severity_id": 1, "start_time": 1700533480724, "time": 1700533480724, "type_uid": 600303, "activity_id": 3, "actor": { "authorizations": [ { "decision": "authorized", // Represents a policy for a non-super user "policy": { "desc": "acl: {principal {type user name user} host {{any_host}} op all perm allow}, resource: type {topic} name {*} pattern {literal}", "name": "aclAuthorization" } } ], "user": { "name": "user", "type_id": 1 } }, "api": { "operation": "metadata", "service": { "name": "kafka rpc protocol" } }, "cloud": { "provider": "" }, "dst_endpoint": { "ip": "127.0.0.1", "port": 19092, "svc_name": "kafka rpc protocol" }, "resources": [ // The topics accessed { "name": "test", "type": "topic" } ], "src_endpoint": { "ip": "127.0.0.1", "name": "rpk", "port": 53602 }, "status_id": 1, "unmapped": { "authorization_metadata": { "acl_authorization": { "host": "{{any_host}}", "op": "all", "permission_type": "allow", "principal": "{type user name user}" }, "resource": { "name": "*", "pattern": "literal", "type": "topic" } } } } ``` --- # Page 394: Cluster Maintenance **URL**: https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance.md --- # Cluster Maintenance - [Cluster State](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/cluster-state/) Learn about the current status of a cluster. - [Upgrades and Maintenance](https://docs.redpanda.com/cloud-data-platform/manage/maintenance/) Learn how Redpanda Cloud manages maintenance operations. - [Scale a BYOC Cluster](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/scale-cluster/) Scale a BYOC cluster up or down by changing its broker count or machine type to match your workload. - [Configure Cluster Properties](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/) Learn how to configure cluster properties to enable and manage features. - [Audit Logging](https://docs.redpanda.com/cloud-data-platform/manage/audit-logging/) Learn how to use Redpanda's audit logging capabilities. - [About Client Throughput Quotas](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/about-throughput-quotas/) Understand how Redpanda's user-based and client ID-based throughput quotas work, including entity hierarchy, precedence rules, and quota tracking behavior. - [Manage Throughput](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/manage-throughput/) Configure broker-wide and client-specific throughput quotas to prevent resource exhaustion and noisy-neighbor issues. - [Fetch Read Coalescing](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/fetch-read-coalescing/) Reduce redundant read CPU and fetch-response memory under high consumer fan-out by sharing one read result across concurrent fetches of the same data. - [Configure Client Connections](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/configure-client-connections/) Learn about guidelines for configuring client connections in Redpanda clusters for optimal availability. --- # Page 395: About Client Throughput Quotas **URL**: https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/about-throughput-quotas.md --- # About Client Throughput Quotas Redpanda uses throughput quotas to limit the rate of produce and consume requests from clients. Understanding how quotas work helps you prevent individual clients from disproportionately consuming resources and causing performance degradation for other clients (also known as the "noisy-neighbor" problem), and ensure fair resource sharing across users and applications. After reading this page, you will be able to: - Describe the difference between user-based and client ID-based quotas - Determine which quota type to use for your use case - Explain quota precedence rules and how Redpanda tracks quota usage To configure and manage throughput quotas, see [Manage Throughput](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/manage-throughput/). ## Throughput control overview Redpanda provides two ways to control throughput: - Broker-wide limits: Configured using cluster properties. For details, see [Broker-wide throughput limits](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/manage-throughput/#broker-wide-throughput-limits). - Client throughput quotas: Configured using the Kafka API. Client quotas enable per-user and per-client rate limiting with fine-grained control through entity hierarchy and precedence rules. This page focuses on client quotas. ## Supported quota types Redpanda supports three Kafka API-based quota types: | Quota type | Description | | --- | --- | | `producer_byte_rate` | Limit throughput of produce requests (bytes per second) | | `consumer_byte_rate` | Limit throughput of fetch requests (bytes per second) | | `controller_mutation_rate` | Limit rate of topic mutation requests (partitions created or deleted per second) | All quota types can be applied to groups of client connections based on user principals, client IDs, or combinations of both. ## Quota entities Redpanda uses two pieces of identifying information from each client connection to determine which quota applies: - Client ID: An ID that clients self-declare. Quotas can target an exact client ID (`client-id`) or a prefix (`client-id-prefix`). Multiple client connections that share a client ID or ID prefix are grouped into a single quota entity. - User [principal](https://docs.redpanda.com/home/glossary/#principal): An authenticated identity verified through SASL, mTLS, or OIDC. Connections that share the same user are considered one entity. You can configure quotas that target either entity type, or combine both for fine-grained control. ### Client ID-based quotas Client ID-based quotas apply to clients identified by their `client-id` field, which is set by the client application. The client ID is typically a configurable property when you create a client with Kafka libraries. When using client ID-based quotas, multiple clients using the same client ID share the same quota tracking. Client ID-based quotas rely on clients honestly reporting their identity and correctly setting the `client-id` property. This makes client ID-based quotas unsuitable for guaranteeing isolation between tenants. Use client ID-based quotas when: - Authentication is not enabled. - Grouping by application or service name is sufficient. - You operate a single-tenant environment where all clients are trusted. - You need simple rate limiting without user-level isolation. ### User-based quotas > ❗ **IMPORTANT** > > User-based quotas require [authentication](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/) to be enabled on your cluster. User-based quotas apply to authenticated user principals. Each user has a separate quota, providing a way to limit the impact of individual users on the cluster. User-based quotas rely on Redpanda’s authentication system to verify user identity. The user principal is extracted from SASL credentials, mTLS certificates, or OIDC tokens and cannot be forged by clients. Use user-based quotas when: - You operate a multi-tenant environment, such as SaaS platforms or enterprises with departments. - You require isolation between users or tenants, to avoid noisy-neighbor issues. - You need per-user billing or metering. ### Combined user and client quotas You can combine user and client identities for fine-grained control over specific (user, client) combinations. Use combined quotas when: - You need fine-grained control, for example: user `alice` using a specific application. - Different rate limits apply to different apps used by the same user. For example, `alice`'s `payment-processor` gets 10 MB/s, but `alice`'s `analytics-consumer` gets 50 MB/s. See [Quota precedence and tracking](#quota-precedence-and-tracking) for examples. ## Quota precedence and tracking When a request arrives, Redpanda resolves which quota to apply by matching the request’s authenticated user principal and client ID against configured quotas. Redpanda applies the most specific match, using the precedence order in the following table (highest priority first). The precedence level that matches also determines how quota usage is tracked. Redpanda tracks quota usage using a tracker key that determines which connections share the same quota bucket. How connections are grouped into buckets depends on the type of entity the quota targets. To get independent quota tracking per user and client ID combination, configure quotas that include both dimensions, such as `/config/users//clients/` or `/config/users//clients/`. | Level | Match type | Config path | Tracker key | Isolation behavior | | --- | --- | --- | --- | --- | | 1 | Exact user + exact client | `/config/users//clients/` | `(user, client-id)` | Each unique (user, client-id) pair tracked independently | | 2 | Exact user + client prefix | `/config/users//client-id-prefix/` | `(user, client-id-prefix)` | Clients matching the prefix share tracking within that user | | 3 | Exact user + default client | `/config/users//clients/` | `(user, client-id)` | Each unique (user, client-id) pair tracked independently | | 4 | Exact user only | `/config/users/` | `user` | All clients for that user share a single tracking bucket | | 5 | Default user + exact client | `/config/users//clients/` | `(user, client-id)` | Each unique (user, client-id) pair tracked independently | | 6 | Default user + client prefix | `/config/users//client-id-prefix/` | `(user, client-id-prefix)` | Clients matching the prefix share tracking within each user | | 7 | Default user + default client | `/config/users//clients/` | `(user, client-id)` | Each unique (user, client-id) pair tracked independently | | 8 | Default user only | `/config/users/` | `user` | All clients for each user share a single tracking bucket (per user) | | 9 | Exact client only | `/config/clients/` | `client-id` | All users with that client ID share a single tracking bucket | | 10 | Client prefix only | `/config/client-id-prefix/` | `client-id-prefix` | All clients matching the prefix share a single bucket across all users | | 11 | Default client only | `/config/clients/` | `client-id` | Each unique client ID tracked independently | | 12 | No quota configured | N/A | N/A | No tracking / unlimited throughput | > ❗ **IMPORTANT** > > The `` entity matches any user or client that doesn’t have a more specific quota configured. This is different from an empty/unauthenticated user (`user=""`), or undeclared client ID (`client-id=""`), which are treated as specific entities. ### Unauthenticated connections Unauthenticated connections have an empty user principal (`user=""`) and are not treated as `user=`. Unauthenticated connections: - Fall back to client-only quotas. - Have unlimited throughput only if no client-only quota matches. ### Example: Precedence resolution Given these configured quotas: ```bash rpk cluster quotas alter --add consumer_byte_rate=5000000 --name user=alice --name client-id=app-1 rpk cluster quotas alter --add consumer_byte_rate=10000000 --name user=alice rpk cluster quotas alter --add consumer_byte_rate=20000000 --name client-id=app-1 ``` | User + Client ID | Precedence match | | --- | --- | | `user=alice`, `client-id=app-1` | Level 1: Exact user + exact client | | `user=alice`, `client-id=app-2` | Level 4: Exact user only | | `user=bob`, `client-id=app-1` | Level 9: Exact client only | | `user=bob`, `client-id=app-2` | Level 12: No quota configured | When no quota matches (level 12), the connection is not throttled. ### Example: User-only quota If you configure a 10 MB/s produce quota for user `alice`: ```bash rpk cluster quotas alter --add producer_byte_rate=10000000 --name user=alice ``` Then `alice` connecting with client ID `app-1` and `alice` connecting with client ID `app-2` share the same 10 MB/s produce limit. To give each of `alice`'s clients an independent 10 MB/s limit, configure: ```bash rpk cluster quotas alter --add producer_byte_rate=10000000 --name user=alice --default client-id ``` ### Example: User default quota If you configure a default 10 MB/s produce quota for all users: ```bash rpk cluster quotas alter --add producer_byte_rate=10000000 --default user ``` This quota applies to all users who don’t have a more specific quota configured. Each user is tracked independently: `alice` gets her own 10 MB/s bucket, `bob` gets his own 10 MB/s bucket, and so on. Within each user, all client ID values share that user’s bucket. `alice` connecting with client ID `app-1` and `alice` connecting with client ID `app-2` share the same 10 MB/s produce limit, while `bob`'s connections have a separate 10 MB/s limit. ## Throughput throttling enforcement > 📝 **NOTE** > > As of v24.2, Redpanda enforces all throughput limits per broker, including client throughput. Redpanda enforces throughput limits by applying backpressure to clients. When a connection exceeds its throughput limit, Redpanda throttles the connection to bring the rate back within the allowed level: 1. Redpanda adds a `throttle_time_ms` field to responses, indicating how long the client should wait. 2. If the client doesn’t honor the throttle time, Redpanda inserts delays on the connection’s next read operation. In Redpanda Cloud, the throttling delay is set to 30 seconds. ### Why observed throughput can exceed a quota Redpanda applies a quota between requests, not within a request. It serves each request in full, adds the bytes it transferred to the client’s quota usage, and only then delays the client’s next request. A single request or response can therefore transfer more bytes than the quota allows for that interval, so the throughput you observe can run well above the configured `producer_byte_rate` or `consumer_byte_rate` value. For fetch requests, Redpanda counts the bytes when it sends the response. If a client has other fetch requests in flight, Redpanda can serve them before the earlier response counts against the quota. These factors determine how far above the limit the observed throughput can run: - The size of a single request or response. For fetch requests, the client’s `fetch.max.bytes` and `max.partition.fetch.bytes` settings bound how many bytes one response can transfer before Redpanda reapplies the quota. Lower these values to reduce the overshoot of a consumer quota. These settings are not hard limits: if the first record batch is larger than the limit, Redpanda still returns it so that the consumer can make progress. - The number of connections that share the quota. Connections in the same quota bucket share its usage, and each connection can have requests in progress at the same time. Their transfers add up before the shared usage delays any of them. - The maximum throttling delay. If returning a client to its configured rate requires a longer delay than the maximum, Redpanda applies the maximum delay instead, and the client resumes sending requests sooner than the quota alone implies. A quota set far below the throughput a client reaches in a single request is more likely to reach this limit. Overshoot from these mechanics does not mean the quota is not being enforced. To confirm that Redpanda is throttling a client, see [Monitor client throughput](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/manage-throughput/#monitor-client-throughput). ## Default behavior Quotas are opt-in restrictions and not enforced by default. When no quotas are configured, clients have unlimited throughput. ## Next steps - [Configure throughput quotas](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/manage-throughput/) - [Enable authentication for user-based quotas](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/) --- # Page 396: Cluster State **URL**: https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/cluster-state.md --- # Cluster State The cluster state shows the current status of a cluster. Redpanda Cloud updates the state automatically, allowing you to monitor a cluster’s health and availability. ## Serverless | State | Description | | --- | --- | | **Creating** | Cluster is in the process of having its control plane state created. | | **Placing** | Cluster is in the process of being placed on a cell with sufficient resources in the data plane. | | **Ready** | Cluster is running and accepting external requests. | | **Deleting** | Cluster is in the process of having its control plane state removed. Resources dedicated to the cluster in the data plane are released. | | **Failed** | Cluster is unable to enter the **Ready** state from either the **Creating** or **Placing** states.
Try re-creating the cluster. | | **Suspended** | Cluster is running but blocks all external requests.
This can happen when credits run out. Enter a credit card to return to the **Ready** state. | ## BYOC/Dedicated | State | Description | | --- | --- | | **Creating agent** | Cluster is in the process of having its control plane state created, and the Redpanda Cloud agent is being deployed. | | **Creating** | Cluster is in the process of having its control plane state created. | | **Ready** | Cluster is running and accepting external requests. | | **Deleting** | Cluster is in the process of having its control plane state removed. Resources dedicated to the cluster in the data plane are released. | | **Deleting agent** | Cluster is in the process of having its control plane state and Redpanda Cloud agent removed. | | **Upgrading** | Cluster is undergoing a rolling upgrade or a scaling operation. | | **Failed** | Cluster is unable to enter the **Ready** state from either the **Creating** or the **Creating agent** states.
Try re-creating the cluster. | | **Suspended** | Cluster is running but blocks all external requests.
This can happen when credits run out. Enter a credit card to return to the **Ready** state. | --- # Page 397: Configure Cluster Properties **URL**: https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster.md --- # Configure Cluster Properties Cluster configuration properties are set to their default values and are automatically replicated across all brokers. You can use cluster properties to enable and manage features such as [Iceberg topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/about-iceberg-topics/), [data transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/), and [audit logging](https://docs.redpanda.com/cloud-data-platform/manage/audit-logging/). For a complete list of the cluster properties available in Redpanda Cloud, see [Cluster Configuration Properties](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/) and [Object Storage Properties](https://docs.redpanda.com/cloud-data-platform/reference/properties/object-storage-properties/). > 📝 **NOTE** > > Some properties are read-only and cannot be changed. For example, `cluster_id` is a read-only property that is automatically set when the cluster is created. ## Prerequisites - **`rpk` version 25.1.2+**: To check your current version, see [Install or Update rpk](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/). - **Redpanda version 25.1.2+**: You can find the version on your cluster’s Overview page in the Redpanda Cloud UI. To verify that you’re logged into the Redpanda control plane and have the correct `rpk` profile configured for your target cluster, run `rpk cloud login` and select your cluster. ## Limitations Cluster properties are supported on BYOC and Dedicated clusters running on AWS, GCP, and Azure. They are not available on Serverless clusters. Only the cluster properties listed in [Cluster Configuration Properties](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/) and [Object Storage Properties](https://docs.redpanda.com/cloud-data-platform/reference/properties/object-storage-properties/) are configurable in Redpanda Cloud. Setting an unsupported property through the Cloud API or the [Redpanda Terraform provider](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/) returns a `REASON_INVALID_INPUT` error indicating that the property is not allowed. To control the maximum message size, see [Configure the maximum message size](#max-message-size). ## Set cluster configuration properties You can set cluster configuration properties using the `rpk` command-line tool or the Cloud API. ### rpk Use `rpk cluster config` to set cluster properties. For example, to enable audit logging, set [`audit_enabled`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#audit_enabled) to `true`: ```bash rpk cluster config set audit_enabled true ``` To set a cluster property with a secret, you must use the following notation: ```bash rpk cluster config set iceberg_rest_catalog_client_secret '${secrets.}' ``` > 📝 **NOTE** > > Some properties require a rolling restart, and it can take several minutes for the update to complete. The `rpk cluster config set` command returns the operation ID. ### Cloud API Use the Cloud API to set cluster properties: - Create a cluster by making a [`POST /v1/clusters`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_createcluster) request. Edit `cluster_configuration` in the request body with a key-value pair for `custom_properties`. - Update a cluster by making a [`PATCH /v1/clusters/{cluster.id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster) request, passing the cluster ID as a parameter. Include the properties to update in the request body. `custom_properties` is a JSON object. Send integer and number property values as JSON strings, such as `"86400000"`, to avoid precision loss. For example, to set [`audit_enabled`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#audit_enabled) to `true`: ```bash # Store your cluster ID in a variable. export RP_CLUSTER_ID= # Retrieve a Redpanda Cloud access token. export RP_CLOUD_TOKEN=`curl -X POST "https://auth.prd.cloud.redpanda.com/oauth/token" \ -H "content-type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials" \ -d "client_id=" \ -d "client_secret="` # Update your cluster configuration to enable audit logging. curl -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" -X PATCH \ "https://api.cloud.redpanda.com/v1/clusters/${RP_CLUSTER_ID}" \ -H 'accept: application/json'\ -H 'content-type: application/json' \ -d '{"cluster_configuration":{"custom_properties": {"audit_enabled":true}}}' ``` The [`PATCH /clusters/{cluster.id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster) request returns the ID of a long-running operation. You can check the status of the operation by polling the [`GET /operations/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-operationservice_getoperation) endpoint. To set a cluster property with a secret, you must use the following notation with the secret name: ```bash curl -H "Authorization: Bearer " -X PATCH \ "https://api.cloud.redpanda.com/v1/clusters/" \ -H 'accept: application/json'\ -H 'content-type: application/json' \ -d '{"cluster_configuration": { "custom_properties": { "iceberg_rest_catalog_client_secret": "${secrets.}" } } }' ``` > 📝 **NOTE** > > Some properties require a rolling restart for the update to take effect. This triggers a [long-running operation](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-byoc-controlplane-api/#lro) that can take several minutes to complete. ## Set default topic properties You can set cluster-wide defaults that apply to new topics. To override a default for a single topic, set the corresponding topic property instead. See [Topic Configuration Properties](https://docs.redpanda.com/cloud-data-platform/reference/properties/topic-properties/). | Property | Description | | --- | --- | | [`default_topic_partitions`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#default_topic_partitions) | Default number of partitions for new topics. | | [`log_retention_ms`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#log_retention_ms) | Default length of time to retain topic data before it becomes eligible for deletion. This sets the default topic retention period, which applies when a topic doesn’t set its own `retention.ms`. | | [`retention_bytes`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#retention_bytes) | Default maximum size per partition before the oldest data becomes eligible for deletion. Applies when a topic doesn’t set its own `retention.bytes`. | Set these properties using `rpk` or the Cloud API. For example, to set the default topic retention period to 24 hours: ### rpk ```bash rpk cluster config set log_retention_ms 86400000 ``` ### Cloud API ```bash # Store your cluster ID in a variable. export RP_CLUSTER_ID= # Retrieve a Redpanda Cloud access token. export RP_CLOUD_TOKEN=`curl -X POST "https://auth.prd.cloud.redpanda.com/oauth/token" \ -H "content-type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials" \ -d "client_id=" \ -d "client_secret="` # Set the default topic retention period to 24 hours. curl -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" -X PATCH \ "https://api.cloud.redpanda.com/v1/clusters/${RP_CLUSTER_ID}" \ -H 'accept: application/json'\ -H 'content-type: application/json' \ -d '{"cluster_configuration":{"custom_properties": {"log_retention_ms":"86400000"}}}' ``` ## Configure the maximum message size To control the maximum message size in Redpanda Cloud, set the `max.message.bytes` property on each topic. The default is 20 MiB for BYOC and Dedicated clusters and 8 MiB for Serverless clusters. You can increase it up to 32 MiB for BYOC and Dedicated clusters and 20 MiB for Serverless clusters. To set this property, see [Topics Overview](https://docs.redpanda.com/cloud-data-platform/develop/topics/create-topic/). The cluster property `kafka_batch_max_bytes` cannot be set through the Cloud API or the [Redpanda Terraform provider](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/). Attempting to set it returns `REASON_INVALID_INPUT` with the message `The properties [kafka_batch_max_bytes] are not allowed`. ## View cluster property values You can see the value of a cluster configuration property using `rpk` or the Cloud API. ### rpk Use `rpk cluster config get` to view the current cluster property value. For example, to view the current value of [`audit_enabled`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#audit_enabled), run: ```bash rpk cluster config get audit_enabled ``` ### Cloud API Use the Cloud API to get the current configuration property values for a cluster. Make a [`GET /clusters/{cluster.id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_getcluster) request, passing the cluster ID as a parameter. The response body contains the current `computed_properties` values. For example, to get the current value of [`audit_enabled`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#audit_enabled): ```bash # Store your cluster ID in a variable. export RP_CLUSTER_ID= # Retrieve a Redpanda Cloud access token. export RP_CLOUD_TOKEN=`curl -X POST "https://auth.prd.cloud.redpanda.com/oauth/token" \ -H "content-type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials" \ -d "client_id=" \ -d "client_secret="` # Get your cluster configuration property values. curl -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" -X GET \ "https://api.cloud.redpanda.com/v1/clusters/${RP_CLUSTER_ID}" \ -H 'accept: application/json'\ -H 'content-type: application/json' \ ``` ## Suggested reading - [Introduction to rpk](https://docs.redpanda.com/cloud-data-platform/manage/rpk/intro-to-rpk/) - [Redpanda Cloud API Overview](https://docs.redpanda.com/api/doc/cloud-controlplane/topic/topic-cloud-api-overview) - [Redpanda Cloud API Quickstart](https://docs.redpanda.com/api/doc/cloud-controlplane/topic/topic-quickstart) --- # Page 398: Configure Client Connections **URL**: https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/configure-client-connections.md --- # Configure Client Connections Optimize the availability of your clusters by configuring and tuning properties. > 💡 **TIP** > > Before you configure connection limits or reconnection settings, start by gathering detailed data about your client connections. > > - Use the [`redpanda_rpc_active_connections` metric](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_rpc_active_connections) to view current Kafka client connections. > > - For clusters on v25.3 and later, use [`rpk cluster connections list`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cluster/rpk-cluster-connections-list/) or the `GET /v1/monitoring/kafka/connections` endpoint in the Data Plane API to identify: > > - Which clients and applications are connected > > - Long-lived connections and long-running requests > > - Connections with no activity > > - Whether any clients are causing excessive load > > > By reviewing connection details, you can make informed decisions about tuning connection limits and troubleshooting issues. > > > See also: [Data Plane API reference](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-monitoringservice_listkafkaconnections), [Monitor Redpanda Cloud](https://docs.redpanda.com/cloud-data-platform/manage/monitor-cloud/#throughput) ## Limit client connections To mitigate the risk of a client creating too many connections and using too many system resources, you can configure a Redpanda cluster to impose limits on the number of client connections that can be created. The following Redpanda cluster properties limit the number of connections: - [`kafka_connections_max_per_ip`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#kafka_connections_max_per_ip): Similar to Kafka’s `max.connections.per.ip`, this sets the maximum number of connections accepted per IP address by a broker. - [`kafka_connections_max_overrides`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#kafka_connections_max_overrides): A list of IP addresses for which `kafka_connections_max_per_ip` is overridden and doesn’t apply. > 📝 **NOTE** > > - These connection limit properties are disabled by default. You must manually enable them. > > - The total number of connections is not equal to the number of clients, because a client can open multiple connections. As a conservative estimate, for a cluster with N brokers, plan for N + 2 connections per client. ### Configure connection count limit by client IP Configure the `kafka_connections_max_per_ip` property to limit the number of connections from each client IP address. > ❗ **IMPORTANT** > > Per-IP connection controls require Redpanda to see individual client IPs. If clients connect through private link endpoints, NAT gateways, or other shared-IP egress, the per-IP limit applies to the shared IP, affecting all clients behind it and preventing isolation of a single offending client. Similarly, multiple clients running on the same host will share the same IP address, and the limit applies collectively to all those clients. See also: [Configure Cluster Properties](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/) #### Configure the limit To configure `kafka_connections_max_per_ip` safely without disrupting legitimate clients, follow these steps: 1. Set up your monitoring stack for your cluster. See [Monitor Redpanda Cloud](https://docs.redpanda.com/cloud-data-platform/manage/monitor-cloud/). 2. Monitor current connection patterns using the `redpanda_rpc_active_connections` metric with the `redpanda_server="kafka"` filter: ```none redpanda_rpc_active_connections{redpanda_id="CLOUD_CLUSTER_ID", redpanda_server="kafka"} ``` 3. Analyze the connection data to identify the normal range of connections for each broker during typical traffic cycles. For example, in the following Grafana screenshot, the normal range is around 200-300 connections: ![Range of active connections over time](https://docs.redpanda.com/cloud-data-platform/shared/_images/monitor_connections.png) 4. Set the `kafka_connections_max_per_ip` value based on your analysis. Use the upper bound of normal connections observed, or use a lower value if you know how many connections per client IP are being opened. 5. Continue monitoring the connection metrics after applying the limit to ensure that legitimate clients are not affected and that the problematic client is properly controlled. > 📝 **NOTE** > > If you find a high load of unexpected connections from multiple IP addresses, `kafka_connections_max_per_ip` alone may be insufficient. If offending IPs outnumber legitimate client IPs, you may need to set `kafka_connections_max_per_ip` so low that it affects legitimate clients. If this is the case, use `kafka_connections_max_overrides` to exempt known legitimate client IPs from the connection limit. #### Limitations - Decreasing the limit does not terminate any currently open Kafka API connections. - This limit does not apply to Kafka HTTP Proxy connections. - Clients behind NAT gateways or private links share the same IP address as seen by Redpanda brokers. - The limit may negatively affect tail latencies across all client connections. - All clients behind the shared IP are collectively subject to the single `kafka_connections_max_per_ip` limit. - Connection rejections occur randomly among clients when the limit is reached. For example, suppose `kafka_connections_max_per_ip` is set to 100, but clients behind a NAT gateway collectively need 150 connections. When the limit is reached, clients can make only some of the connections while others get rejected, leaving the client in a not-working state. - Redpanda may modify this property during internal operations. - Availability incidents caused by misconfiguring this feature are excluded from the Redpanda Cloud SLA. ## Configure client reconnections You can configure the Kafka client backoff and retry properties to change the default behavior of the clients to suit your failure requirements. Set the following Kafka client properties on your application’s producer or consumer to manage client reconnections: - `reconnect.backoff.ms`: Amount of time to wait before attempting to reconnect to the broker. The default is 50 milliseconds. - `reconnect.backoff.max.ms`: Maximum amount of time in milliseconds to wait when reconnecting to a broker. The backoff increases exponentially for each consecutive connection failure, up to this maximum. The default is 1000 milliseconds (1 second). Additionally, you can use Kafka properties to control message retry behavior. Delivery fails when either the delivery timeout or the number of retries is met. - `delivery.timeout.ms`: Amount of time for message delivery, so messages are not retried forever. The default is 120000 milliseconds (2 minutes). - `retries`: Number of times a producer can retry sending a message before marking it as failed. The default value is 2147483647 for Kafka >= 2.1, or 0 for Kafka <= 2.0. - `retry.backoff.ms`: Amount of time to wait before attempting to retry a failed request to a given topic partition. The default is 100 milliseconds. ## See also - [Configure Producers](https://docs.redpanda.com/cloud-data-platform/develop/produce-data/configure-producers/) - [Manage Throughput](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/manage-throughput/) --- # Page 399: Fetch Read Coalescing **URL**: https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/fetch-read-coalescing.md --- # Fetch Read Coalescing When many consumers fetch the same partition at the same offset concurrently (high read fan-out), the broker does redundant work: each fetch performs its own log read, its own serialization, and allocates its own copy of the response bytes. With a fan-out of N consumers, that is roughly N times the read CPU and N times the fetch-response memory for byte-identical output. Fetch read coalescing removes that redundancy. The broker reads and serializes each unique read once, and shares the single result with every concurrent (and eligible back-to-back) consumer of the same data: one read, one serialization, one buffer, fanned out to all requesters. When all N consumers fetch the same partition at the same offset with the same fetch settings, read CPU and fetch-response memory drop from roughly N times to one. Fetch read coalescing is available on BYOC and Dedicated clusters. Fetch read coalescing is disabled by default, and the cluster property that controls it is managed by Redpanda. See [Enable fetch read coalescing](#enable-fetch-read-coalescing). It benefits workloads where many consumers tail the same partitions with the same fetch settings, for example fan-out delivery of one stream to many downstream applications. Request it only for high fan-out workloads: at low fan-out (for example, one or two consumers per partition), the de-duplication logic saves little to nothing and its overhead can increase reactor utilization. ## How fetch read coalescing works Redpanda coalesces fetch reads only when they request the same data in the same way: the same partition and offset, with the same isolation level and fetch size (`max_bytes`). When matching reads arrive concurrently, or back-to-back while a previous result is still in use, the broker performs the read once and shares the single result with every requester. Reads that differ in any of these properties run independently. If a shared read fails, all coalesced fetches receive the error. Coalesced consumers share one response buffer instead of each holding its own copy, which is where the memory savings come from. A completed result is retained only while at least one fetch still references it, so the coalescer never pins memory on its own. Coalescing is scoped per shard: it collapses only the fan-out that lands on the same shard. It composes with [follower fetching](https://docs.redpanda.com/cloud-data-platform/develop/consume-data/follower-fetching/) rather than replacing it: follower fetching spreads consumers across replicas to distribute the read load, and coalescing removes the redundancy within each shard. ## Limitations Before requesting fetch read coalescing, familiarize yourself with the following limitations: - **Only identical reads coalesce.** Consumers reading the same data but with a different `max_bytes`, a different offset, or a different isolation level do not share a read. The benefit scales with how closely the concurrent fetches match: the ideal case is many consumers tailing the same partition at the same offset with the same fetch sizing. - **Obligatory and strict reads are grouped apart.** Redpanda distinguishes reads that must return at least one batch regardless of the byte limit (obligatory) from reads that strictly honor `max_bytes` (strict), and neither serves the other. A single partition and offset fetched both ways at the same time incurs one duplicate read by design. - **Retention is best-effort.** Completed results are only reusable by later readers while a fetch still references them. The coalescer never keeps a result alive on its own. The reliable savings are on genuinely concurrent readers of the same data, and back-to-back reuse is opportunistic. - **Per-shard scope.** Coalescing collapses only the fan-out that lands on the same shard. Where consumers are spread across replicas and shards, for example with follower fetching, each shard coalesces the fan-out local to it. - **De-duplication adds per-read overhead.** The de-duplication logic runs on every fetch read, whether or not reads coalesce. At low fan-out (for example, one or two consumers per partition), this overhead can increase reactor utilization while saving little to nothing, so only enable coalescing for high fan-out workloads. ## Enable fetch read coalescing The `kafka_fetch_read_coalescing_enabled` cluster property that controls coalescing is not user-tunable in Redpanda Cloud. To enable coalescing on a BYOC or Dedicated cluster, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). Enabling or disabling coalescing is a runtime change: no cluster restart is required, and the coalescing cache (about 0.5 MB per shard) is allocated only while the feature is enabled. ## Suggested reading - [Follower Fetching](https://docs.redpanda.com/cloud-data-platform/develop/consume-data/follower-fetching/) - [Monitor Redpanda Cloud](https://docs.redpanda.com/cloud-data-platform/manage/monitor-cloud/) --- # Page 400: Manage Throughput **URL**: https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/manage-throughput.md --- # Manage Throughput Redpanda throttles throughput on ingress and egress independently, and you can configure limits at the broker and client levels. This prevents clients from causing unbounded network and disk usage on brokers. You can configure limits at two levels: - Broker limits: These apply to all clients connected to the broker and restrict total traffic on the broker. See [Broker-wide throughput limits](#broker-wide-throughput-limits). - Client limits: These apply to authenticated users or clients defined by their client ID. You can manage client quotas with [`rpk cluster quotas`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cluster/rpk-cluster-quotas/), with the Redpanda Cloud UI, with the [Redpanda Cloud Data Plane API](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-quotaservice_listquotas), or with the Kafka API. When no quotas apply, the client has unlimited throughput. > 📝 **NOTE** > > Throughput throttling is supported in BYOC and Dedicated clusters. It is not supported in Serverless clusters. After reading this page, you will be able to: - Set user-based throughput quotas - Set client ID-based quotas - Monitor quota usage and throttling behavior ## View connected client details Before configuring throughput quotas, check the [current produce and consume throughput](https://docs.redpanda.com/cloud-data-platform/manage/monitor-cloud/#throughput) of a client. Use the [`rpk cluster connections list`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cluster/rpk-cluster-connections-list/) command or the [`GET /v1/monitoring/kafka/connections`](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-monitoringservice_listkafkaconnections) Data Plane API endpoint to view detailed information about active Kafka client connections. For example, to view a cluster’s connected clients in order of highest current produce throughput, run: ### rpk ```bash rpk cluster connections list --order-by="recent_request_statistics.produce_bytes desc" ``` ```bash UID STATE USER CLIENT-ID IP:PORT NODE SHARD OPEN-TIME IDLE PROD-TPUT/SEC FETCH-TPUT/SEC REQS/MIN b20601a3-624c-4a8c-ab88-717643f01d56 OPEN UNAUTHENTICATED perf-producer-client 127.0.0.1:55012 0 0 9s 0s 78.9MB 0B 292 36338ca5-86b7-4478-ad23-32d49cfaef61 OPEN UNAUTHENTICATED rpk 127.0.0.1:49722 0 0 13s 13.694243104s 0B 0B 1 7e277ef6-0176-4007-b100-6581bfde570f OPEN UNAUTHENTICATED rpk 127.0.0.1:49736 0 0 13s 10.093957335s 0B 0B 2 567d9918-d3dc-4c74-ab5d-85f70cd3ee35 OPEN UNAUTHENTICATED rpk 127.0.0.1:49748 0 0 13s 0.591413542s 0B 0B 5 08616f21-08f9-46e7-8f06-964bd8240d9b OPEN UNAUTHENTICATED rpk 127.0.0.1:49764 0 0 13s 10.094602845s 0B 0B 2 e4d5b57e-5c76-4975-ada8-17a88d68a62d OPEN UNAUTHENTICATED rpk 127.0.0.1:54992 0 0 10s 0.302090085s 0B 14.5MB 27 b41584f3-2662-4185-a4b8-0d8510f5c780 OPEN UNAUTHENTICATED perf-producer-client 127.0.0.1:55002 0 0 8s 7.743592270s 0B 0B 1 62fde947-411d-4ea8-9461-3becc2631b46 CLOSED UNAUTHENTICATED rpk 127.0.0.1:48578 0 0 26s 0.000737836s 0B 0B 1 95387e2e-2ec4-4040-aa5e-4257a3efa1a2 CLOSED UNAUTHENTICATED rpk 127.0.0.1:48564 0 0 26s 0.208180826s 0B 0B 1 ``` ### Data Plane API ```bash curl \ --request GET 'https:///v1/monitoring/kafka/connections' \ --header "Authorization: Bearer $ACCESS_TOKEN" \ --data '{ "filter": "", "order_by": "recent_request_statistics.produce_bytes desc" }' ``` Show example API response ```json { "connections": [ { "node_id": 0, "shard_id": 0, "uid": "b20601a3-624c-4a8c-ab88-717643f01d56", "state": "KAFKA_CONNECTION_STATE_OPEN", "open_time": "2025-10-15T14:15:15.755065000Z", "close_time": "1970-01-01T00:00:00.000000000Z", "authentication_info": { "state": "AUTHENTICATION_STATE_UNAUTHENTICATED", "mechanism": "AUTHENTICATION_MECHANISM_UNSPECIFIED", "user_principal": "" }, "listener_name": "", "tls_info": { "enabled": false }, "source": { "ip_address": "127.0.0.1", "port": 55012 }, "client_id": "perf-producer-client", "client_software_name": "apache-kafka-java", "client_software_version": "3.9.0", "transactional_id": "my-tx-id", "group_id": "", "group_instance_id": "", "group_member_id": "", "api_versions": { "18": 4, "22": 3, "3": 12, "24": 3, "0": 7 }, "idle_duration": "0s", "in_flight_requests": { "sampled_in_flight_requests": [ { "api_key": 0, "in_flight_duration": "0.000406892s" } ], "has_more_requests": false }, "total_request_statistics": { "produce_bytes": "78927173", "fetch_bytes": "0", "request_count": "4853", "produce_batch_count": "4849" }, "recent_request_statistics": { "produce_bytes": "78927173", "fetch_bytes": "0", "request_count": "4853", "produce_batch_count": "4849" } }, ... ], "total_size": "9" } ``` To view connections for a specific client, you can use a filter expression: ### rpk ```bash rpk cluster connections list --client-id="perf-producer-client" ``` ```bash UID STATE USER CLIENT-ID IP:PORT NODE SHARD OPEN-TIME IDLE PROD-TPUT/SEC FETCH-TPUT/SEC REQS/MIN b41584f3-2662-4185-a4b8-0d8510f5c780 OPEN UNAUTHENTICATED perf-producer-client 127.0.0.1:55002 0 0 8s 7.743592270s 0B 0B 1 b20601a3-624c-4a8c-ab88-717643f01d56 OPEN UNAUTHENTICATED perf-producer-client 127.0.0.1:55012 0 0 9s 0s 78.9MB 0B 292 ``` The `USER` field in the connection list shows the authenticated principal. Unauthenticated connections show `UNAUTHENTICATED`, which corresponds to an empty user principal (`user=""`) in quota configurations, not `user=`. ### Data Plane API ```bash curl \ --request GET 'https:///v1/monitoring/kafka/connections' \ --header "Authorization: Bearer $ACCESS_TOKEN" \ --data '{ "filter": "client_id = \"perf-producer-client\"" }' ``` Show example API response ```json { "connections": [ { "node_id": 0, "shard_id": 0, "uid": "b41584f3-2662-4185-a4b8-0d8510f5c780", "state": "KAFKA_CONNECTION_STATE_OPEN", "open_time": "2025-10-15T14:15:15.219538000Z", "close_time": "1970-01-01T00:00:00.000000000Z", "authentication_info": { "state": "AUTHENTICATION_STATE_UNAUTHENTICATED", "mechanism": "AUTHENTICATION_MECHANISM_UNSPECIFIED", "user_principal": "" }, "listener_name": "", "tls_info": { "enabled": false }, "source": { "ip_address": "127.0.0.1", "port": 55002 }, "client_id": "perf-producer-client", "client_software_name": "apache-kafka-java", "client_software_version": "3.9.0", "transactional_id": "", "group_id": "", "group_instance_id": "", "group_member_id": "", "api_versions": { "18": 4, "3": 12, "10": 4 }, "idle_duration": "7.743592270s", "in_flight_requests": { "sampled_in_flight_requests": [], "has_more_requests": false }, "total_request_statistics": { "produce_bytes": "0", "fetch_bytes": "0", "request_count": "3", "produce_batch_count": "0" }, "recent_request_statistics": { "produce_bytes": "0", "fetch_bytes": "0", "request_count": "3", "produce_batch_count": "0" } }, ... ], "total_size": "2" } ``` The user principal field in the connection list shows the authenticated principal. Unauthenticated connections show `AUTHENTICATION_STATE_UNAUTHENTICATED`, which corresponds to an empty user principal (`user=""`) in quota configurations, not `user=`. To view connections for a specific authenticated user: ```bash rpk cluster connections list --user alice ``` This shows all connections from user `alice`, useful for monitoring clients that are subject to user-based quotas. ## Broker-wide throughput limits Broker-wide throughput limits account for all Kafka API traffic going into or out of the broker, as data is produced to or consumed from a topic. The limit values represent the allowed rate of data in bytes per second passing through in each direction. Redpanda also provides administrators the ability to exclude clients from throughput throttling and to fine-tune which Kafka request types are subject to throttling limits. ## Client throughput limits Redpanda provides configurable throughput quotas for individual clients or authenticated users. Quotas are managed through the Kafka-compatible AlterClientQuotas and DescribeClientQuotas APIs, accessible with `rpk`, Redpanda Console, or Kafka client libraries. Redpanda supports two types of client throughput quotas: - Client ID-based quotas: Limit throughput based on the self-declared `client-id` field. - User-based quotas: Limit throughput based on authenticated user [principal](https://docs.redpanda.com/home/glossary/#principal). Requires [authentication](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/). You can also combine both types for fine-grained control (for example, limiting a specific user when using a specific client application). For conceptual information about quota types, entity hierarchy, precedence rules, and how Redpanda tracks and enforces quotas through throttling, see [About Client Throughput Quotas](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/about-throughput-quotas/). ### Set user-based quotas > ❗ **IMPORTANT** > > User-based quotas require authentication to be enabled. To set up authentication, see [Authentication](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/). #### Quota for a specific user To limit throughput for a specific authenticated user across all clients: ```bash rpk cluster quotas alter --add producer_byte_rate=2000000 --name user=alice ``` This limits user `alice` to 2 MB/s for produce requests regardless of the client ID used. To view quotas for a user: ```bash rpk cluster quotas describe --name user=alice ``` Expected output: ```bash user=alice producer_byte_rate=2000000 ``` #### Default quota for all users To set a fallback quota for any user without a more specific quota: ```bash rpk cluster quotas alter --add consumer_byte_rate=5000000 --default user ``` This applies a 5 MB/s fetch quota to all authenticated users who don’t have a more specific quota configured. ### Remove a user quota To remove a quota for a specific user: ```bash rpk cluster quotas alter --delete consumer_byte_rate --name user=alice ``` To remove all quotas for a user: ```bash rpk cluster quotas delete --name user=alice ``` ### Set client ID-based quotas Client ID-based quotas apply to all users using a specific client ID. These quotas do not require authentication. Because the client ID is self-declared, client ID-based quotas are not suitable for guaranteeing isolation between tenants. For multi-tenant environments, Redpanda recommends user-based quotas for per-tenant isolation. #### Individual client ID throughput limit > 📝 **NOTE** > > The following sections show how to manage throughput with `rpk`. You can also manage throughput with the [Redpanda Cloud Data Plane API](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-quotaservice_listquotas). To view current throughput quotas set through the Kafka API, run [`rpk cluster quotas describe`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cluster/rpk-cluster-quotas-describe/). For example, to see the quotas for client ID `consumer-1`: ```bash rpk cluster quotas describe --name client-id=consumer-1 ``` ```bash client-id=consumer-1 producer_byte_rate=140000 ``` To set a throughput quota for a single client, use the [`rpk cluster quotas alter`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cluster/rpk-cluster-quotas-alter/) command. ```bash rpk cluster quotas alter --add consumer_byte_rate=200000 --name client-id=consumer-1 ``` ```bash ENTITY STATUS client-id=consumer-1 OK ``` #### Group of clients throughput limit Alternatively, you can view or configure throughput quotas for a group of clients based on a match on client ID prefix. The following example sets the `consumer_byte_rate` quota to client IDs prefixed with `consumer-`: ```bash rpk cluster quotas alter --add consumer_byte_rate=200000 --name client-id-prefix=consumer- ``` > 📝 **NOTE** > > A `client-id-prefix` quota group is not related to Kafka consumer groups. The client ID is an application-defined identifier sent with every request. Client libraries typically default to their own name (such as `kgo`, `rdkafka`, `sarama`, or `perf-producer-client`), but applications can set it using the [`client.id`](https://kafka.apache.org/documentation/#consumerconfigs_client.id) configuration property. This makes prefix-based quotas useful for grouping related applications (for example, `inventory-service-` to match `inventory-service-1`, `inventory-service-2`, etc.). #### Default client throughput limit You can apply default throughput limits to clients. Redpanda applies the default limits if no quotas are configured for a specific client ID or prefix. To specify a produce quota of 1 GB/s through the Kafka API (applies across all produce requests to a single broker), run: ```bash rpk cluster quotas alter --default client-id --add producer_byte_rate=1000000000 ``` ### Set combined user and client quotas You can set quotas for specific (user, client ID) combinations for fine-grained control. #### User with specific client To limit a specific user when using a specific client: ```bash rpk cluster quotas alter --add consumer_byte_rate=1000000 --name user=alice --name client-id=consumer-1 ``` User `alice` using `client-id=consumer-1` is limited to a 1 MB/s fetch rate. The same user with a different client ID would use a different quota (or fall back to less specific matches). To view combined quotas: ```bash rpk cluster quotas describe --name user=alice --name client-id=consumer-1 ``` #### User with client prefix To set a shared quota for a user across multiple clients matching a prefix: ```bash rpk cluster quotas alter --add producer_byte_rate=3000000 --name user=bob --name client-id-prefix=app- ``` All clients used by user `bob` with a client ID starting with `app-` share a combined 3 MB/s produce quota. #### Default user with specific client To set a quota for a specific client across all users: ```bash rpk cluster quotas alter --add producer_byte_rate=500000 --default user --name client-id=payment-processor ``` Any user using `client-id=payment-processor` is limited to a 500 KB/s produce rate, unless they have a more specific quota configured. ### Bulk manage client throughput limits To more easily manage multiple quotas, you can use the `cluster quotas describe` and [`cluster quotas import`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cluster/rpk-cluster-quotas-import/) commands to do a bulk export and update. For example, to export all client quotas in JSON format: ```bash rpk cluster quotas describe --format json ``` `rpk cluster quotas import` accepts the output string from `rpk cluster quotas describe --format `: ```bash rpk cluster quotas import --from '{"quotas":[{"entity":[{"name":"analytics-consumer","type":"client-id"}],"values":[{"key":"consumer_byte_rate","values":"10000000"}]},{"entity":[{"name":"analytics-","type":"client-id-prefix"}],"values":[{"key":"producer_byte_rate","values":"10000000"},{"key":"consumer_byte_rate","values":"5000000"}]}]}' ``` You can also save the JSON or YAML output to a file and pass the file path in the `--from` flag. ### View throughput limits in Redpanda Cloud You can also use Redpanda Cloud to view enforced limits. In the side menu, go to **Quotas**. ### Monitor client throughput The following metrics provide insights into client throughput quota usage: - Client quota throughput per rule and quota type: - `/public_metrics` - [`redpanda_kafka_quotas_client_quota_throughput`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_kafka_quotas_client_quota_throughput) - Client quota throttling delay per rule and quota type, in seconds: - `/public_metrics` - [`redpanda_kafka_quotas_client_quota_throttle_time`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_kafka_quotas_client_quota_throttle_time) To identify which clients are actively connected and generating traffic, see [View connected client details](#view-connected-client-details). Quota metrics use the `redpanda_quota_rule` label to identify which quota was applied to a request. The label distinguishes between different entity types (user, client, or combinations). See the label values in [`redpanda_kafka_quotas_client_quota_throughput`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_kafka_quotas_client_quota_throughput). #### Track quota use per entity When a workload slows down because a client hits its throughput quota, the aggregate quota metrics can confirm that throttling is happening at a broker level, but they cannot reveal which user, client, or group of clients is utilizing a quota or being throttled. Per-entity quota metrics answer these questions. Redpanda labels each throttle-time and throughput series with the identity of the throttled entity, so you can measure how much of an enforced quota each entity actually uses. Use these metrics to identify throttled users and clients by name and right-size quota values based on observed usage. Per-entity quota metrics are disabled by default because each throttled entity adds metric series. To enable them, set the `kafka_per_entity_quota_metrics` cluster property. See [Configure Cluster Properties](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/). The change takes effect without a broker restart. When enabled, Redpanda exposes two additional counters: - Total per-entity quota throttling delay, in milliseconds: - `/public_metrics` - `redpanda_kafka_quotas_client_quota_throttle_time_ms_by_entity` - Per-entity quota throughput (bytes for produce and fetch quotas, partition mutations for partition mutation quotas): - `/public_metrics` - `redpanda_kafka_quotas_client_quota_throughput_by_entity` Each series is labeled with the entity identity and the quota type: - `redpanda_quota_type`: Always present. One of `produce_quota`, `fetch_quota`, or `partition_mutation_quota`. - `redpanda_quota_user`: The user principal, for user-based quotas. - `redpanda_quota_client_id`: The client ID, for client ID-based quotas. - `redpanda_quota_group_name`: The client ID prefix, for quotas that apply to a [group of clients](#group-of-clients-throughput-limit). Combined quotas, such as a user with a specific client ID, include each matching label on the same series. To keep metric cardinality bounded, Redpanda registers a per-entity series only while an entity is actively being throttled, and removes the series after the entity has been idle. An entity appears in these metrics only after it has been throttled at least once. From that point, Redpanda records the entity’s throughput on every request, not only on throttled requests, so a Prometheus `rate()` query reflects the entity’s actual throughput. To measure how much of its quota an entity is using, divide the entity’s throughput rate by its configured limit. Quota limits apply per broker, so aggregate by broker as well as by entity to keep the results comparable with the configured limits. For example, the following query returns the produce throughput rate for each throttled client ID on each broker: ```promql sum by (redpanda_quota_client_id, pod) ( rate(redpanda_kafka_quotas_client_quota_throughput_by_entity{redpanda_quota_type="produce_quota"}[5m]) ) ``` Compare the result with the entity’s configured limit from [`rpk cluster quotas describe`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-cluster/rpk-cluster-quotas-describe/). A ratio close to 1 means the client is saturating its quota and its requests are being delayed. A ratio above 1 does not mean the quota is not being enforced. Because Redpanda applies quotas between requests, observed throughput can exceed the configured limit. For the mechanics, see [Why observed throughput can exceed a quota](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/about-throughput-quotas/#why-observed-throughput-can-exceed-a-quota). ## See also - [About Client Throughput Quotas](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/about-throughput-quotas/) - [Configure Client Connections](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/configure-client-connections/) - [Authentication](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/) --- # Page 401: Scale a BYOC Cluster **URL**: https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/scale-cluster.md --- # Scale a BYOC Cluster Scale a BYOC cluster up or down as your workload changes, without contacting Redpanda Support. You can add or remove [brokers](https://docs.redpanda.com/home/glossary/#broker) to absorb short-term changes in traffic, or move the cluster to a different machine type to right-size it for a sustained change in throughput. Self-service scaling is available for BYOC clusters in organizations on usage-based billing. After reading this page, you will be able to: - Choose between horizontal and vertical scaling for a workload change - Scale a cluster up or down from the Redpanda Cloud UI or the Control Plane API - Explain what happens to your cluster and clients during a scaling operation ## Choose a scaling method You can scale a cluster in two ways. The Cloud UI tells you which one applies before you save. | Method | When to use it | What changes | Typical duration | | --- | --- | --- | --- | | Horizontal scaling (scale out or in) | Changes in traffic within a day, such as business-hours peaks or nightly batch jobs. | Adds or removes brokers of the current machine type. | About 20 minutes to scale out. Scaling in takes longer, typically about an hour, because brokers must decommission. | | Vertical scaling (scale up or down) | Changes in throughput that last days or longer, such as steady growth, onboarding a new workload, or a weekday versus weekend pattern. | Replaces the brokers with a larger or smaller machine type. Redpanda provisions brokers of the new machine type and replaces the existing brokers one at a time. | About 10 minutes per broker, counting the brokers in the new configuration: around an hour for a small cluster, up to about five hours for the largest. | These durations are estimates. Large or busy clusters, and clusters with a lot of local data not yet offloaded to Tiered Storage, take longer. The Cloud UI shows an estimate for your specific change before you save. In the Cloud UI, describe your workload and Redpanda recommends a machine type and broker count. In the Control Plane API and Terraform, you select the machine type through the cluster’s [usage tier](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/) (`throughput_tier`) and the broker count through `redpanda_node_count`. See [Size and Price a BYOC Cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/size-byoc-cluster/) for how workload sizing works. ## Before you scale - The cluster must be in the **Ready** state. You cannot start a scaling operation while another operation is running, and you cannot make other changes to the cluster, such as enabling a feature or editing cluster configuration, until scaling completes. - A cluster has at least 3 brokers and at most 24. The upper bound depends on the machine type. Multi-AZ clusters scale in steps of 3 brokers so that each availability zone keeps the same number of brokers. - You can move to any machine type in the same cloud provider, machine family, and CPU architecture as your current one. In the API, for example, a cluster on `tier-2-aws-v3-arm` can move directly to `tier-5-aws-v3-arm`. To move to a different machine family or CPU architecture, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). - Redpanda runs preflight checks before it accepts a scaling request. For a change that reduces capacity, the checks reject the request if the cluster has firing alerts, if the remaining brokers would not have enough storage or partition capacity for the current data, if a topic’s replication factor would exceed the new broker count, or if recent throughput or CPU usage is too high for the smaller configuration. The request fails immediately with a message that names the check, so you can fix the condition and try again. - On GCP, make sure your project has enough Local SSD quota for the larger broker count or machine type before you scale out or up. See [Create a BYOC Cluster on GCP](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/gcp/create-byoc-cluster-gcp/). - Check the [Load Factor dashboard](https://docs.redpanda.com/cloud-data-platform/manage/monitor-load-factor/) to confirm which resource is constrained and whether load is spread evenly across brokers. If one broker or partition is much hotter than the rest, scaling may not relieve it. On GCP and Azure, the dashboard has no disk IOPS or network data, so use your cloud provider’s monitoring tools to check those resources. ## Scale a cluster in the Cloud UI 1. Log in to [Redpanda Cloud](https://cloud.redpanda.com) and open your cluster. 2. Click **Settings**. 3. In the **Cluster** card, find **Scale cluster** and click **Edit**. The **Performance configuration** panel opens and shows your current machine type, broker count, and RPU. The **Edit** button is available only while the cluster is in the **Ready** state. 4. Under **Size your workload**, describe the workload you want the cluster to handle: - On the **Standard** tab, enter the **Number of Partitions**, **Ingress**, and **Egress**. Optionally, expand **Additional options** to set a **Latency target**, **Producer count**, and **Consumer count**. - On the **Advanced** tab, enter an **RPU Rate** if you already know the capacity you need. 5. Under **Recommended configuration**, review the machine type and broker count that Redpanda recommends and its calculated RPU. To use a different configuration, select one of the alternatives. 6. Review **Estimated costs** and the **Comparison** table, which shows the current and target usage tier, machine type, RPU, node count, and maximum ingress, egress, partitions, and connections. A **Replaced** badge on the machine type means that every broker is replaced. 7. Read the change summary above **Save changes**. It states whether the change is horizontal or vertical scaling and gives an estimated duration. If only the tier’s limits change, with the same machine type and broker count, the summary labels the change **Tier change** instead. 8. Click **Save changes**. Scaling starts immediately. While the operation runs, the cluster state shows **Upgrading** on the Clusters page and on the cluster overview, and returns to **Ready** when scaling completes. See [Cluster State](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/cluster-state/). ## Scale a cluster with the Control Plane API To scale a cluster programmatically, send a [`PATCH /v1/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster) request that sets `redpanda_node_count`, `throughput_tier`, or both, and name the fields you are changing in `update_mask`. Scaling starts as soon as the request is accepted. To change the broker count within the current tier (horizontal scaling): ```bash curl -X PATCH "https://api.redpanda.com/v1/clusters/?update_mask=redpanda_node_count" \ -H "Authorization: Bearer $AUTH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "redpanda_node_count": 6 }' ``` To change the tier and machine type (vertical scaling): ```bash curl -X PATCH "https://api.redpanda.com/v1/clusters/?update_mask=throughput_tier" \ -H "Authorization: Bearer $AUTH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "throughput_tier": "tier-3-aws-v3-arm" }' ``` A request that changes only `throughput_tier` keeps the cluster’s current broker count. If that count exceeds the maximum for the target tier, Redpanda rejects the request with `node count too high for current throughput tier`. To move to a smaller tier in that case, set `redpanda_node_count` in the same request. To change both in one request, set both fields. Redpanda validates the broker count against the target tier: ```bash curl -X PATCH "https://api.redpanda.com/v1/clusters/?update_mask=throughput_tier,redpanda_node_count" \ -H "Authorization: Bearer $AUTH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "throughput_tier": "tier-3-aws-v3-arm", "redpanda_node_count": 9 }' ``` The request returns HTTP 202 with a long-running operation of type `TYPE_UPDATE_CLUSTER`. Poll [`GET /v1/operations/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-operationservice_getoperation) until it completes. While scaling runs, [`GET /v1/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_getcluster) reports `STATE_UPGRADING` and already returns the new tier and broker count. The state returns to `STATE_READY` when scaling completes. ### Errors Redpanda rejects a scaling request synchronously when it cannot be fulfilled, so the response tells you what to fix. Common responses: | Status | Message | Cause and action | | --- | --- | --- | | 403 (`PERMISSION_DENIED`) | `User-defined node count changes are only available for organizations with usage-based billing. Please contact support.` | Your organization is not on usage-based billing. Contact your Redpanda account team. | | 400 (`INVALID_ARGUMENT`) | `Cluster with id cannot be updated at this time` | Another operation is running. Wait for the cluster to return to **Ready**. | | 400 (`INVALID_ARGUMENT`) | `nodescount too low for throughput tier, minimum is: 3 for ` | The minimum is 3 brokers. | | 400 (`INVALID_ARGUMENT`) | `node count too high for current throughput tier` | The count exceeds the maximum for the machine type. For a request that changes only `throughput_tier`, Redpanda checks the current broker count against the target tier. Choose a larger machine type, or set a lower `redpanda_node_count` in the same request. | | 400 (`FAILED_PRECONDITION`) | `throughput tier change is only supported within the same tier generation` | The target machine type is in a different machine family or CPU architecture. Contact Redpanda Support to migrate. | | 400 (`FAILED_PRECONDITION`) | `Product/tier '' is not available in region ''. Please select a different product for this region.` | The target configuration is not offered in the cluster’s region. See [BYOC tiers and regions](https://docs.redpanda.com/cloud-data-platform/reference/tiers/byoc-tiers/). | | 400 (`FAILED_PRECONDITION`) | `The cluster has fired alerts. All alerts must be resolved before scaling the cluster.`, or another preflight check message | A preflight check failed. Resolve the condition named in the message and retry. | | 400 (`FAILED_PRECONDITION`) | `scaling is paused because the cloud provider could not supply the requested capacity:
. Contact support to resume.` | An earlier scaling operation stopped because of a cloud provider stockout or quota limit. Contact Redpanda Support. | Most error responses also include a machine-readable `reason` in the error details, such as `REASON_SCALING_REDPANDA_NODE_COUNT_TOO_HIGH` or `REASON_SCALING_UNSUPPORTED_THROUGHPUT_TIER_MIGRATION_PATH`. ## What happens during scaling Your cluster stays available throughout a scaling operation and its endpoints do not change. Expect the following: - Partition leadership moves as brokers are added, replaced, or removed, and partitions rebalance across the resulting set of brokers. Clients see leader elections and dropped connections. All mainstream Kafka client libraries reconnect and retry automatically. - When scaling out horizontally, the new brokers join first, and partitions rebalance onto them in the background. When scaling in, Redpanda decommissions the surplus brokers and moves their [partitions](https://docs.redpanda.com/home/glossary/#partition) to the remaining brokers before removing them. - When scaling vertically, Redpanda provisions brokers of the new machine type, then drains and decommissions the existing brokers one at a time, and removes the original brokers when all data has moved. - Metrics might show a gap of 5 to 10 minutes near the end of a scaling operation if the auxiliary nodes that run monitoring are also replaced. - The cluster shows **Upgrading** and rejects other configuration changes until scaling completes. If the cloud provider cannot supply the requested machines because of a stockout or a quota limit, the operation pauses with the brokers provisioned so far, and the cluster stays in **Upgrading**. The long-running operation eventually times out, and further scaling requests are rejected with a message that scaling is paused. Contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new) to resume or roll back the change. ## Limits - Self-service scaling applies to BYOC clusters in organizations on usage-based billing. For Dedicated clusters, or if you want Redpanda to run the change for you, see [Tier migrations](https://docs.redpanda.com/cloud-data-platform/manage/maintenance/#tier-migrations). - The broker count range, the machine family and CPU architecture rule, and the one-operation-at-a-time rule are described in [Before you scale](#before-you-scale). - Some older clusters return `cluster does not support product/node count change - contact support`. Contact Redpanda Support to scale these clusters. ## Next steps - [Size and Price a BYOC Cluster](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/size-byoc-cluster/) - [Scale a cluster with the Redpanda Terraform provider](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/#scale-a-cluster) - [Tier migrations](https://docs.redpanda.com/cloud-data-platform/manage/maintenance/#tier-migrations) - [Monitor your cluster](https://docs.redpanda.com/cloud-data-platform/manage/monitor-cloud/) --- # Page 402: Disaster Recovery **URL**: https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery.md --- # Disaster Recovery Shadowing complements Redpanda’s existing availability and recovery capabilities. High availability actively protects your day-to-day operations, handling reads and writes seamlessly during node or availability zone failures within a region. Shadowing is your safety net for catastrophic regional disasters. Shadowing delivers near real-time, cross-region replication for mission-critical applications that require rapid failover with minimal data loss. > 📝 **NOTE** > > Shadowing is supported on BYOC and Dedicated clusters running Redpanda version 25.3 and later. - [Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/) Learn about shadowing for disaster recovery in Redpanda Cloud. --- # Page 403: Shadowing **URL**: https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing.md --- # Shadowing > 📝 **NOTE** > > Shadowing is supported on BYOC and Dedicated clusters running Redpanda version 25.3 and later. - [Shadowing Overview](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/overview/) Overview of shadowing for disaster recovery in Redpanda Cloud. - [Configure Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/) Learn how to configure shadowing for disaster recovery. - [Migrate Schemas from Confluent Schema Registry](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/migrate-schemas-confluent/) Replicate subjects, versions, and compatibility settings from a Confluent Schema Registry into a Redpanda Cloud shadow cluster. - [Monitor Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/monitor/) Learn how to monitor shadowing for disaster recovery. - [Configure Failover](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/failover/) Learn how to configure failover for disaster recovery. - [Failover Runbook](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/failover-runbook/) Step-by-step runbook for failover procedures in disaster recovery. --- # Page 404: Failover Runbook **URL**: https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/failover-runbook.md --- # Failover Runbook This guide provides step-by-step procedures for emergency failover when your primary Redpanda cluster becomes unavailable. Follow these procedures only during active disasters when immediate failover is required. > ❗ **IMPORTANT** > > This is an emergency procedure. For planned failover testing or day-to-day shadow link management, see [Configure Failover](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/failover/). Ensure you have completed the [disaster readiness checklist](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/overview/#disaster-readiness-checklist) before an emergency occurs. > 📝 **NOTE** > > Shadowing is supported on BYOC and Dedicated clusters running Redpanda version 25.3 and later. ## Emergency failover procedure Follow these steps during an active disaster: 1. [Assess the situation](#assess-situation) 2. [Verify shadow cluster status](#verify-shadow-status) 3. [Document current state](#document-state) 4. [Initiate failover](#initiate-failover) 5. [Monitor failover progress](#monitor-progress) 6. [Update application configuration](#update-applications) 7. [Verify application functionality](#verify-functionality) 8. [Clean up and stabilize](#cleanup-stabilize) ### Assess the situation Confirm that failover is necessary: ```bash # Check if the primary cluster is responding rpk cluster info --brokers prod-cluster-1.example.com:9092,prod-cluster-2.example.com:9092 # If primary cluster is down, check shadow cluster health rpk cluster info --brokers shadow-cluster-1.example.com:9092,shadow-cluster-2.example.com:9092 ``` **Decision point**: If the primary cluster is responsive, consider whether failover is actually needed. Partial outages may not require full disaster recovery. **Examples that require full failover:** - Primary cluster is completely unreachable (network partition, regional outage) - Multiple broker failures preventing writes to critical topics - Data center failure affecting majority of brokers - Persistent authentication or authorization failures across the cluster **Examples that may NOT require failover:** - Single broker failure with sufficient replicas remaining - Temporary network connectivity issues affecting some clients - High latency or performance degradation (but cluster still functional) - Non-critical topic or partition unavailability ### Verify shadow cluster status Check the health of your shadow links: #### Cloud UI 1. From the **Shadow Link** page, select the shadow link you want to view. 2. The **Overview** tab shows the state of the shadow link and its topics. #### rpk ```bash # List all shadow links rpk shadow list # Check the configuration of your shadow link rpk shadow describe # Check the status of your disaster recovery link rpk shadow status ``` For detailed command options, see [`rpk shadow list`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-list/), [`rpk shadow describe`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-describe/), and [`rpk shadow status`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-status/). #### Cloud API ```bash # List all shadow links curl "https://api.redpanda.com/v1/shadow-links" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" # Check the configuration of your shadow link curl "https://api.redpanda.com/v1/shadow-links/" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" # Get Data Plane API URL of shadow cluster export DATAPLANE_API_URL=`curl https://api.cloud.redpanda.com/v1/clusters/ \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" | jq .cluster.dataplane_api` # Check the status of your disaster recovery link curl "https://$DATAPLANE_API_URL/v1/shadowlinks/" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" ``` Verify that the following conditions exist before proceeding with failover: - Shadow link state should be `ACTIVE`. - Topics should be in `ACTIVE` state (not `FAULTED`). - Replication lag should be reasonable for your RPO requirements. #### Understanding replication lag Use [`rpk shadow status`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-status/) or the [Data Plane API](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-shadowlinkservice_listshadowlinktopics) to check lag, which shows the message count difference between source and shadow partitions: - **Acceptable lag examples**: 0-1000 messages for low-throughput topics, 0-10000 messages for high-throughput topics - **Concerning lag examples**: Growing lag over 50,000 messages, or lag that continuously increases without recovering - **Critical lag examples**: Lag exceeding your data loss tolerance (for example, if you can only afford to lose 1 minute of data, lag should represent less than 1 minute of typical message volume) ### Document current state Record the current lag and status before proceeding: #### Cloud UI Capture the status from the **Shadow Link** page. #### rpk ```bash # Capture current status for post-mortem analysis rpk shadow status > failover-status-$(date +%Y%m%d-%H%M%S).log ``` Example output showing healthy replication before failover: ``` shadow link: Overview: NAME UID STATE ACTIVE Tasks: Name Broker_ID State Reason 1 ACTIVE 2 ACTIVE Topics: Name: , State: ACTIVE Partition SRC_LSO SRC_HWM DST_HWM Lag 0 1234 1468 1456 12 1 2345 2579 2568 11 ``` #### Cloud API ```bash # Capture current status for post-mortem analysis curl "https://$DATAPLANE_API_URL/v1/shadowlinks//topic" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" > failover-status-$(date +%Y%m%d-%H%M%S).log ``` The partition information shows the following: | Field | Description | | --- | --- | | source_last_stable_offset | Source partition last stable offset | | source_high_watermark | Source partition high watermark | | high_watermark | Shadow (destination) partition high watermark | | Lag | Message count difference between source and shadow partitions | > ❗ **IMPORTANT** > > Note the replication lag to estimate potential data loss during failover. The `Tasks` section shows the health of shadow link replication tasks. For details about what each task does, see [Shadow link tasks](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/overview/#shadow-link-tasks). ### Initiate failover A complete cluster failover is appropriate If you observe that the source cluster is no longer reachable: #### Cloud UI 1. On your **Shadow Link** page, click **Failover All Topics**. 2. Click to confirm the failover action. The failover process promotes all topics to writable status. #### rpk ```bash # Fail over all topics in the shadow link rpk shadow failover --all ``` For detailed command options, see [`rpk shadow failover`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-failover/). #### Cloud API ```bash # Fail over all topics in the shadow link curl -X POST "$DATAPLANE_API_URL/v1/shadowlink//failover" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" ``` For selective topic failover (when only specific services are affected): #### Cloud UI 1. On your **Shadow Link** page, click the **Failover** button for the topics you want to failover. 2. Click to confirm the failover action. The failover process promotes the selected topics to writable status. #### rpk ```bash # Fail over individual topics rpk shadow failover --topic rpk shadow failover --topic ``` #### Cloud API ```bash # Fail over individual topics curl -X POST "$DATAPLANE_API_URL/v1/shadowlinks//failover" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" \ -d '{ "shadowTopicName": "" }' curl -X POST "$DATAPLANE_API_URL/v1/shadowlinks//failover" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" \ -d '{ "shadowTopicName": "" }' ``` ### Monitor failover progress Track the failover process: #### Cloud UI 1. From the **Shadow Link** page, select the shadow link you want to view. 2. Click the **Tasks** tab to view all tasks and their status. #### rpk ```bash # Monitor status until all topics show FAILED_OVER watch -n 5 "rpk shadow status " # Check detailed topic status and lag during emergency rpk shadow status --print-topic ``` Example output during successful failover: ``` shadow link: Overview: NAME UID STATE ACTIVE Tasks: Name Broker_ID State Reason 1 ACTIVE 2 ACTIVE Topics: Name: , State: FAILED_OVER Name: , State: FAILED_OVER Name: , State: FAILING_OVER ``` #### Cloud API ```bash # Monitor status watch -n 5 'curl "https://$DATAPLANE_API_URL/v1/shadowlinks/" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" | jq .' # Check detailed topic status and lag during emergency curl "https://$DATAPLANE_API_URL/v1/shadowlinks//topic" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" ``` **Wait for**: All critical topics to reach `FAILED_OVER` state before proceeding. ### Update application configuration Redirect your applications to the shadow cluster by updating connection strings in your applications to point to shadow cluster brokers. If using DNS-based service discovery, update DNS records accordingly. Restart applications to pick up new connection settings and verify connectivity from application hosts to shadow cluster. ### Verify application functionality Test critical application workflows: ```bash # Verify applications can produce messages rpk topic produce --brokers :9092 # Verify applications can consume messages rpk topic consume --brokers :9092 --num 1 ``` Test message production and consumption, consumer group functionality, and critical business workflows to ensure everything is working properly. ### Clean up and stabilize After all applications are running normally: #### Cloud UI 1. On your **Shadow Link** page, click **Delete**. 2. Type "delete" to confirm the action. #### rpk ```bash # Optional: Delete the shadow link (no longer needed) rpk shadow delete ``` For detailed command options, see [`rpk shadow delete`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-delete/). #### Cloud API ```bash # Optional: Delete the shadow link (no longer needed) curl -X DELETE https://api.redpanda.com/v1/shadow-links/ \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" ``` For the full API reference, see [Control Plane API reference](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-shadowlinkservice_deleteshadowlink). > 📝 **NOTE** > > This operation [force deletes](#force-delete-warning) the shadow link. Document the time of failover initiation and completion, applications affected and recovery times, data loss estimates based on replication lag, and issues encountered during failover. ## Troubleshoot common issues > 📝 **NOTE** > > Direct access to shadow cluster logs isn’t available in Redpanda Cloud. To troubleshoot, use: > > - Run [`rpk shadow status`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-status/) to check task states, topic status, and lag. > > - Use the [Data Plane API](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-shadowlinkservice_listshadowlinktopics) for programmatic monitoring. > > - Monitor [Prometheus metrics](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/monitor/#shadow-link-metrics) such as `redpanda_shadow_link_shadow_lag` and `redpanda_shadow_link_client_errors`. > > > If these don’t reveal the root cause, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new) with your cluster ID, shadow link name, and the timestamp of the issue. ### Topics stuck in FAILING_OVER state **Problem**: Topics remain in `FAILING_OVER` state for extended periods **Solution**: Use `rpk shadow status`, the Data Plane API, or Prometheus metrics to check task and topic states, replication lag, and client-error counts, and ensure sufficient cluster resources (CPU, memory, disk space) are available on the shadow cluster. Verify network connectivity between shadow cluster nodes and confirm that all shadow topic partitions have elected leaders and the controller partition is properly replicated with an active leader. If topics remain stuck after addressing these cluster health issues and you need immediate failover, you can force delete the shadow link to failover all topics: #### Cloud UI All failover actions in the Cloud UI include force delete functionality by default. When you failover a shadow link, all topics are immediately promoted to writable status. #### rpk ```bash # Force delete the shadow link to failover all topics rpk shadow delete ``` `rpk shadow delete` force deletes the shadow link by default in Redpanda Cloud. #### Cloud API ```bash curl -X DELETE https://api.redpanda.com/v1/shadow-links/ \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" ``` The `DELETE /shadow-links/` endpoint of the Control Plane API force deletes the shadow link by default in Redpanda Cloud. > ⚠️ **WARNING** > > Force deleting a shadow link immediately fails over all topics in the link. This action is irreversible and should only be used when topics are stuck and you need immediate access to all replicated data. ### Topics in FAULTED state **Problem**: Topics show `FAULTED` state and are not replicating **Solution**: A shadow topic enters the `FAULTED` state when its source topic is deleted and then recreated with the same name. Shadowing tracks each source topic by its topic ID, and it marks the shadow topic as faulted when either of the following happens on the source cluster: - The topic ID of the source topic changes. - The source topic has fewer partitions than the shadow topic. A faulted shadow topic stops replicating and stays in the `FAULTED` state until you replace it. Deleting a source topic without recreating it does not fault the shadow topic. The shadow topic and the data it already replicated remain on the shadow cluster. Authentication, permission, and network problems do not fault individual topics. They affect the shadow link’s tasks, which report states such as `LINK_UNAVAILABLE`. To check task and topic states, replication lag, and client-error counts, use `rpk shadow status`, the Data Plane API, or Prometheus metrics. If you use `rpk` to update the shadow link in the following steps, use `rpk` v26.2.2 or later. Earlier versions of `rpk shadow update` add the filters you edit to the existing filter list instead of replacing the list, so they cannot remove the exclude filter after you delete the topic. To resume replication from a recreated source topic, replace the faulted shadow topic: 1. Update the shadow link to add an exclude filter that matches the name of each faulted topic exactly (`LITERAL` pattern type) to the auto-create topic filters. See [Update an existing shadow link](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/#update-an-existing-shadow-link). Redpanda rejects the deletion of a shadow topic that matches the auto-create topic filters, so add the exclude filter before you delete the topic. 2. Delete each faulted shadow topic on the shadow cluster: ```bash rpk topic delete ``` This deletes the shadow topic and all data it replicated from the original source topic. 3. Update the shadow link again to remove the exclude filters that you added. On its next topic metadata sync, Shadowing creates a new shadow topic for each recreated source topic. 4. Verify that the topics are replicating: ```bash rpk shadow status ``` The replaced topics show the `ACTIVE` state. ### Application connection failures **Problem**: Applications cannot connect to shadow cluster after failover **Solution**: Verify shadow cluster broker endpoints are correct and check security group and firewall rules. Confirm authentication credentials are valid for the shadow cluster and test network connectivity from application hosts. ### Consumer group offset issues **Problem**: Consumers start from beginning or wrong positions **Solution**: Verify consumer group offsets were replicated (check your filters) and use `rpk group describe ` to check offset positions. If necessary, manually reset offsets to appropriate positions. See [How to manage consumer group offsets in Redpanda](https://support.redpanda.com/hc/en-us/articles/23499121317399-How-to-manage-consumer-group-offsets-in-Redpanda) for detailed reset procedures. ## Next steps After successful failover, focus on recovery planning and process improvement. Begin by assessing the source cluster failure and determining whether to restore the original cluster or permanently promote the shadow cluster as your new primary. **Immediate recovery planning:** 1. **Assess source cluster**: Determine root cause of the outage 2. **Plan recovery**: Decide whether to restore source cluster or promote shadow cluster permanently 3. **Data synchronization**: Plan how to synchronize any data produced during failover 4. **Fail forward**: Create a new shadow link with the failed over shadow cluster as source to maintain a DR cluster **Process improvement:** 1. **Document the incident**: Record timeline, impact, and lessons learned 2. **Update runbooks**: Improve procedures based on what you learned 3. **Test regularly**: Schedule regular disaster recovery drills 4. **Review monitoring**: Ensure monitoring caught the issue appropriately --- # Page 405: Configure Failover **URL**: https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/failover.md --- # Configure Failover Failover is the process of modifying shadow topics or an entire shadow cluster from read-only replicas to fully writable resources, and ceasing replication from the source cluster. You can fail over individual topics for selective workload migration or fail over the entire cluster for comprehensive disaster recovery. This critical operation transforms your shadow resources into operational production assets, allowing you to redirect application traffic when the source cluster becomes unavailable. You can failover a shadow link using the Redpanda Cloud UI, `rpk`, or the Data Plane API. > ❗ **IMPORTANT: Experiencing an active disaster?** > > See [Failover Runbook](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/failover-runbook/) for immediate step-by-step disaster procedures. > 📝 **NOTE** > > Shadowing is supported on BYOC and Dedicated clusters running Redpanda version 25.3 and later. ## Failover behavior When you initiate failover, Redpanda performs the following operations: 1. **Stops replication**: Halts all data fetching from the source cluster for the specified topics or entire shadow link 2. **Failover topics**: Converts read-only shadow topics into regular, writable topics 3. **Updates topic state**: Changes topic status from `ACTIVE` to `FAILING_OVER`, then `FAILED_OVER` Topic failover is irreversible. Once failed over, topics cannot return to shadow mode, and automatic fallback to the original source cluster is not supported. > 📝 **NOTE** > > To avoid a split-brain scenario after failover, ensure that all clients are reconfigured to point to the shadow cluster before resuming write activity. ## Failover commands ### Get Data Plane API URL If using the Data Plane API, run the following to get the Data Plane API URL of the shadow cluster: ```bash export DATAPLANE_API_URL=`curl https://api.cloud.redpanda.com/v1/clusters/ \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" | jq .cluster.dataplane_api` ``` You can perform failover at different levels of granularity to match your disaster recovery needs: ### Individual topic failover To fail over a specific shadow topic while leaving other topics in the shadow link still replicating, run: #### Cloud UI 1. On the **Shadow Link** page, select your shadow link. 2. For any of the topics you want to failover, click the corresponding **Failover** button. 3. Click to confirm the failover action. The failover process promotes the selected topics to writable status. #### rpk ```bash rpk shadow failover --topic ``` For detailed command options, see [`rpk shadow failover`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-failover/). #### Data Plane API Send a `POST /shadowlink/{shadow_link_name}/failover` request to the Data Plane API. Specify the name of the shadow topic in the request body: ```bash curl -X POST "$DATAPLANE_API_URL/v1/shadowlink//failover" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" \ -d '{ "shadowTopicName": "" }' ``` Use this approach when you need to selectively failover specific workloads or when testing failover procedures. ### Complete shadow link failover (cluster failover) To fail over all shadow topics associated with the shadow link simultaneously, run: #### Cloud UI 1. On the **Shadow Link** page, select your shadow link. 2. Click **Failover All Topics**. 3. Click to confirm the failover action. The failover process promotes all topics to writable status. #### rpk ```bash rpk shadow failover --all ``` #### Data Plane API Send a `POST /shadowlink/{shadow_link_name}/failover` request to the Data Plane API. If you do not specify a shadow topic in the request body, this command requests a failover of all shadow topics associated with the shadow link: ```bash curl -X POST "$DATAPLANE_API_URL/v1/shadowlink//failover" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" ``` Use this approach during a complete regional disaster when you need to activate the entire shadow cluster as your new production environment. ### Force delete shadow link (emergency failover) #### Cloud UI All failover actions in the Cloud UI include force delete functionality by default. When you failover a shadow link, all topics are immediately promoted to writable status. #### rpk `rpk shadow delete` force deletes the shadow link by default in Redpanda Cloud: ```bash rpk shadow delete ``` #### Control Plane API Use the Control Plane API to force delete a shadow link: ```bash curl -X DELETE 'https://api.redpanda.com/v1/shadow-links/' \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" ``` > ⚠️ **WARNING** > > Force deleting a shadow link is irreversible and immediately fails over all topics in the link, bypassing the normal failover state transitions. This action should only be used as a last resort when topics are stuck in transitional states and you need immediate access to all replicated data. ## Failover states ### Shadow link states The shadow link itself has a simple state model: - **`ACTIVE`**: Shadow link is operating normally, replicating data - **`PAUSED`**: Shadow link replication is temporarily halted by user action Shadow links do not have dedicated failover states. Instead, the link’s operational status is determined by the collective state of its shadow topics. ### Shadow topic states Individual shadow topics progress through specific states during failover: - **`ACTIVE`**: Normal replication state before failover - **`FAULTED`**: Shadow topic has encountered an error and is not replicating - **`FAILING_OVER`**: Failover initiated, replication stopping - **`FAILED_OVER`**: Failover completed successfully, topic fully writable - **`PAUSED`**: Replication temporarily halted by user action ## Monitor failover progress To monitor failover progress using the status command, run: ### Cloud UI Track the progress of failover operations from the **Shadow Link** page in the Cloud UI. ### rpk ```bash rpk shadow status ``` The output shows individual topic states and any issues encountered during the failover process. For detailed command options, see [`rpk shadow status`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-status/). ### Data Plane API ```bash curl "https://$DATAPLANE_API_URL/v1/shadowlinks/" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" ``` Task states during monitoring: - **`ACTIVE`**: Task is operating normally and replicating data - **`FAULTED`**: Task encountered an error and requires attention - **`NOT_RUNNING`**: Task is not currently executing - **`LINK_UNAVAILABLE`**: Task cannot communicate with the source cluster For detailed information about shadow link tasks and their roles, see [Shadow link tasks](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/overview/#shadow-link-tasks). ## Post-failover cluster behavior After successful failover, your shadow cluster exhibits the following characteristics: **Topic accessibility:** - Failed over topics become fully writable and readable. - Applications can produce and consume messages normally. - All Kafka APIs are available for failedover topics. - Original offsets and timestamps are preserved. **Shadow link status:** - The shadow link remains but stops replicating data. - Link status shows topics in `FAILED_OVER` state. - You can safely delete the shadow link after successful failover. **Operational limitations:** - No automatic fallback mechanism to the original source cluster. - Data transforms remain disabled until you manually re-enable them. - Audit log history from the source cluster is not available (new audit logs begin immediately). ## Failover considerations and limitations Before implementing failover procedures, understand these key considerations that affect your disaster recovery strategy and operational planning. **Data consistency:** - Some data loss may occur due to replication lag at the time of failover. - Consumer group offsets are preserved, allowing applications to resume from their last committed position. - In-flight transactions at the source cluster are not replicated and will be lost. **Recovery-point-objective (RPO):** The amount of potential data loss depends on replication lag when disaster occurs. Monitor lag metrics to understand your effective RPO. **Network partitions:** If the source cluster becomes accessible again after failover, do not attempt to write to both clusters simultaneously. This creates a scenario with potential data inconsistencies, since metadata starts to diverge. **Testing requirements:** Regularly test failover procedures in non-production environments to validate your disaster recovery processes and measure RTO. ## Next steps After completing failover: - Update your application connection strings to point to the shadow cluster - Verify that applications can produce and consume messages normally - Consider deleting the shadow link if failover was successful and permanent For emergency situations, see [Failover Runbook](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/failover-runbook/). --- # Page 406: Migrate Schemas from Confluent Schema Registry **URL**: https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/migrate-schemas-confluent.md --- # Migrate Schemas from Confluent Schema Registry When you migrate to Redpanda from a deployment that uses a Confluent Schema Registry, your producers and consumers depend on the [schemas](https://docs.redpanda.com/home/glossary/#schema) stored in that registry. Shadowing removes this migration obstacle: a [shadow link](https://docs.redpanda.com/home/glossary/#shadow-link) continuously replicates schemas from the source Confluent Schema Registry into the [Schema Registry](https://docs.redpanda.com/home/glossary/#schema-registry) built into the Redpanda [shadow cluster](https://docs.redpanda.com/home/glossary/#shadow-cluster), preserving [subject](https://docs.redpanda.com/home/glossary/#subject) names, versions, and compatibility settings. Because both registries stay synchronized until cutover, your applications keep working on Redpanda without a separate schema migration step. Use this approach when you migrate from Confluent to Redpanda, or when you maintain a Redpanda disaster recovery cluster for a system that keeps its schemas in a Confluent Schema Registry. After reading this page, you will be able to: - Configure a shadow link that continuously replicates schemas from a Confluent Schema Registry - Filter replication by context or subject and map source contexts to destination contexts - Monitor schema replication status and resolve validation errors ## How HTTP API schema replication works When you configure a shadow link with the `shadow_schema_registry_api` option, the shadow cluster polls the source Schema Registry over HTTP and imports changes into its own Schema Registry. Two sync cycles keep the registries in step: - **Tail syncs** run frequently (default: every 10 seconds) to pick up incremental changes. - **Full syncs** scan all selected subjects (default: every 5 minutes) to catch anything a tail sync missed. Replicated schemas keep their original subject names and version IDs, so producers and consumers that reference schemas by ID continue to work after failover. Schemas that reference other schemas import in dependency order. Before importing a schema, Redpanda validates it against the Redpanda Schema Registry implementation. If a schema uses features that Redpanda does not support, the sync either reports an error and skips the schema, or removes the unsupported fields and imports the rest, depending on the [validation policy](#choose-a-validation-policy) you choose. While the link is active, the destination contexts that the link replicates into are read-only: the shadow cluster rejects client writes to those contexts so that replicated schemas remain identical to the source. Contexts outside the link’s filter remain writable. > 📝 **NOTE** > > This API-based mode is an alternative to the byte-for-byte `_schemas` topic replication described in [Configure Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/#schema-registry-synchronization). A shadow link uses one Schema Registry sync mode or the other, not both: > > - Use **topic mode** (`shadow_schema_registry_topic`) when the source is another Redpanda cluster and you want an exact, complete replica of its Schema Registry. Topic mode shadows the `_schemas` topic byte for byte, so it does not filter, remap, or validate schemas. > > - Use **API mode** (`shadow_schema_registry_api`) when the source is a Confluent Schema Registry, or when you need to replicate only selected contexts or subjects, map source contexts to different destination contexts, or control how schemas that use unsupported features are handled with a validation policy. > > > Schema replication settings live in the shadow link configuration. Two cluster properties, `schema_registry_sync_memory_bytes` and `schema_registry_sync_parallelism`, tune how much memory and concurrency the shadow cluster uses while importing schemas. Redpanda Cloud manages both properties. ## Use cases - **Migrate from Confluent to Redpanda**: Replicate schemas continuously while [Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/) replicates your topic data, then cut applications over to Redpanda once both are in sync. No separate schema migration tooling is required. - **Phased migration**: Use context and subject filters to migrate one team, application, or environment at a time. - **Registry reorganization**: Map source contexts to different destination contexts to restructure your Schema Registry as part of the migration. ## Prerequisites - A cluster running Redpanda version 26.2 or later. The schema replication feature activates after all brokers complete the upgrade. - A BYOC or Dedicated cluster. API-mode Schema Registry replication is rolling out to Redpanda Cloud; if the Schema Registry options described on this page are not yet available for your cluster, contact [Redpanda Support](https://support.redpanda.com/hc/en-us). - Network connectivity from the shadow cluster to the source Schema Registry HTTP endpoint. - Credentials for the source registry with permission to read subjects, versions, and configuration. For Confluent Cloud, use a Schema Registry API key and secret. - Basic Shadow link settings. See [Configure Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/). - The destination contexts that the link replicates into, as determined by your `source_filter` and `destination` mapping, must be empty on the shadow cluster. The rest of the shadow cluster’s Schema Registry does not need to be empty: contexts outside the link’s mappings are unaffected. - To replicate contexts other than the default context, the [`schema_registry_enable_qualified_subjects`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#schema_registry_enable_qualified_subjects) cluster property must be enabled on the shadow cluster (the default). See [Schema Registry Contexts](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-contexts/#prerequisites). ## Limitations - HTTP basic authentication and mTLS are the supported authentication methods for the source registry. You can also connect to a source registry that requires no authentication. - Replication is one way, from the source registry to the shadow cluster. Destination contexts owned by the link are read-only while schema replication runs, including after topic failover. To make them writable, pause schema replication. See [Fail over](#fail-over). - Schemas that use Confluent features not supported by the Redpanda Schema Registry are not replicated as-is. Choose a [validation policy](#choose-a-validation-policy) to control whether these schemas are skipped or imported without the unsupported fields. - Topic data replication and schema replication are coordinated, but not immediately consistent: schema arrival on the shadow cluster can be delayed by the tail refresh interval (`tail_interval`), which defaults to 10 seconds. Records serialized in the Confluent SerDes wire format can therefore arrive before the schema IDs they contain. This does not cause replication errors, because schema IDs are not validated during topic data replication, but consumers that look up those schema IDs on the shadow cluster fail until the schemas arrive. See [Monitor replication status](#monitor-replication-status). - Role synchronization requires a Redpanda source. Leave `role_sync_options` unconfigured when the source is a Confluent cluster: a Roles Migrator task pointed at a non-Redpanda source reports `LINK_UNAVAILABLE` while the link itself stays `ACTIVE`. - Deleting and recreating a subject: A hard delete on the source replicates on the next sync, not instantly. Wait until the subject is removed from the shadow cluster before registering a new schema under the same name, as recreating it too soon prevents the sync job from detecting the subject/subject-version change. ## Configure schema replication Schema replication is one synchronization task on a shadow link. You configure it by adding the `shadow_schema_registry_api` option to the `schema_registry_sync_options` section of the same shadow link that replicates your topic data, consumer offsets, and ACLs. The sections below extend the shadow link configuration described in [Configure Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/#create-a-shadow-link); they do not replace it. > ❗ **IMPORTANT** > > A shadow link whose configuration contains only `schema_registry_sync_options` replicates schemas and nothing else. For a full migration, keep your topic, consumer offset, and security synchronization options in the same configuration file. This workflow builds the configuration file that `rpk shadow create` consumes. The same settings map one-to-one onto the Cloud UI fields, the Control Plane API request, and the Terraform resource shown in [Create the shadow link](#create-the-shadow-link). The following collapsible sample shows where the schema replication settings sit in a complete shadow link configuration file. The highlighted lines are the schema replication settings, which the sections that follow explain. Explore a sample configuration file ```yaml # Sample shadow link configuration with API-mode Schema Registry replication name: confluent-migration # Unique name for this shadow link client_options: bootstrap_servers: # Source Kafka cluster brokers - : # Example: "pkc-xxxxx.us-east-1.aws.confluent.cloud:9092" - : # For the TLS and authentication settings that the shadow cluster uses to # connect to the source Kafka cluster, see the complete configuration file # reference in Configure Shadowing. # Keep the rest of your migration in the same file. Without these sections, # the link replicates schemas only. topic_metadata_sync_options: # ...your topic replication settings... consumer_offset_sync_options: # ...your consumer offset settings... security_sync_options: # ...your ACL replication settings... schema_registry_sync_options: shadow_schema_registry_api: # API mode: replicate from a Confluent Schema Registry source_url: https://psrc-xxxxx.us-east-1.aws.confluent.cloud # Source Schema Registry endpoint auth_options: basic: username: # Confluent Schema Registry API key password: ${secrets.} # ID of the secret that holds the Schema Registry API secret tls_settings: enabled: true # Use TLS for the connection tail_interval: 10s # Optional: poll for incremental changes (default: 10s) full_sync_interval: 5m # Optional: full source scan interval (default: 5m) max_source_requests_per_second: 30 # Optional: rate limit for source requests (default: 30) source_filter: contexts: - "." # The default context subjects: [] # Empty: all subjects in the selected contexts destination: identity: {} # Keep source context names unsupported_schema_feature_policy: FAIL # FAIL (default) or REMOVE ``` For the complete configuration file, including consumer offset and security synchronization options, see [Configure Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/#create-a-shadow-link). ### Generate a configuration template Generate a configuration file template that includes all available fields with comments: ```bash rpk shadow config generate --print-template -o shadow-config-template.yaml ``` For detailed command options, see [`rpk shadow config generate`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-config-generate/). ### Connect to the source registry Configure the connection to the source Schema Registry: ```yaml schema_registry_sync_options: shadow_schema_registry_api: source_url: https://psrc-xxxxx.us-east-1.aws.confluent.cloud # Source Schema Registry endpoint auth_options: basic: username: # Confluent Schema Registry API key password: ${secrets.} # ID of the secret that holds the Schema Registry API secret tls_settings: enabled: true # Use TLS for the connection tail_interval: 10s # How often to poll for incremental changes full_sync_interval: 5m # How often to run a full scan max_source_requests_per_second: 30 # Rate limit for requests to the source registry ``` The intervals and rate limit are optional. If you omit them, Redpanda uses the defaults shown above. To authenticate to the source registry with mTLS instead of HTTP basic authentication, omit `auth_options` and provide a client certificate and key in `tls_settings`. To connect to a source registry that requires no authentication, omit `auth_options` and do not provide a client certificate. ### Select contexts and subjects By default, the link replicates the entire source registry. To replicate a subset, add a `source_filter` with the contexts or subjects to include: ```yaml schema_registry_sync_options: shadow_schema_registry_api: # ...connection settings... source_filter: contexts: - ".prod" # Replicate this entire context subjects: - orders-value # One subject from the default context ``` The two lists combine as a union: - `contexts` selects entire contexts: every subject in each listed context replicates. - `subjects` selects individual subjects, using qualified subject syntax: `orders-value` is the subject in the default context, and `:.staging:orders-value` is the subject of the same name in the `.staging` context. - When both lists are set, the link replicates everything selected by either list. A subject selected by both lists replicates once. For example, the preceding filter replicates every subject in the `.prod` context, plus the single `orders-value` subject from the default context. The `contexts` and `subjects` lists accept literal names only. Wildcard and prefix patterns are not supported. Schema Registry contexts provide independent namespaces for subjects within one registry. The default context is named `.`. For more information, see [Schema Registry Contexts](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-contexts/). ### Map source contexts to destination contexts Choose how replicated contexts are named on the shadow cluster: - `identity`: Keep the source context names (default behavior for migrations). - `exact`: Map each source context to a different destination context. ```yaml schema_registry_sync_options: shadow_schema_registry_api: # ...connection settings and filters... destination: identity: {} # Keep source context names ``` To rename contexts during replication: ```yaml schema_registry_sync_options: shadow_schema_registry_api: # ...connection settings and filters... destination: exact: mappings: - source: "." # Source context destination: ".shadow" # Destination context on the shadow cluster ``` > ❗ **IMPORTANT** > > With `exact` mapping, the mappings must cover every context that the link replicates. If the link encounters a source context that has no mapping, the schema replication task fails. If new contexts might be created on the source registry after you set up the link, scope the `source_filter` `contexts` list to the mapped contexts so that an unexpected context cannot stop replication. ### Choose a validation policy The `unsupported_schema_feature_policy` setting controls what happens when a source schema uses features that the Redpanda Schema Registry does not support. The unsupported Confluent Schema Registry features are: - In schema definitions: rule sets and metadata tags. - In subject configurations: override metadata, override rule sets, default metadata, default rule sets, and compatibility groups. Compatibility groups are not the same as compatibility levels, which do replicate. The policy determines how the sync handles a schema or configuration that uses these features: | Policy | Behavior | | --- | --- | | `FAIL` (default) | The schema is not replicated. The sync records an error, reports it in the link status, and continues with the remaining schemas. | | `REMOVE` | The unsupported fields are removed and the rest of the schema is imported. The sync records each modification in the link status. | ```yaml schema_registry_sync_options: shadow_schema_registry_api: # ...connection settings, filters, and destination... unsupported_schema_feature_policy: FAIL ``` ### Create the shadow link Create the shadow link with the method that fits your workflow. All four methods configure the same settings. #### Cloud UI The create shadow link wizard includes a Schema Registry section on the **Configuration** step: 1. At the organization level of the Cloud UI, navigate to **Shadow Link** and click **Create shadow link**. 2. Complete the **Connection**, **Shadow**, and **Source** steps as described in [Configure Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/#create-a-shadow-link). For a Confluent source, select **Bootstrap URL** on the **Connection** step and enter the Confluent Kafka bootstrap servers. 3. On the **Configuration** step, in the Schema Registry section, select the Schema Registry HTTP API mode and configure: 1. The source Schema Registry URL. 2. Authentication: none, or HTTP basic. For Confluent Cloud, use a Schema Registry API key and secret. 3. TLS, with an optional custom CA certificate or an mTLS client certificate. 4. The scope: every context and subject, or specific ones. 5. Destination contexts: preserve the source context names, or map each source context to a destination context. 6. Optionally, the sync behavior: tail interval, full sync interval, maximum source request rate, and the unsupported schema features policy. 4. The wizard validates the connection details and shows the subjects and versions that match your filters before it creates the link. 5. Click **Create shadow link**. #### rpk Create the shadow link with your completed configuration file: ```bash rpk shadow create --config-file shadow-config.yaml ``` For detailed command options, see [`rpk shadow create`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-create/). To change the schema replication settings on an existing link, see [`rpk shadow update`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-update/). #### Control Plane API To create the link programmatically, include `schema_registry_sync_options` in the `POST /v1/shadow-links` request. The following request configures the same API-mode replication as the configuration file above: ```bash curl -X POST 'https://api.redpanda.com/v1/shadow-links' \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" \ -d '{ "shadow_link": { "shadow_redpanda_id": "", "name": "", "client_options": { "bootstrap_servers": [":"], "tls_settings": { "enabled": true } }, "schema_registry_sync_options": { "shadow_schema_registry_api": { "source_url": "https://psrc-xxxxx.us-east-1.aws.confluent.cloud", "auth_options": { "basic": { "username": "", "password": "${secrets.}" } }, "tls_settings": { "enabled": true }, "source_filter": { "contexts": ["."], "subjects": [] }, "destination": { "identity": {} }, "unsupported_schema_feature_policy": "UNSUPPORTED_SCHEMA_FEATURE_POLICY_FAIL" } } } }' ``` The API accepts only `basic` authentication in `auth_options`. The `password` value must reference a secret in the shadow cluster’s secret store, in the form `${secrets.}`. The API rejects a plaintext password. For the source cluster connection settings (`client_options`), authentication, and secret handling, see the Control Plane API tab in [Configure Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/#create-a-shadow-link). For the full request schema, see the [Control Plane API reference](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-shadowlinkservice_createshadowlink). #### Terraform To manage the shadow link declaratively instead of with `rpk`, use the [`redpanda_shadow_link` resource](https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs/resources/shadow_link) in the [Redpanda Terraform provider](https://registry.terraform.io/providers/redpanda-data/redpanda/latest). API-mode Schema Registry replication requires provider version 2.3.0 or later. The configuration keys described on this page map to the resource’s `schema_registry_sync_options.shadow_schema_registry_api` attribute: ```hcl resource "redpanda_shadow_link" "confluent_migration" { # Connection settings for the source Kafka cluster (client_options, # cluster IDs, and secret handling) are the same as for any shadow link. # See the Terraform tab in Configure Shadowing. schema_registry_sync_options = { shadow_schema_registry_api = { source_url = "https://psrc-xxxxx.us-east-1.aws.confluent.cloud" auth_options = { basic = { username = "" password = "$${secrets.${redpanda_secret.sr_api_secret.name}}" } } tls_settings = { enabled = true } source_filter = { contexts = ["."] } destination = { identity = true } unsupported_schema_feature_policy = "FAIL" } } } ``` Replace the placeholders with your own values: - ``: Confluent Schema Registry API key. - The `password` value references a [`redpanda_secret` resource](https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs/resources/secret) named `sr_api_secret` that stores the Confluent Schema Registry API secret in the shadow cluster’s secret store. The doubled dollar sign (`$$`) keeps Terraform from interpolating the `${secrets…​.}` reference, which Redpanda resolves at connection time. Initialize the working directory if you have not already done so, review the plan, and apply the configuration: ```bash terraform init terraform plan terraform apply ``` The attribute shapes differ from the YAML configuration file in one place: `destination` takes `identity = true` to preserve source context names, or an `exact` block with explicit source-to-destination `mappings`. For the full attribute schema, see the [`redpanda_shadow_link` reference](https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs/resources/shadow_link). For a complete working configuration, including the source cluster connection and secret resources, see the [provider example](https://github.com/redpanda-data/terraform-provider-redpanda/blob/main/examples/shadow_link/main.tf) and the Terraform tab in [Configure Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/#create-a-shadow-link). ## Verify the configuration Confirm that the link is configured for API-based schema replication: ```bash rpk shadow describe --print-registry ``` The `--print-registry` flag prints the Schema Registry section, which includes the shadowing mode, source URL, sync intervals, validation policy, and your context and subject filters. Without it, `rpk shadow describe` prints only the overview and client sections. For detailed command options, see [`rpk shadow describe`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-describe/). ## Monitor replication status Check schema replication progress and errors for a link: ```bash rpk shadow status ``` The Schema Registry section of the output reports: | Field | Description | | --- | --- | | Inventory | The number of selected subjects and subject versions on the source, compared with the number of subjects and versions on the destination. The registries are synchronized when the destination counts match the selected source counts. A destination that is behind the source indicates that replication is still in progress. | | Current sync | The type of the sync in progress (`FULL` or `TAIL`) and the number of subject versions, compatibility configurations, and modes it has changed, including how many unsupported features were removed and how many errors occurred. | | Last full sync | Start time, finish time, and change counts for the most recent completed full sync. | | Totals since task start | Cumulative change and error counts since the schema replication task started. | | Last error | The most recent replication error. With the `FAIL` validation policy, schemas that fail validation appear here. | The schema replication task runs on the broker and shard that hosts the leader of the `_schemas` topic’s partition. The counters in the status output are not persisted: expect them to reset to zero when that broker restarts or when leadership of the `_schemas` partition moves to another broker. For detailed command options, see [`rpk shadow status`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-status/). For general link monitoring, see [Monitor Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/monitor/). ## Fail over For best results, shadow links should be failed over as a single unit, which prevents partial failover scenarios and unexpected results. Selective failover, such as topics only, does not stop schema replication. As part of failover, pause the schema replication task by setting `paused: true` in the `schema_registry_sync_options` section of the link configuration. Pausing the task stops further syncing from the source registry and makes the write-blocked destination contexts writable, so your applications can register new schemas on the promoted cluster. For the complete failover procedure, see [Failover](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/failover/). ## Next steps - [Configure Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/) to replicate topic data, consumer offsets, and ACLs alongside your schemas. - [Monitor Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/monitor/) - [Schema Registry Contexts](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-contexts/) --- # Page 407: Monitor Shadowing **URL**: https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/monitor.md --- # Monitor Shadowing Monitor your [shadow links](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/) to ensure proper replication performance and understand your disaster recovery readiness. Use `rpk` commands, metrics, and status information to track shadow link health and troubleshoot issues. > ❗ **IMPORTANT: Experiencing an active disaster?** > > See [Failover Runbook](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/failover-runbook/) for immediate step-by-step disaster procedures. ## Status commands To list existing shadow links: ### Cloud UI At the organization level of the Cloud UI, navigate to **Shadow Link**. ### rpk ```bash rpk shadow list ``` ### Control Plane API ```bash curl 'https://api.redpanda.com/v1/shadow-links' \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" ``` To view shadow link configuration details: ### Cloud UI 1. From the **Shadow Link** page, select the shadow link you want to view. 2. Click the **Tasks** tab to view all tasks and their status. ### rpk ```bash rpk shadow describe ``` For detailed command options, see [`rpk shadow list`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-list/) and [`rpk shadow describe`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-describe/). This command shows the complete configuration of the shadow link, including connection settings, filters, and synchronization options. ### Control Plane API ```bash curl 'https://api.redpanda.com/v1/shadow-links/' \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" ``` To check your shadow link status and ensure proper operation: ### Cloud UI 1. From the **Shadow Link** page, select the shadow link you want to view. 2. Click the **Tasks** tab to view all tasks and their status. ### rpk ```bash rpk shadow status ``` For troubleshooting specific issues, you can use command options to show individual status sections. See [`rpk shadow status`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-status/) for available status options. The status output includes the following: ### Cloud API ```bash # Get Data Plane API URL of shadow cluster export DATAPLANE_API_URL=`curl https://api.cloud.redpanda.com/v1/clusters/ \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" | jq .cluster.dataplane_api` curl "https://$DATAPLANE_API_URL/v1/shadowlinks/" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" # View topic state curl "https://$DATAPLANE_API_URL/v1/shadowlinks//topic" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" ``` The status includes the following: - **Shadow link state**: Overall operational state (`ACTIVE`, `PAUSED`). - **Individual topic states**: Current state of each replicated topic (`ACTIVE`, `FAULTED`, `FAILING_OVER`, `FAILED_OVER`, `PAUSED`). - **Task status**: Health of replication tasks across brokers (`ACTIVE`, `FAULTED`, `NOT_RUNNING`, `LINK_UNAVAILABLE`). For details about shadow link tasks, see [Shadow link tasks](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/overview/#shadow-link-tasks). - **Failure reason**: When a shadow link or one of its tasks reports a failed state, the `Reason` field explains why. Check this field first when a link is not replicating as expected. - **Lag information**: Replication lag per partition showing source vs shadow high watermarks (HWM). - **Schema Registry sync status**: For links that replicate schemas through the Schema Registry API, inventory counts for source and destination subjects, sync progress, and the most recent error. See [Monitor replication status](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/migrate-schemas-confluent/#monitor-replication-status). - **Role sync counts**: For links that replicate RBAC roles, the `Reason` field of the [Roles Migrator task](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/overview/#roles-migrator-task) reports the counts from the most recent sync cycle (roles created, updated, deleted, and failures). See [Role filtering](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/#role-filtering). ## Metrics Shadowing provides comprehensive metrics to track replication performance and health with the [`public_metrics`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/) endpoint. | Metric | Type | Description | | --- | --- | --- | | `redpanda_shadow_link_shadow_lag` | Gauge | The lag of the shadow partition against the source partition, calculated as source partition LSO (Last Stable Offset) minus shadow partition HWM (High Watermark). Monitor by `shadow_link_name`, `topic`, and `partition` to understand replication lag for each partition. | | `redpanda_shadow_link_total_bytes_fetched` | Count | The total number of bytes fetched by a sharded replicator (bytes received by the client). Labeled by `shadow_link_name` and `shard` to track data transfer volume from the source cluster. | | `redpanda_shadow_link_total_bytes_written` | Count | The total number of bytes written by a sharded replicator (bytes written to the write_at_offset_stm). Uses `shadow_link_name` and `shard` labels to monitor data written to the shadow cluster. | | `redpanda_shadow_link_client_errors` | Count | The number of errors seen by the client. Track by `shadow_link_name` and `shard` to identify connection or protocol issues between clusters. | | `redpanda_shadow_link_shadow_topic_state` | Gauge | Number of shadow topics in the respective states. Labeled by `shadow_link_name` and `state` to monitor topic state distribution across your shadow links. | | `redpanda_shadow_link_total_records_fetched` | Count | The total number of records fetched by the sharded replicator (records received by the client). Monitor by `shadow_link_name` and `shard` to track message throughput from the source. | | `redpanda_shadow_link_total_records_written` | Count | The total number of records written by a sharded replicator (records written to the write_at_offset_stm). Uses `shadow_link_name` and `shard` labels to monitor message throughput to the shadow cluster. | See also: [Metrics Reference](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/) ## Monitoring best practices ### Health check procedures Establish regular monitoring workflows to ensure shadow link health: #### Cloud UI 1. From the **Shadow Link** page, select the shadow link you want to view. 2. Click the **Tasks** tab to view all tasks and their status. #### rpk ```bash # Check all shadow links are active rpk shadow list | grep -v "ACTIVE" || echo "All shadow links healthy" # Monitor lag for critical topics rpk shadow status | grep -E "LAG|Lag" ``` #### Cloud API ```bash # Check all shadow links are active curl 'https://api.redpanda.com/v1/shadow-links' \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" | \ jq -r 'if all(.state == "SHADOW_LINK_STATE_ACTIVE") then "All shadow links healthy" else .[] | select(.state != "SHADOW_LINK_STATE_ACTIVE") end' # Monitor lag for critical topics curl "https://$DATAPLANE_API_URL/v1/shadowlinks//topic" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" ``` ### Alert conditions Configure monitoring alerts for the following conditions, which indicate problems with Shadowing: - **High replication lag**: When `redpanda_shadow_link_shadow_lag` exceeds your RPO requirements - **Connection errors**: When `redpanda_shadow_link_client_errors` increases rapidly - **Topic state changes**: When topics move to `FAULTED` state - **Task failures**: When replication tasks enter `FAULTED` or `NOT_RUNNING` states - **Throughput drops**: When bytes/records fetched drops significantly - **Link unavailability**: When tasks show `LINK_UNAVAILABLE` indicating source cluster connectivity issues For more information about shadow link tasks and their states, see [Shadow link tasks](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/overview/#shadow-link-tasks). --- # Page 408: Shadowing Overview **URL**: https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/overview.md --- # Shadowing Overview > 📝 **NOTE** > > Shadowing is supported on BYOC and Dedicated clusters running Redpanda version 25.3 and later. Shadowing is Redpanda’s enterprise-grade disaster recovery solution that establishes asynchronous, offset-preserving replication from a source cluster to a Redpanda shadow cluster. The source can be another Redpanda cluster or any Kafka API-compatible cluster, such as Apache Kafka, Confluent Cloud, or Confluent Platform. The shadow cluster creates a dedicated client within the broker that continuously replicates source cluster data, including offsets, timestamps, and cluster metadata. This creates a read-only shadow cluster that you can quickly fail over to handle production traffic during a disaster. Shadowing keeps data flowing, even during regional outages. Because the source can be any Kafka API-compatible cluster, Shadowing is also a migration path to Redpanda: the shadow cluster runs as a continuously updated replica alongside your existing Kafka or Confluent deployment until you cut your applications over. To replicate schemas as part of a migration, see [Migrate Schemas from Confluent Schema Registry](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/migrate-schemas-confluent/). > ❗ **IMPORTANT: Experiencing an active disaster?** > > See [Failover Runbook](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/failover-runbook/) for immediate step-by-step disaster procedures. Unlike traditional replication tools that re-produce messages, Shadowing copies data at the byte level, ensuring shadow topics contain identical copies of source topics with preserved offsets and timestamps. Shadowing replicates: - **Topic data**: All records with preserved offsets and timestamps - **Topic configurations**: Partition counts, retention policies, and other topic properties - **Consumer group offsets**: Enables seamless consumer resumption after failover - **Access control lists (ACLs)**: User permissions and security policies - **RBAC roles**: Role definitions and memberships for the roles you select with filters, from a Redpanda source cluster only. Both clusters must run Redpanda version 26.2 or later. - **Schema Registry data**: Schema definitions, versions, and compatibility settings, replicated from another Redpanda cluster or from a Confluent Schema Registry ## How Shadowing fits into disaster recovery Shadowing addresses enterprise disaster recovery requirements driven by regulatory compliance and business continuity needs. Organizations typically want to minimize both recovery time objective (RTO) and recovery point objective (RPO), and Shadowing asynchronous replication helps you achieve both goals by reducing data loss during regional outages and enabling rapid application recovery. The architecture follows an active-passive pattern. The source cluster processes all production traffic while the shadow cluster remains in read-only mode, continuously receiving updates. If a disaster occurs, you can failover the shadow topics, making them fully writable. At that point, you can redirect your applications to the shadow cluster, which becomes the new production cluster. > 📝 **NOTE** > > To avoid a split-brain scenario after failover, ensure that all clients are reconfigured to point to the shadow cluster before resuming write activity. Shadowing complements Redpanda’s existing availability and recovery capabilities. High availability actively protects your day-to-day operations, handling reads and writes seamlessly during node or availability zone failures within a region. Shadowing is your safety net for catastrophic regional disasters. Shadowing delivers near real-time, cross-region replication for mission-critical applications that require rapid failover with minimal data loss. ## Limitations Shadowing for disaster recovery currently has the following limitations: - Shadowing is designed for active-passive disaster recovery scenarios. Each shadow cluster can maintain only one shadow link. - Shadowing operates exclusively in asynchronous mode and doesn’t support active-active configurations. This means there will always be some replication lag. - [Data transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/) are not supported on shadow clusters while Shadowing is active. Writing to shadow topics is blocked. - During a disaster, [audit log](https://docs.redpanda.com/cloud-data-platform/manage/audit-logging/) history from the source cluster is lost, though the shadow cluster begins generating new audit logs immediately after the failover. - After you failover shadow topics, automatic fallback to the original source cluster is not supported. ## Shadow link tasks Shadow linking operates through specialized tasks that handle different aspects of replication. If you use a `shadow-config.yaml` configuration file to create the shadow link, each task corresponds to a section in the file. Tasks run continuously to maintain synchronization with the source cluster. #### Source Topic Sync The **Source Topic Sync task** manages topic discovery and metadata synchronization. This task periodically queries the source cluster to discover available topics, applies your configured topic filters to determine which topics should become shadow topics, and synchronizes topic properties between clusters. The task is controlled by the `topic_metadata_sync_options` section in the configuration file. It includes: - **Auto-creation filters**: Determines which source topics automatically become shadow topics - **Property synchronization**: Controls which topic properties replicate from source to shadow - **Starting offset**: Sets where new shadow topics begin replication (earliest, latest, or timestamp-based) - **Sync interval**: How frequently to check for new topics and property changes When this task discovers a new topic that matches your filters, it creates the corresponding shadow topic and begins replication from your configured starting offset. #### Consumer Group Shadowing The **Consumer Group Shadowing task** replicates consumer group offsets and membership information from the source cluster. This ensures that consumer applications can resume processing from the correct position after failover. The task is controlled by the `consumer_offset_sync_options` section in the configuration file. It includes: - **Group filters**: Determines which consumer groups have their offsets replicated - **Sync interval**: How frequently to synchronize consumer group offsets - **Offset clamping**: Automatically adjusts replicated offsets to valid ranges on the shadow cluster This task runs on brokers that host the `__consumer_offsets` topic and continuously tracks consumer group coordinators to optimize offset synchronization. #### Security Migrator The **Security Migrator task** replicates security policies, primarily ACLs (access control lists), from the source cluster to maintain consistent authorization across both environments. The task is controlled by the `security_sync_options` section in the configuration file. It includes: - **ACL filters**: Determines which security policies replicate - **Sync interval**: How frequently to synchronize security settings By default, all ACLs replicate to ensure your shadow cluster maintains the same security posture as your source cluster. #### Schema Registry Sync The **Schema Registry Sync task** replicates Schema Registry content so that applications that depend on schemas keep working after failover. The task is controlled by the `schema_registry_sync_options` section in the configuration file. It supports two modes: - **Topic mode** (`shadow_schema_registry_topic`): Shadows the `_schemas` system topic for byte-for-byte replication from another Redpanda cluster. - **API mode** (`shadow_schema_registry_api`): Polls the source Schema Registry over HTTP and imports selected contexts and subjects, with validation. Use this mode to replicate schemas from a Confluent Schema Registry. See [Migrate Schemas from Confluent Schema Registry](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/migrate-schemas-confluent/). A shadow link uses one mode or the other, not both. Only API mode runs as a separate task that appears in the shadow link status. Topic mode adds the `_schemas` topic to the set of shadowed topics, so it is monitored like any other shadow topic rather than as a separate task. #### Roles Migrator The **Roles Migrator task** replicates RBAC role definitions and role memberships from the source cluster, so that role-based permissions authorize the same operations on the shadow cluster after failover. The task is controlled by the `role_sync_options` section of the shadow link configuration. It includes: - **Role name filters**: Determines which roles replicate. In the configuration file, `rpk`, the Control Plane API, and Terraform, no roles replicate until you add at least one include filter. The Cloud UI defaults to **All roles**. - **Sync interval**: How frequently to synchronize roles Within the configured filters, the task keeps the shadow cluster’s roles as a full mirror of the source, creating, updating, and deleting roles to match. It does not replicate user credentials or the ACLs bound to roles; the Security Migrator task replicates ACLs. See [Role filtering](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/#role-filtering). ### Task status and monitoring Each task reports its status through the shadow link status API. Task states include: - **`ACTIVE`**: Task is running normally and performing synchronization - **`PAUSED`**: Task has been manually paused through configuration - **`FAULTED`**: Task encountered an error and requires attention - **`NOT_RUNNING`**: Task is not currently executing - **`LINK_UNAVAILABLE`**: Task cannot communicate with the source cluster You can pause individual tasks by setting the `paused` field to `true` in the corresponding configuration section. This allows you to selectively disable parts of the replication process without affecting the entire shadow link. For monitoring task health and troubleshooting task issues, see [Monitor Shadowing](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/monitor/). ## What gets replicated Shadowing replicates your topic data with complete fidelity, preserving all message records with their original offsets, timestamps, headers, and metadata. The partition structure remains identical between source and shadow clusters, ensuring applications can resume processing from the exact same position after failover. Consumer group data flows according to your group filters, replicating offsets and membership information for matched groups. ACLs replicate based on your security filters. Schema Registry data synchronizes schema definitions, versions, and compatibility settings, either by shadowing the `_schemas` topic or through the [Schema Registry API](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/migrate-schemas-confluent/). Topic data, topic configurations, consumer group offsets, and ACLs replicate from any Kafka API-compatible source. When the source is not a Redpanda cluster, RBAC role synchronization and byte-for-byte `_schemas` topic replication are unavailable. See [Non-Redpanda source clusters](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/#non-redpanda-source-clusters). Partition count is always replicated to ensure the shadow topic matches the source topic’s partition structure. ### Topic properties replication The [Source Topic Sync task](#shadow-link-tasks) handles topic property replication. For topic properties, Redpanda follows these replication rules: **Never replicated** - `redpanda.remote.readreplica` - `redpanda.remote.recovery` - `redpanda.remote.allowgaps` - `redpanda.virtual.cluster.id` - `redpanda.leaders.preference` - `redpanda.cloud_topic.enabled` **Always replicated** - `max.message.bytes` - `cleanup.policy` - `message.timestamp.type` **Always replicated (unless `exclude_default` is `true`)** - `compression.type` - `retention.bytes` - `retention.ms` - `delete.retention.ms` - `replication.factor` - `min.compaction.lag.ms` - `max.compaction.lag.ms` To replicate additional topic properties, explicitly list them in `synced_shadow_topic_properties`. The filtering system you configure determines the precise scope of replication across all components, allowing you to balance comprehensive disaster recovery with operational efficiency. ## Best practices To ensure reliable disaster recovery with Shadowing: - **Do not modify shadow topic properties**: Avoid modifying synced topic properties on shadow topics, as these properties automatically revert to source topic values. ## Implementation overview Choose your implementation approach: - **[Setup and Configuration](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup/)**: Initial shadow configuration, authentication, and topic selection - **[Monitoring and Operations](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/monitor/)**: Health checks, lag monitoring, and operational procedures - **[Planned Failover](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/failover/)**: Controlled disaster recovery testing and migrations - **[Failover Runbook](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/failover-runbook/)**: Rapid disaster response procedures > 💡 **TIP** > > You can create and manage shadow links with the Redpanda Cloud UI, the [Cloud API](https://docs.redpanda.com/api/doc/cloud-controlplane/topic/topic-cloud-api-overview), or `rpk`, giving you flexibility in how you interact with your disaster recovery infrastructure. ## Next steps After setting up Shadowing for your Redpanda clusters, consider these additional steps: - **Test your disaster recovery procedures**: Regularly practice failover scenarios in a non-production environment. See [Failover Runbook](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/failover-runbook/) for step-by-step disaster procedures. - **Monitor shadow link health**: Set up alerting on the metrics described above to ensure early detection of replication issues. - **Implement automated failover**: Consider developing automation scripts that can detect outages and initiate failover based on predefined criteria. - **Review security policies**: Ensure your ACL filters replicate the appropriate security settings for your disaster recovery environment. - **Document your configuration**: Maintain up-to-date documentation of your shadow link configuration, including network settings, authentication details, and filter definitions. --- # Page 409: Configure Shadowing **URL**: https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/setup.md --- # Configure Shadowing You can create and manage shadow links with the Redpanda Cloud UI, the [Cloud API](https://docs.redpanda.com/api/doc/cloud-controlplane/topic/topic-cloud-api-overview), or `rpk`, giving you flexibility in how you interact with your disaster recovery infrastructure. > 💡 **TIP** > > Deploy clusters in different geographic regions to protect against regional disasters. ## Prerequisites ### License and cluster requirements - The shadow cluster must be a BYOC or Dedicated cluster running Redpanda version 25.3 or later. API-mode Schema Registry replication requires version 26.2 or later. - The source cluster can be another Redpanda cluster, or any Kafka API-compatible cluster such as Apache Kafka, Confluent Cloud, or Confluent Platform. See [Non-Redpanda source clusters](#non-redpanda-source-clusters). - Role synchronization requires Redpanda version 26.2 or later on both the source and shadow clusters. See [Role filtering](#role-filtering). - To configure role synchronization with `rpk`, use `rpk` version 26.2.2 or later. ### Non-Redpanda source clusters The shadow cluster reads from the source cluster through the Kafka API, so the source does not need to be a Redpanda cluster. From any Kafka API-compatible source, Shadowing replicates: - Topic data, with preserved offsets and timestamps - Topic configurations, following the rules in [Topic properties replication](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/overview/#topic-properties-replication) - Consumer group offsets - ACLs The following require a Redpanda source cluster: - **RBAC roles**: If the source is not a Redpanda cluster, leave `role_sync_options` unconfigured. A Roles Migrator task pointed at a non-Redpanda source reports `LINK_UNAVAILABLE` while the rest of the shadow link keeps running. See [Role filtering](#role-filtering). - **Byte-for-byte Schema Registry replication**: Topic mode (`shadow_schema_registry_topic`) shadows Redpanda’s internal `_schemas` topic. To replicate schemas from a Confluent Schema Registry or another Confluent-compatible registry, use API mode (`shadow_schema_registry_api`) instead. See [Migrate Schemas from Confluent Schema Registry](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/migrate-schemas-confluent/). The source cluster must accept one of the authentication methods that the shadow link supports. See [Network and authentication](#network-and-authentication). > 📝 **NOTE** > > Amazon MSK can be a source cluster when SASL/SCRAM-SHA-512 authentication is enabled on the MSK cluster. MSK IAM authentication is not supported. AWS Glue Schema Registry is not supported as a schema source. ### Cluster configuration The shadow cluster must have the [`enable_shadow_linking`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#enable_shadow_linking) cluster property set to `true`. > 📝 **NOTE** > > Starting with Redpanda v25.3, this cluster property is enabled by default on new Redpanda Cloud clusters. For existing clusters on versions earlier than v25.3, you must enable this property manually. See [Configure Cluster Properties](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/). ### Replication service permissions You must configure a service account on the source cluster with the following [ACL](https://docs.redpanda.com/cloud-data-platform/security/authorization/acl/) permissions for shadow link replication: - **Topics**: `read` permission on all topics you want to replicate - **Topic configurations**: `describe_configs` permission on topics for configuration synchronization - **Consumer groups**: `describe` and `read` permission on consumer groups for offset replication - **ACLs**: `describe` permission on ACL resources to replicate security policies - **Cluster**: `describe` permission on the cluster resource to access ACLs This service account authenticates from the shadow cluster to the source cluster and performs the actual data replication. The credentials for this account are provided when you set up the shadow link. ### Network and authentication You must configure network connectivity between clusters with appropriate firewall rules to allow the shadow cluster to connect to the source cluster for data replication. Shadowing uses a pull-based architecture where the shadow cluster fetches data from the source cluster. For detailed networking configuration, see [Networking](#networking). If using [authentication](https://docs.redpanda.com/cloud-data-platform/security/cloud-authentication/) for the shadow link connection, configure the source cluster with your chosen authentication method (SASL/SCRAM, SASL/PLAIN, TLS, mTLS) and ensure the shadow cluster has the proper credentials to authenticate to the source cluster. ## Set up Shadowing To set up Shadowing, you need to create a shadow link and configure filters to select which topics, consumer groups, ACLs, and Schema Registry data to replicate. If using the Cloud API to set up Shadowing, you must [authenticate](https://docs.redpanda.com/api/doc/cloud-controlplane/authentication) to the API by including an access token in your requests. ### Create a shadow link Any BYOC or Dedicated cluster can create a shadow link to a source cluster. > 💡 **TIP** > > You can use `rpk` to generate a sample configuration file with common filter patterns: > > ```bash > # Generate a sample configuration file with placeholder values > rpk shadow config generate --for-cloud -o shadow-config.yaml > ``` > > This creates a complete YAML configuration file that you can customize for your environment. The template includes all available fields with comments explaining their purpose. For detailed command options, see [`rpk shadow config generate --for-cloud`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-config-generate/). Explore the configuration file ```yaml # Sample ShadowLinkConfig YAML with all fields name: # Unique name for this shadow link, example: "production-dr" cloud_options: # Use either source_redpanda_id or bootstrap_servers: only one is required. source_redpanda_id: # Optional: 20 character lowercase ID of the cluster # Example: m7xtv2qq5njbhwruk88f shadow_redpanda_id: # 20 character lowercase ID of the cluster # Example: m7xtv2qq5njbhwruk88f client_options: bootstrap_servers: # Source cluster brokers to connect to - : # Example: "prod-kafka-1.example.com:9092" - : # Example: "prod-kafka-2.example.com:9092" - : # Example: "prod-kafka-3.example.com:9092" source_cluster_id: # Optional: UUID assigned by Redpanda # Example: a882bc98-7aca-40f6-a657-36a0b4daf1fd # This UUID is not available in Redpanda Cloud. # TLS settings using PEM strings tls_settings: enabled: true tls_pem_settings: ca: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- key: ${secrets.} cert: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- # Create SASL credentials in the source cluster. # Then, with this configuration, ensure the shadow cluster uses the credentials # to authenticate to the source cluster. authentication_configuration: # SASL/SCRAM authentication scram_configuration: username: # SASL/SCRAM username, example: "shadow-replication-user" password: ${secrets.} # ID of secret containing SASL/SCRAM password scram_mechanism: SCRAM_SHA_256 # SCRAM mechanism: "SCRAM_SHA_256" or "SCRAM_SHA_512" # SASL/PLAIN authentication: to use SASL/PLAIN instead of SASL/SCRAM, # remove scram_configuration and uncomment the following lines. # plain_configuration: # username: # SASL/PLAIN username, example: "shadow-replication-user" # password: ${secrets.} # ID of secret containing SASL/PLAIN password # Connection tuning - adjust based on network characteristics metadata_max_age_ms: 10000 # How often to refresh cluster metadata (default: 10000ms) connection_timeout_ms: 1000 # Connection timeout (default: 1000ms, increase for high latency) retry_backoff_ms: 100 # Backoff between retries (default: 100ms) fetch_wait_max_ms: 500 # Max time to wait for fetch requests (default: 500ms) fetch_min_bytes: 5242880 # Min bytes per fetch (default: 5MB) fetch_max_bytes: 20971520 # Max bytes per fetch (default: 20MB) fetch_partition_max_bytes: 5242880 # Max bytes per partition fetch (default: 5MB) topic_metadata_sync_options: interval: 30s # How often to sync topic metadata (examples: "30s", "1m", "5m") auto_create_shadow_topic_filters: # Filters for automatic topic creation - pattern_type: LITERAL # Include all topics (wildcard) filter_type: INCLUDE name: '*' - pattern_type: PREFIX # Exclude topics with specific prefix filter_type: EXCLUDE name: # Examples: "temp-", "test-", "debug-" synced_shadow_topic_properties: # Additional topic properties to sync (beyond defaults) - retention.ms # Topic retention time - segment.ms # Segment roll time exclude_default: false # Include default properties (compression, retention, etc.) start_at_earliest: {} # Start from the beginning of source topics (default) paused: false # Enable topic metadata synchronization consumer_offset_sync_options: interval: 30s # How often to sync consumer group offsets paused: false # Enable consumer offset synchronization group_filters: # Filters for consumer groups to sync - pattern_type: LITERAL filter_type: INCLUDE name: '*' # Include all consumer groups security_sync_options: interval: 30s # How often to sync security settings paused: false # Enable security settings synchronization acl_filters: # Filters for ACLs to sync - resource_filter: resource_type: TOPIC # Resource type: "TOPIC", "GROUP", "CLUSTER" pattern_type: PREFIXED # Pattern type: "LITERAL", "PREFIXED" name: # Examples: "prod-", "app-data-" access_filter: principal: User: # Principal name, example: "User:app-service" operation: ANY # Operation: "READ", "WRITE", "CREATE", "DELETE", "ALTER", "DESCRIBE", "ANY" permission_type: ALLOW # Permission: "ALLOW" or "DENY" host: '*' # Host pattern, examples: "*", "10.0.0.0/8", "app-server.example.com" schema_registry_sync_options: # Schema Registry synchronization options shadow_schema_registry_topic: {} # Byte-for-byte _schemas replication (Redpanda source) # For a Confluent source, replace the line above with a # shadow_schema_registry_api block (API mode). See Migrate Schemas # from Confluent Schema Registry. # Role synchronization requires a Redpanda source cluster and v26.2 or # later on both clusters. Omit role_sync_options otherwise. role_sync_options: # RBAC role synchronization options interval: 30s # How often to sync roles paused: false # Enable role synchronization role_name_filters: # Default empty: no roles sync until you add an INCLUDE filter - pattern_type: LITERAL # Pattern type: "LITERAL", "PREFIX" filter_type: INCLUDE # Filter type: "INCLUDE", "EXCLUDE" name: '*' # Include all roles ('*' must be the only character, LITERAL only) ``` Because the shadow cluster pulls from the source cluster, the shadow cluster requires credentials to connect to the source cluster. And because you cannot store plaintext passwords in Redpanda Cloud, you must create a secret to hold the password for the user on the source cluster. If using mTLS, you must also create a secret to hold the key of the client certificate for the client to authenticate. Reference that secret in `client_options.tls_settings.tls_pem_settings.key` in the configuration file. 1. In the shadow cluster, create the secret: #### Cloud UI If the source is a Redpanda Cloud cluster and the source cluster user does not exist yet, create it first: in the source cluster, go to **Security** > **Users**, click **Create user**, and copy the generated password before you close the dialog. Then click **Add permissions** and grant the permissions in [Replication service permissions](#replication-service-permissions) (or, for a test link, allow all operations). For other source clusters, create the user and grant the [Replication service permissions](#replication-service-permissions) with your platform’s tools. In the shadow cluster, go to the **Secrets Store** page and click **Create Secret**. Enter an ID that starts with an uppercase letter and contains only uppercase letters, numbers, and underscores, for example `SOURCE_SASL_PASSWORD`. The **Secrets Store** form also accepts slashes and hyphens, but the shadow link wizard rejects IDs that contain them. Paste the source cluster user’s password as the value, and make sure **Redpanda Cluster** is one of the selected scopes. You enter this secret ID, not the password, when you create the shadow link. #### rpk In the shadow cluster, create a secret to store the authentication credential that the cluster will use (the `password` of `scram_configuration` or `plain_configuration` in the example configuration in the next step). Your secret must be scoped to "Redpanda Cluster". Use [`rpk security secret create`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-security/rpk-security-secret-create/) to create the secret from the command line. #### Data Plane API In the shadow cluster, create a secret to store the authentication credential that the cluster will use (the `password` of `scram_configuration` or `plain_configuration` in the example configuration in the next step). Your secret must be scoped to "Redpanda Cluster". Use the [Data Plane API](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-dataplane-api/) to programmatically create the secret. #### Terraform With Terraform, you define the secret and the shadow link together: the [`redpanda_secret` resource](https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs/resources/secret) in the next step’s Terraform tab creates this secret as part of the same configuration, so there is nothing to do in this step. 2. In the shadow cluster, create a shadow link to the source cluster. #### Cloud UI 1. At the organization level of the Cloud UI, navigate to **Shadow Link**. You can also start from a cluster’s **Shadow Links** page by clicking **Create shadow link in Redpanda Cloud**. 2. Click **Create shadow link**. The Cloud UI guides you through the following steps. 3. On the **Connection** step: 1. Enter a unique name for the shadow link. The name must start and end with lowercase alphanumeric characters, hyphens allowed. 2. Select where the replicated data comes from: **Redpanda Cloud cluster** for an existing Redpanda Cloud cluster, or **Bootstrap URL** to connect to any Kafka-compatible cluster. 3. Configure TLS for the connection. **Enable TLS** is on by default. Optionally, expand **Use a custom CA certificate** to add the CA for a self-signed or private certificate on the source cluster, or **Use mutual TLS (mTLS)** to add a client certificate. 4. Under **Authentication method**, select **SCRAM** or **PLAIN**. Enter the **Username** of the source cluster user and, in the **Password** field, the ID of the secret that contains the password, created in the previous step. For SCRAM, also select the **SASL mechanism**. SASL/PLAIN sends the username and password unhashed, so use it only over a TLS-encrypted connection. SASL/SCRAM is the recommended method. 5. Optionally, expand **Advanced options** to configure client connection settings. 4. On the **Shadow** step, select the shadow cluster that receives the replicated data. 5. On the **Source** step, select the source cluster. This step appears only when the source is an existing Redpanda Cloud cluster. If you selected **Bootstrap URL**, the wizard skips this step. 6. On the **Configuration** step, specify what to shadow from the source cluster: topics, ACLs, roles, consumer groups, and Schema Registry data. The **Roles** section appears only when the shadow cluster runs Redpanda version 26.2 or later. See [Role filtering](#role-filtering). For a Confluent source, configure the **Shadow Schema Registry** section as described in [Migrate Schemas from Confluent Schema Registry](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/migrate-schemas-confluent/). 7. Click **Create shadow link**. #### rpk 1. Run `rpk cloud login`. Select your shadow cluster when prompted. 2. To create a shadow link with the source cluster using `rpk`, run the following command from the shadow cluster: ```bash # When logged in, optionally create a new rpk profile to easily # switch to the shadow cluster rpk profile create --from-cloud shadow-cluster # Use the generated configuration file to create the shadow link rpk shadow create --config-file shadow-config.yaml ``` For detailed command options, see [`rpk shadow create`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-create/). > 💡 **TIP** > > Use [`rpk profile`](https://docs.redpanda.com/cloud-data-platform/manage/rpk/config-rpk-profile/) to save your cluster connection details and credentials for both source and shadow clusters. This allows you to easily switch between the two configurations. #### Control Plane API To create a shadow link using the Control Plane API, make a `POST /shadow-links` request from the shadow cluster: ```bash curl -X POST 'https://api.redpanda.com/v1/shadow-links' \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" \ -d '{ "shadow_link": { "shadow_redpanda_id": "", "name": "", "client_options": { "bootstrap_servers": [":", ":", ":"], "tls_settings": { "enabled": true }, "authentication_configuration": { "scram_configuration": { "username": "", "password": "${secrets.}", "scram_mechanism": "SCRAM_MECHANISM_SCRAM_SHA_256" } } }, "topic_metadata_sync_options": { "interval": "30s", "auto_create_shadow_topic_filters": [ { "name": "*", "filter_type": "FILTER_TYPE_INCLUDE", "pattern_type": "PATTERN_TYPE_LITERAL" }, { "name": "", "filter_type": "FILTER_TYPE_EXCLUDE", "pattern_type": "PATTERN_TYPE_PREFIX" } ], "start_at_earliest": {}, "paused": false }, "consumer_offset_sync_options": { "paused": true }, "security_sync_options": { "paused": true } } }' ``` Replace the placeholders with your own values: - ``: ID of the shadow (destination) cluster. - ``: Unique name for this shadow link, for example, `production-dr`. - `:`, `: …​`: Source cluster brokers to connect to, for example, `prod-kafka-1.example.com:9092`, `prod-kafka-2.example.com:9092`. - ``: SASL username, for example, `shadow-replication-user`. You create this user in the source cluster. - ``: The ID of the secret containing the SASL password from the source cluster. - ``: Exclude topics that use this prefix, for example, `temp-`, `test-`, `debug-`. The response object represents the [long-running operation](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-byoc-controlplane-api/#lro) of creating a shadow link. To authenticate with SASL/PLAIN instead of SASL/SCRAM, replace the `scram_configuration` object with a `plain_configuration` object that contains `username` and `password`. As with SCRAM, the password must be a secret reference in the form `${secrets.}`; the API rejects a plaintext password. To replicate RBAC roles, add a `role_sync_options` object. See [Role filtering](#role-filtering). To include Schema Registry replication in the request, add a `schema_registry_sync_options` object; for the API-mode request used to replicate from a Confluent Schema Registry, see [Migrate Schemas from Confluent Schema Registry](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/migrate-schemas-confluent/). For the full API reference, see [Control Plane API reference](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-shadowlinkservice_createshadowlink). #### Terraform Manage shadow links declaratively with the [`redpanda_shadow_link` resource](https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs/resources/shadow_link) in the [Redpanda Terraform provider](https://registry.terraform.io/providers/redpanda-data/redpanda/latest) (version 2.0.0 or later). The resource supports the full shadow link lifecycle: create, update, import, and destroy. Store the SASL/SCRAM password for the source cluster user in the shadow cluster’s secret store with the [`redpanda_secret` resource](https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs/resources/secret) (see [Manage cluster secrets](https://docs.redpanda.com/cloud-data-platform/manage/terraform-provider/#manage-cluster-secrets) for naming, write-only behavior, and rotation), then reference the secret from the shadow link configuration: ```hcl resource "redpanda_secret" "source_password" { name = "" secret_data = var.source_user_password secret_data_version = 1 # Increment when you rotate the password. scopes = ["SCOPE_REDPANDA_CLUSTER"] cluster_api_url = redpanda_cluster.shadow.cluster_api_url } resource "redpanda_shadow_link" "production_dr" { name = "" shadow_redpanda_id = "" source_redpanda_id = "" client_options = { tls_settings = { enabled = true } authentication_configuration = { scram_configuration = { scram_mechanism = "SCRAM_SHA_256" username = "" password = "$${secrets.${redpanda_secret.source_password.name}}" } } } } ``` Replace the placeholders with your own values: - ``: Name for the secret that stores the SASL/SCRAM password. Must be uppercase, matching `^[A-Z][A-Z0-9_]*$`, for example, `SOURCE_SCRAM_PASSWORD`. - ``: Unique name for this shadow link, for example, `production-dr`. - ``: ID of the shadow (destination) cluster. - ``: ID of the source cluster. For a source cluster that is not managed in Redpanda Cloud, omit `source_redpanda_id` and set `client_options.bootstrap_servers` instead. - ``: SASL username, for example, `shadow-replication-user`. You create this user in the source cluster, and you can manage it with the [`redpanda_user` resource](https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs/resources/user). Grant it the permissions listed in [Replication service permissions](#replication-service-permissions), which you can manage with the [`redpanda_acl` resource](https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs/resources/acl). To configure topic, consumer group, ACL, Schema Registry, and role synchronization, add the corresponding option blocks (`topic_metadata_sync_options`, `consumer_offset_sync_options`, `security_sync_options`, `schema_registry_sync_options`, `role_sync_options`) to the resource. The `role_sync_options` block requires provider version 2.3.0 or later. To authenticate with SASL/PLAIN, use a `plain_configuration` block in place of `scram_configuration`. For the `shadow_schema_registry_api` block used to replicate from a Confluent Schema Registry, see [Migrate Schemas from Confluent Schema Registry](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/migrate-schemas-confluent/). For the full schema and a complete working example, see the [`redpanda_shadow_link` reference](https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs/resources/shadow_link) and the [provider example](https://github.com/redpanda-data/terraform-provider-redpanda/blob/main/examples/shadow_link/main.tf). > 📝 **NOTE** > > If you manage the shadow cluster with the [`redpanda_cluster` resource](https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs/resources/cluster), you can set the `enable_shadow_linking` cluster property in `cluster_configuration.custom_properties_json`. > > To protect against accidental deletion, Terraform refuses to destroy a shadow link unless the resource sets `allow_deletion = true`. ### Set filters Filters determine which resources Shadowing automatically creates when establishing your shadow link. Topic filters select which topics Shadowing automatically creates as shadow topics when they appear on the source cluster. After Shadowing creates a shadow topic, it continues replicating until you failover the topic, delete it, or delete the entire shadow link. Consumer group and ACL filters control which groups and security policies replicate to maintain application functionality. #### Filter types and patterns Each filter uses two key settings: - **Pattern type**: Determines how names are matched - `LITERAL`: Matches names exactly (including the special wildcard `*` to match all items) - `PREFIX`: Matches names that start with the specified string - **Filter type**: Specifies whether to INCLUDE or EXCLUDE matching items - `INCLUDE`: Replicate items that match the pattern - `EXCLUDE`: Skip items that match the pattern #### Filter processing rules Redpanda processes filters in the order you define them with EXCLUDE filters taking precedence. Design your filter lists carefully: 1. **Exclude filters win**: If any EXCLUDE filter matches a resource, it is excluded regardless of INCLUDE filters. 2. **Order matters for INCLUDE filters**: Among INCLUDE filters, the first match determines the result. 3. **Default behavior**: Items that don’t match any filter are excluded from replication. #### Common filtering patterns Replicate all topics except test topics: ```yaml topic_metadata_sync_options: auto_create_shadow_topic_filters: - pattern_type: PREFIX filter_type: EXCLUDE name: test- # Exclude all test topics - pattern_type: LITERAL filter_type: INCLUDE name: '*' # Include all other topics ``` Replicate only production topics: ```yaml topic_metadata_sync_options: auto_create_shadow_topic_filters: - pattern_type: PREFIX filter_type: INCLUDE name: prod- # Include production topics - pattern_type: PREFIX filter_type: INCLUDE name: production- # Alternative production prefix ``` Replicate specific consumer groups: ```yaml consumer_offset_sync_options: group_filters: - pattern_type: LITERAL filter_type: INCLUDE name: critical-app-consumers # Include specific consumer group - pattern_type: PREFIX filter_type: INCLUDE name: prod-consumer- # Include production consumers ``` #### Schema Registry synchronization Shadowing can replicate Schema Registry data in one of two modes: - **Topic mode** (`shadow_schema_registry_topic`): Shadows the `_schemas` system topic for byte-for-byte replication of schema definitions, versions, and compatibility settings from another Redpanda cluster. - **API mode** (`shadow_schema_registry_api`): Polls the source Schema Registry over HTTP and imports selected contexts and subjects, with validation. Use this mode to replicate schemas from a Confluent Schema Registry, or to replicate only part of the source registry. See [Migrate Schemas from Confluent Schema Registry](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/migrate-schemas-confluent/). A shadow link uses one mode or the other, not both. To enable topic mode, add the following to your shadow link configuration: ```yaml schema_registry_sync_options: shadow_schema_registry_topic: {} ``` To enable API mode instead, add a `shadow_schema_registry_api` block; its connection, filtering, and mapping options are described in [Migrate Schemas from Confluent Schema Registry](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/migrate-schemas-confluent/). Topic mode requirements: - The `_schemas` topic must exist on the source cluster - The `_schemas` topic must not exist on the shadow cluster, or must be empty - Once enabled, the `_schemas` topic will be replicated completely Important: After the `_schemas` topic becomes a shadow topic, it cannot be stopped without either failing over the topic or deleting it entirely. #### System topic filtering rules Redpanda system topics have the following specific filtering restrictions: - Literal filters for `__consumer_offsets` and `_redpanda.audit_log` are rejected. - Prefix filters for topics starting with `_redpanda` or `__redpanda` are rejected. - Wildcard `*` filters will not match topics that start with `_redpanda` or `__redpanda`. - To shadow specific system topics, you must provide explicit literal filters for those individual topics. #### ACL filtering ACLs are replicated by the [Security Migrator task](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/overview/#shadow-link-tasks). This is recommended to ensure that your shadow cluster has the same permissions as your source cluster. To configure ACL filters: ```yaml security_sync_options: acl_filters: # Include read permissions for production topics - resource_filter: resource_type: TOPIC # Filter by topic resource pattern_type: PREFIXED # Match by prefix name: prod- # Production topic prefix access_filter: principal: User:app-user # Application service user operation: READ # Read operation permission_type: ALLOW # Allow permission host: '*' # Any host # Include consumer group permissions - resource_filter: resource_type: GROUP # Filter by consumer group pattern_type: LITERAL # Exact match name: '*' # All consumer groups access_filter: principal: User:app-user # Same application user operation: READ # Read operation permission_type: ALLOW # Allow permission host: '*' # Any host ``` #### Role filtering After a failover, your users and applications need the same permissions on the shadow cluster that they had on the source. Role synchronization prepares the shadow cluster for that moment: the [Roles Migrator task](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/overview/#roles-migrator-task) periodically reads [RBAC](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac_dp/) role definitions and role memberships from the source cluster and mirrors them to the shadow cluster. Use role synchronization together with [ACL filters](#acl-filtering) whenever your authorization model uses roles, so that role-based permissions keep working after failover. > ❗ **IMPORTANT** > > In the configuration file, `rpk`, the Control Plane API, and Terraform, no roles are replicated by default: the `role_name_filters` list defaults to empty, which synchronizes nothing. Add at least one `INCLUDE` filter to start replicating roles. When you create a shadow link in the Cloud UI, the default is **All roles**. To replicate all roles: ```yaml role_sync_options: interval: 30s # How often to sync roles role_name_filters: - pattern_type: LITERAL filter_type: INCLUDE name: '*' # '*' must be the only character and requires LITERAL ``` Role filters use the same pattern and filter types as topic filters: `pattern_type` is `LITERAL` or `PREFIX`, and `filter_type` is `INCLUDE` or `EXCLUDE`. When you create a shadow link in the Cloud UI, configure role filters in the **Roles** section of the **Configuration** step: - **All roles**: Replicates every role. This is equivalent to a single `INCLUDE` filter with the literal name `*`, and it is the default. - **Specify roles**: Replicates only the roles that match the filters you add. Each filter takes a role name and a match mode: **Include specific roles**, **Include starting with**, **Exclude specific**, or **Exclude starting with**. The four modes correspond to the `filter_type` and `pattern_type` combinations above. Click **Add filter** to add another filter. The **Roles** section appears only when the shadow cluster runs Redpanda version 26.2 or later. If the shadow cluster’s version does not support role synchronization, the Control Plane API rejects a request that sets any `role_sync_options` field. The Cloud UI does not expose the `interval` or `paused` settings: a link created in the Cloud UI uses the default sync interval, and pausing role synchronization requires `role_sync_options` in the configuration file with `rpk`, the Control Plane API, or Terraform. To change role filters on an existing link, select the link, click **Edit**, and use the **Roles** card on the **Shadowing** tab. When the link has no role synchronization configured, the card starts on **Specify roles** with no filters, and role synchronization stays off unless you add a filter or select **All roles**. Within the configured filters, the Roles Migrator task keeps the shadow cluster’s roles as a full mirror of the source: - The task creates roles that exist on the source but not on the shadow. - The task updates roles whose membership changed on the source. - The task deletes roles that were deleted on the source. The task does not modify roles on the shadow cluster that fall outside your filters. Role synchronization replicates role definitions and memberships only: - **Shadowing does not replicate user credentials.** Manage and distribute credentials outside of Shadowing, and provision users on the shadow cluster before failover. - **Role synchronization does not replicate the ACLs bound to roles.** Configure [ACL filters](#acl-filtering) as well, so that both the roles and the permissions granted to them exist on the shadow cluster. Role synchronization uses the same connection and service account as the rest of the shadow link. The cluster `describe` permission already required for ACL replication also covers role reads, and no additional network configuration is required. Both the source and shadow clusters must be running Redpanda 26.2 or later. If the source is not a Redpanda cluster, or is a Redpanda cluster running a version earlier than 26.2, the Roles Migrator task enters the `LINK_UNAVAILABLE` state, without affecting the other tasks on the link. Role synchronization continues to run after a [failover](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/failover/). Failover acts on topic data only: it stops topic replication and makes shadow topics writable, but the sync tasks, including the Roles Migrator, keep running on their intervals. To stop role synchronization, set `paused: true` in `role_sync_options`, or delete the shadow link. To monitor role synchronization, run [`rpk shadow status`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-status/). The Roles Migrator task’s `Reason` field reports the counts from the most recent sync cycle, for example: `Synced roles: 2 created, 0 updated, 0 deleted, 0 failures`. In the Cloud UI, the **Tasks** tab of the shadow link also shows the status of the Roles Migrator task. #### Consumer group filtering and behavior Consumer group filters determine which consumer groups have their offsets replicated to the shadow cluster by the [Consumer Group Shadowing task](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/overview/#shadow-link-tasks). Offset replication operates selectively within each consumer group. Only committed offsets for active shadow topics are synchronized, even if the consumer group has offsets for additional topics that aren’t being shadowed. For example, if consumer group "app-consumers" has committed offsets for "orders", "payments", and "inventory" topics, but only "orders" is an active shadow topic, then only the "orders" offsets will be replicated to the shadow cluster. ```yaml consumer_offset_sync_options: interval: 30s # How often to sync consumer group offsets paused: false # Enable consumer offset synchronization group_filters: - pattern_type: PREFIX filter_type: INCLUDE name: prod-consumer- # Include production consumer groups - pattern_type: LITERAL filter_type: EXCLUDE name: test-consumer-group # Exclude specific test groups ``` ##### Important consumer group considerations **Avoid name conflicts:** If you plan to consume data from the shadow cluster, do not use the same consumer group names as those used on the source cluster. While this won’t break shadow linking, it can impact your RPO/RTO because conflicting group names may interfere with offset replication and consumer resumption during disaster recovery. **Offset clamping:** When Redpanda replicates consumer group offsets from the source cluster, offsets are automatically "clamped" during the commit process on the shadow cluster. If a committed offset from the source cluster is above the high watermark (HWM) of the corresponding shadow partition, Redpanda clamps the offset to the shadow partition’s HWM before committing it to the shadow cluster. This ensures offsets remain valid and prevents consumers from seeking beyond available data on the shadow cluster. #### Starting offset for new shadow topics When the [Source Topic Sync task](https://docs.redpanda.com/cloud-data-platform/manage/disaster-recovery/shadowing/overview/#shadow-link-tasks) creates a shadow topic for the first time, you can control where replication begins on the source topic. This setting only applies to empty shadow partitions and is crucial for disaster recovery planning. Changing this configuration only affects new shadow topics, existing shadow topics continue replicating from their current position. ```yaml topic_metadata_sync_options: start_at_earliest: {} ``` Alternatively, to start from the most recent offset: ```yaml topic_metadata_sync_options: start_at_latest: {} ``` Or to start from a specific timestamp: ```yaml topic_metadata_sync_options: start_at_timestamp: 2024-01-01T00:00:00Z ``` Starting offset options: - **`earliest`** (default): This replicates all existing data from the source topic. Use this for complete disaster recovery where you need full data history. - **`latest`**: This starts replication from the current end of the source topic, skipping existing data. Use this when you only need new data for disaster recovery and want to minimize initial replication time. - **`timestamp`**: This starts replication from the first record with a timestamp at or after the specified time. Use this for point-in-time disaster recovery scenarios. > ❗ **IMPORTANT** > > The starting offset only affects **new shadow topics**. After a shadow topic exists and has data, changing this setting has no effect on that topic’s replication. #### Networking Configure network connectivity between your source and shadow clusters to enable shadow link replication. The shadow cluster initiates connections to the source cluster using a pull-based architecture. For additional details about networking, see [Network and authentication](#network-and-authentication). ##### Connection requirements - **Direction**: Shadow cluster connects to source cluster (outbound from shadow, inbound to source) - **Protocol**: Kafka protocol over TCP (default port 9092, or your configured listener ports) - **Persistence**: Connections remain active for continuous replication ##### Firewall configuration You must configure firewall rules to allow the shadow cluster to reach the source cluster. **On the source cluster network:** - Allow inbound TCP connections on Kafka listener ports (typically 9092). - Allow connections from the shadow cluster’s IP addresses or subnets. **On the shadow cluster network:** - Allow outbound TCP connections to the source cluster’s Kafka listener ports. - Ensure DNS resolution works for source cluster hostnames. ##### Bootstrap servers Specify multiple bootstrap servers in your shadow link configuration for high availability: ```yaml client_options: bootstrap_servers: # Source cluster brokers to connect to - : # Example: "prod-kafka-1.example.com:9092" - : # Example: "prod-kafka-2.example.com:9092" - : # Example: "prod-kafka-3.example.com:9092" ``` The shadow cluster uses these addresses to discover all brokers in the source cluster. If one bootstrap server is unavailable, the shadow cluster tries the next one in the list. ##### Network security For production deployments, secure the network connection between clusters: TLS encryption: ```yaml client_options: tls_settings: enabled: true # Enable TLS tls_pem_settings: ca: |- # CA certificate in PEM format -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- key: ${secrets.} # Client private key (can use secrets reference) cert: |- # Optional: Client certificate in PEM format for mutual TLS -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- do_not_set_sni_hostname: false # Optional: Skip SNI hostname when using TLS (default: false) ``` Authentication: ```yaml client_options: authentication_configuration: # SASL/SCRAM authentication. # Create SASL credentials in the source cluster. # Then, with this configuration, ensure the shadow cluster uses the credentials # to authenticate to the source cluster. scram_configuration: username: # SASL/SCRAM username, example: "shadow-replication-user" password: ${secrets.} # ID of secret containing SASL/SCRAM password scram_mechanism: SCRAM_SHA_256 # SCRAM mechanism: "SCRAM_SHA_256" or "SCRAM_SHA_512" # SASL/PLAIN authentication: to use SASL/PLAIN instead of SASL/SCRAM, # remove scram_configuration and uncomment the following lines. # plain_configuration: # username: # SASL/PLAIN username, example: "shadow-replication-user" # password: ${secrets.} # ID of secret containing SASL/PLAIN password ``` ##### Connection tuning Adjust connection parameters based on your network characteristics. For example: ```yaml client_options: # Connection and metadata settings connection_timeout_ms: 1000 # Default 1000ms, increase for high-latency networks retry_backoff_ms: 100 # Default 100ms, backoff between connection retries metadata_max_age_ms: 10000 # Default 10000ms, how often to refresh cluster metadata # Fetch request settings fetch_wait_max_ms: 500 # Default 500ms, max time to wait for fetch requests fetch_min_bytes: 5242880 # Default 5MB, minimum bytes to fetch per request fetch_max_bytes: 20971520 # Default 20MB, maximum bytes to fetch per request fetch_partition_max_bytes: 5242880 # Default 5MB, maximum bytes to fetch per partition ``` ## Update an existing shadow link To modify a shadow link configuration after creation, run: ### Cloud UI 1. At the organization level of the Cloud UI, navigate to **Shadow Link**. 2. Select the shadow link you want to modify, and click **Edit**. 3. Edit the shadow link settings or the shadowing behavior by specifying which content from the source cluster to shadow (topics, ACLs, roles, consumer groups, Schema Registry). You can also enable additional topic properties to be shadowed or disable optional topic properties from being included in the shadowing. 4. Click **Save** to apply changes. ### rpk ```bash rpk shadow update ``` For detailed command options, see [`rpk shadow update`](https://docs.redpanda.com/cloud-data-platform/reference/rpk/rpk-shadow/rpk-shadow-update/). This opens your default editor with the current shadow link configuration. To apply a configuration file without opening an editor, such as in a script, use the `--config-file` flag. This flag requires `rpk` v26.2.2 or later. ```bash rpk shadow update --config-file shadow-config.yaml ``` The `name` in the file must match the shadow link name. You cannot change the shadow link name. To rename a shadow link, delete it and create a new one. With `rpk` v26.2.2 and later, the configuration that you submit replaces the entire shadow link configuration. Any field that you omit is reset to its default value. ### Control Plane API ```bash curl -X PATCH 'https://api.redpanda.com/v1/shadow-links/' \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" \ -d '{ "security_sync_options": { "paused": false } }' ``` This endpoint returns a [long-running operation](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-byoc-controlplane-api/#lro). For the full API reference, see [Control Plane API reference](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-shadowlinkservice_updateshadowlink). ### Terraform Edit the `redpanda_shadow_link` resource configuration and run `terraform apply`. The provider sends only the changed fields to the API. The shadow link name and cluster IDs are immutable: if you change them, Terraform plans a replacement (destroy and recreate) instead of an update. The destroy step of a replacement succeeds only when the resource sets `allow_deletion = true`, the same guard described in the create step. --- # Page 410: Integrate Redpanda with Iceberg **URL**: https://docs.redpanda.com/cloud-data-platform/manage/iceberg.md --- # Integrate Redpanda with Iceberg - [About Iceberg Topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/about-iceberg-topics/) Learn how Redpanda can integrate topics with Apache Iceberg. - [Migrate to Iceberg Topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/migrate-to-iceberg-topics/) Migrate existing Iceberg integrations to Redpanda Iceberg topics. - [Specify Iceberg Schema](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/specify-iceberg-schema/) Learn about supported Iceberg modes and how you can integrate schemas with Iceberg topics. - [Use Iceberg Catalogs](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/) Learn how to access Redpanda topic data stored in Iceberg tables, using table metadata or a catalog integration. - [Integrate with REST Catalogs](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/rest-catalog/) Integrate Redpanda topics with managed Iceberg REST Catalogs. - [Query Iceberg Topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/query-iceberg-topics/) Query Redpanda topic data stored in Iceberg tables, based on the topic Iceberg mode and schema. - [Migrate Iceberg Catalogs](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/migrate-iceberg-catalog/) Switch the Iceberg catalog backend for an existing Redpanda cluster without losing untranslated topic data. - [Tune Performance for Iceberg Topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-performance-tuning/) Optimize query performance and translation throughput for Iceberg topics with partitioning, compaction, lag target tuning, and cluster sizing guidance. - [Troubleshoot Iceberg Topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-troubleshooting/) Diagnose and resolve errors in Redpanda Iceberg translation, including dead-letter queue (DLQ) inspection and record reprocessing. --- # Page 411: About Iceberg Topics **URL**: https://docs.redpanda.com/cloud-data-platform/manage/iceberg/about-iceberg-topics.md --- # About Iceberg Topics The Apache Iceberg integration for Redpanda allows you to store topic data in the cloud in the Iceberg open table format. This makes your streaming data immediately available in downstream analytical systems, including data warehouses like Snowflake, Databricks, ClickHouse, and Redshift, without setting up and maintaining additional ETL pipelines. You can also integrate your data directly into commonly-used big data processing frameworks, such as Apache Spark and Flink, standardizing and simplifying the consumption of streams as tables in a wide variety of data analytics pipelines. Redpanda supports [version 2](https://iceberg.apache.org/spec/#format-versioning) of the Iceberg table format. ## Iceberg concepts [Apache Iceberg](https://iceberg.apache.org) is an open source format specification for defining structured tables in a data lake. The table format lets you quickly and easily manage, query, and process huge amounts of structured and unstructured data. This is similar to the way you would manage and run SQL queries against relational data in a database or data warehouse. The open format lets you use many different languages, tools, and applications to process the same data in a consistent way, so you can avoid vendor lock-in. This data management system is also known as a _data lakehouse_. In the Iceberg specification, tables consist of the following layers: - **Data layer**: Stores the data in data files. The Iceberg integration currently supports the Parquet file format. Parquet files are column-based and suitable for analytical workloads at scale. They come with compression capabilities that optimize files for object storage. - **Metadata layer**: Stores table metadata separately from data files. The metadata layer allows multiple writers to stage metadata changes and apply updates atomically. It also supports database snapshots, and time travel queries that query the database at a previous point in time. - Manifest files: Track data files and contain metadata about these files, such as record count, partition membership, and file paths. - Manifest list: Tracks all the manifest files belonging to a table, including file paths and upper and lower bounds for partition fields. - Metadata file: Stores metadata about the table, including its schema, partition information, and snapshots. Whenever a change is made to the table, a new metadata file is created and becomes the latest version of the metadata in the catalog. For Iceberg-enabled topics, the manifest files are in JSON format. - **Catalog**: Contains the current metadata pointer for the table. Clients reading and writing data to the table see the same version of the current state of the table. The Iceberg integration supports two [catalog integration](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/) types. You can configure Redpanda to catalog files stored in the same object storage bucket or container where the Iceberg data files are located, or you can configure Redpanda to use an [Iceberg REST catalog](https://iceberg.apache.org/terms/#decoupling-using-the-rest-catalog) endpoint to update an externally-managed catalog when there are changes to the Iceberg data and metadata. ![Redpanda’s Iceberg integration](https://docs.redpanda.com/cloud-data-platform/shared/_images/iceberg-integration-optimized.png) When you enable the Iceberg integration for a Redpanda topic, Redpanda brokers store streaming data in the Iceberg-compatible format in Parquet files in object storage, in addition to the log segments uploaded using Tiered Storage. Storing the streaming data in Iceberg tables in the cloud allows you to derive real-time insights through many compatible data lakehouse, data engineering, and business intelligence [tools](https://iceberg.apache.org/vendors/). ## Prerequisites To enable Iceberg for Redpanda topics, you must have the following: - A running [BYOC](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/) or BYOVPC cluster on Redpanda version 25.1 or later. The Iceberg integration is supported only for BYOC and BYOVPC, and the cluster properties to configure Iceberg are available with v25.1. - rpk: See [Install or Update rpk](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/). - Familiarity with the Redpanda Cloud API. You must [authenticate](https://docs.redpanda.com/api/doc/cloud-controlplane/authentication) to the Cloud API and use the Control Plane API to update your cluster configuration. ## Limitations - It is not possible to append topic data to an existing Iceberg table that is not created by Redpanda. - If you enable the Iceberg integration on an existing Redpanda topic, Redpanda does not backfill the generated Iceberg table with topic data. - JSON schemas are supported starting with Redpanda version 25.2. ## Enable Iceberg integration To create an Iceberg table for a Redpanda topic, you must set the cluster configuration property `iceberg_enabled` to `true`, and also configure the topic property `redpanda.iceberg.mode`. You can choose to provide a schema if you need the Iceberg table to be structured with defined columns. 1. Set the `iceberg_enabled` configuration option on your cluster to `true`. When multiple clusters write to the same catalog, each cluster must use a distinct namespace to avoid table name collisions. This is especially critical for REST catalog providers that offer a single global catalog per account (such as AWS Glue), where there is no other isolation mechanism. By default, Redpanda creates Iceberg tables in a namespace called `redpanda`. To use a unique namespace for your cluster’s REST catalog integration, also set `iceberg_default_catalog_namespace` when you set `iceberg_enabled`. You cannot change this property after you enable Iceberg topics on the cluster. #### rpk ```bash rpk cloud login rpk profile create --from-cloud rpk cluster config set iceberg_enabled true # Optional: set a custom namespace (default is "redpanda") # rpk cluster config set iceberg_default_catalog_namespace '[""]' ``` #### Cloud API ```bash # Store your cluster ID in a variable export RP_CLUSTER_ID= # Retrieve a Redpanda Cloud access token export RP_CLOUD_TOKEN=`curl -X POST "https://auth.prd.cloud.redpanda.com/oauth/token" \ -H "content-type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials" \ -d "client_id=" \ -d "client_secret="` # Update cluster configuration to enable Iceberg topics # Optional: to set a custom namespace (default is "redpanda"), # add "iceberg_default_catalog_namespace":[""] to custom_properties curl -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" -X PATCH \ "https://api.cloud.redpanda.com/v1/clusters/${RP_CLUSTER_ID}" \ -H 'accept: application/json'\ -H 'content-type: application/json' \ -d '{"cluster_configuration":{"custom_properties": {"iceberg_enabled":true}}}' ``` The [`PATCH /clusters/{cluster.id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster) request returns the ID of a long-running operation. The operation may take up to ten minutes to complete. You can check the status of the operation by polling the [`GET /operations/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-operationservice_getoperation) endpoint. 2. (Optional) Create a new topic. ```bash rpk topic create ``` ```bash TOPIC STATUS OK ``` 3. Configure `redpanda.iceberg.mode` for the topic. You can choose one of the following [Iceberg modes](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/specify-iceberg-schema/): - `key_value`: Creates an Iceberg table using a simple schema, consisting of two columns, one for the record metadata including the key, and another binary column for the record’s value. - `value_schema_id_prefix`: Creates an Iceberg table whose structure matches the Redpanda schema for this topic, with columns corresponding to each field. You must register a schema in the Schema Registry (see next step), and producers must write to the topic using the Schema Registry wire format. - `value_schema_latest`: Creates an Iceberg table whose structure matches the latest schema registered for the subject in the Schema Registry. - `disabled` (default): Disables writing to an Iceberg table for this topic. ```bash rpk topic alter-config --set redpanda.iceberg.mode= ``` ```bash TOPIC STATUS OK ``` 4. Register a schema for the topic. This step is required for the `value_schema_id_prefix` and `value_schema_latest` modes. ```bash rpk registry schema create --schema --type ``` ```bash SUBJECT VERSION ID TYPE 1 1 PROTOBUF ``` ### Access Iceberg data To query the Iceberg table, you need access to the object storage bucket or container where the Iceberg data is stored. For BYOC clusters, the bucket name and table location are as follows: | Cloud provider | Bucket or container name | Iceberg table location | | --- | --- | --- | | AWS | `redpanda-cloud-storage-` | `redpanda-iceberg-catalog/redpanda/` | | Azure | ``
The Redpanda cluster ID is also used as the container name (ID) and the storage account ID. | | | GCP | `redpanda-cloud-storage-` | | For BYOVPC clusters, the bucket name is the name you chose when you created the object storage bucket as a customer-managed resource. For Azure clusters, you must add the public IP addresses or ranges from the REST catalog service, or other clients requiring access to the Iceberg data, to your cluster’s allow list. Alternatively, add subnet IDs to the allow list if the requests originate from the same Azure region. For example, to add subnet IDs to the allow list through the Control Plane API [`PATCH /v1/clusters/`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster) endpoint, run: ```bash curl -X PATCH https://api.cloud.redpanda.com/v1/clusters/ \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" \ -d @- << EOF { "cloud_storage": { "azure": { "allowed_subnet_ids": [ ] } } } EOF ``` As you produce records to the topic, the data also becomes available in object storage for Iceberg-compatible clients to consume. You can use the same analytical tools to [read the Iceberg topic data](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/query-iceberg-topics/) in a data lake as you would for a relational database. See also: [Schema types translation](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/specify-iceberg-schema/#schema-types-translation). ### Iceberg data retention Data in an Iceberg-enabled topic is consumable from Kafka based on the configured [topic retention policy](https://docs.redpanda.com/cloud-data-platform/develop/topics/create-topic/). Conversely, data written to Iceberg remains queryable as Iceberg tables indefinitely. The Iceberg table persists unless you: - Delete the Redpanda topic associated with the Iceberg table. This is the default behavior set by the `iceberg_delete` cluster property and the `redpanda.iceberg.delete` topic property. If you set this property to `false`, the Iceberg table remains even after you delete the topic. - Explicitly delete data from the Iceberg table using a query engine. - Disable the Iceberg integration for the topic and delete the Parquet files in object storage. The DLQ table (`~dlq`) follows the same persistence rules as the main Iceberg table. ## Schema evolution Redpanda supports schema evolution in accordance with the [Iceberg specification](https://iceberg.apache.org/spec/#schema-evolution). Permitted schema evolutions include reordering fields and promoting field types. When you update the schema in Schema Registry, Redpanda automatically updates the Iceberg table schema to match the new schema. For example, if you produce records to a topic `demo-topic` with the following Avro schema: schema_1.avsc ```avro { "type": "record", "name": "ClickEvent", "fields": [ { "name": "user_id", "type": "int" }, { "name": "event_type", "type": "string" } ] } ``` ```bash rpk registry schema create demo-topic-value --schema schema_1.avsc echo '{"user_id":23, "event_type":"BUTTON_CLICK"}' | rpk topic produce demo-topic --format='%v\n' --schema-id=topic ``` Then, you update the schema to add a new field `ts`, and produce records with the updated schema: schema_2.avsc ```avro { "type": "record", "name": "ClickEvent", "fields": [ { "name": "user_id", "type": "int" }, { "name": "event_type", "type": "string" }, { "name": "ts", "type": [ "null", { "type": "long", "logicalType": "timestamp-millis" } ], "default": null # Default value for the new field } ] } ``` The `ts` field can be either null or a long representing epoch milliseconds. The default value is null. ```bash rpk registry schema create demo-topic-value --schema schema_2.avsc echo '{"user_id":858, "event_type":"BUTTON_CLICK", "ts":1737998723230}' | rpk topic produce demo-topic --format='%v\n' --schema-id=topic ``` Querying the Iceberg table for `demo-topic` includes the new column `ts`: ```bash +---------+--------------+--------------------------+ | user_id | event_type | ts | +---------+--------------+--------------------------+ | 858 | BUTTON_CLICK | 2025-02-26T20:05:23.230Z | | 23 | BUTTON_CLICK | NULL | +---------+--------------+--------------------------+ ``` ## Next steps - [Use Iceberg Catalogs](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/) - [Tune Performance for Iceberg Topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-performance-tuning/) - [Troubleshoot Iceberg Topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-troubleshooting/) ## Suggested reading - [Understanding Apache Kafka Schema Registry](https://www.redpanda.com/blog/schema-registry-kafka-streaming#how-does-serialization-work-with-schema-registry-in-kafka) --- # Page 412: Tune Performance for Iceberg Topics **URL**: https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-performance-tuning.md --- # Tune Performance for Iceberg Topics This guide covers strategies for optimizing the performance of Iceberg topics in Redpanda, including improving downstream query performance, tuning the Iceberg translation pipeline, and monitoring translation throughput. After reading this page, you will be able to: - Apply partitioning and compaction strategies to improve query performance - Choose appropriate lag target values for your workload - Identify translation performance signals using Iceberg metrics ## Prerequisites You must be familiar with how Iceberg topics work in Redpanda. See [About Iceberg Topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/about-iceberg-topics/). ## Optimize query performance Query engines read Parquet files from object storage to process Iceberg table data. Partitioning, compaction, and schema design affect how efficiently those reads perform. ### Use custom partitioning To improve query performance, consider implementing custom [partitioning](https://iceberg.apache.org/docs/nightly/partitioning/) for the Iceberg topic. Use the `redpanda.iceberg.partition.spec` topic property to define the partitioning scheme: ```bash # Create new topic with five topic partitions, replication factor 3, and custom table partitioning for Iceberg rpk topic create -p5 -r3 -c redpanda.iceberg.mode=value_schema_id_prefix -c "redpanda.iceberg.partition.spec=(, , ...)" ``` Valid `` values include a source column name or a transformation of a column. The columns referenced can be Redpanda-defined (such as `redpanda.timestamp`) or user-defined based on a schema that you register for the topic. The Iceberg table stores records that share different partition key values in separate files based on this specification. For example: - To partition the table by a single key, such as a column `col1`, use: `redpanda.iceberg.partition.spec=(col1)`. - To partition by multiple columns, use a comma-separated list: `redpanda.iceberg.partition.spec=(col1, col2)`. - To partition by the year of a timestamp column `ts1`, and a string column `col1`, use: `redpanda.iceberg.partition.spec=(year(ts1), col1)`. To learn more about how partitioning schemes can affect query performance, and for details on the partitioning specification such as allowed transforms, see the [Apache Iceberg documentation](https://iceberg.apache.org/spec/#partitioning). > 💡 **TIP** > > - Partition by columns that you frequently use in queries. Columns with relatively few unique values (low cardinality) are good candidates for partitioning. > > - If you must partition based on columns with high cardinality, for example timestamps, use Iceberg’s available transforms such as extracting the year, month, or day to avoid creating too many partitions. Too many partitions can be detrimental to performance because more files need to be scanned and managed. ### Compact Iceberg tables Over time, Iceberg translation can produce many small Parquet files, especially with low-throughput topics or short lag targets. Compaction merges small files into larger ones, reducing the number of metadata operations query engines must perform and improving read performance. - Automatic compaction: Some catalog and data platform services, such as AWS Glue and Databricks, automatically compact Iceberg tables. - Manual or scheduled compaction: Tools like [Apache Spark](https://spark.apache.org/) can run compaction jobs on a schedule. This is useful if your catalog or platform does not compact automatically. If you observe degraded read performance or a high number of small files, investigate whether your catalog or platform supports automatic compaction or schedule periodic compaction jobs. ### Avoid high column count A high column count or schema field count results in more overhead when translating topics to the Iceberg table format. Small message sizes can also increase CPU utilization. To minimize the performance impact on your cluster, keep to a low column count and large message size for Iceberg topics. ## Tune translation performance Translation is the process in which Redpanda converts topic data into Parquet files for the Iceberg table. Each round of translation processes one topic partition at a time. Under typical conditions, Iceberg translation has the following performance characteristics: - Throughput: Approximately 5 MiB/s per core. - Flush threshold: 32 MiB. Each translation process uploads its on-disk data when accumulated data reaches this threshold. This is the primary control for Parquet file size, and is managed by Redpanda Cloud. - Lag target: Controlled by [`iceberg_target_lag_ms`](https://docs.redpanda.com/cloud-data-platform/reference/properties/cluster-properties/#iceberg_target_lag_ms) (default: 1 minute). Redpanda tries to commit all data produced to an Iceberg-enabled topic within this window. The flush threshold and lag target together determine the size of the Parquet files written to object storage. Larger Parquet files generally improve downstream query performance by reducing the number of metadata operations query engines must perform. ### Tune the lag target In Redpanda Cloud, `datalake_translator_flush_bytes` is managed by Redpanda Cloud and is not user-tunable. To adjust the size of Parquet files written to object storage, increase the lag target. A larger lag target gives translators more time to accumulate data before committing, resulting in larger Parquet files with more records per file. You can configure the lag target at the cluster level or per-topic: - Cluster-wide: edit `iceberg_target_lag_ms` in the Redpanda Cloud Console. For instructions, see [Configure Cluster Properties](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/). - Per-topic: set the `redpanda.iceberg.target.lag.ms` topic property. The topic property overrides the cluster default for that topic. > 📝 **NOTE** > > Increasing the lag target means Iceberg tables receive new data less frequently. Choose a lag value that balances file efficiency against how current your downstream data must be. To check the current cluster-wide value: ```bash rpk cluster config get iceberg_target_lag_ms ``` To check topic-level overrides: ```bash rpk topic describe -c ``` ### Optimize message size Redpanda has validated 32 MiB as the maximum recommended message size for Iceberg-enabled topics. With large messages, each Parquet file contains fewer records because the flush threshold is reached sooner. This can reduce the efficiency of analytical queries that need to scan many records. If query latency is a concern and your workload produces large messages, consider: - Reducing individual message sizes if your data model allows it. - Increasing `iceberg_target_lag_ms` to produce Parquet files with more records per file. See [Tune the lag target](#tune-the-lag-target). ### Size clusters for Iceberg workloads When you enable Iceberg for any substantial workload and start translating topic data to the Iceberg format, you may see most of your cluster’s CPU utilization increase. If this additional workload overwhelms the brokers and causes the Iceberg table lag to exceed the configured target lag, Redpanda automatically increases the scheduling priority of Iceberg translation to help it catch up with incoming data. However, this does not substitute for adequate cluster resources. You may need to increase the size of your Redpanda cluster to accommodate the additional workload. To ensure that your cluster is sized appropriately, contact the Redpanda Customer Success team. ### Monitor translation performance Use the following [Iceberg metrics](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#iceberg-metrics) to understand whether translation is keeping pace with incoming data: - [`redpanda_iceberg_translation_raw_bytes_processed`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_iceberg_translation_raw_bytes_processed): Total raw bytes consumed for translation input. Use this to monitor input throughput and compare against the expected 5 MiB/s per core baseline. - [`redpanda_iceberg_translation_parquet_bytes_added`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_iceberg_translation_parquet_bytes_added): Total bytes written to Parquet files. Divide by `redpanda_iceberg_translation_files_created` to estimate the average file size produced by your workload. - [`redpanda_iceberg_translation_files_created`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_iceberg_translation_files_created): Number of Parquet files created. A high file creation rate relative to bytes added indicates many small files. Consider increasing `iceberg_target_lag_ms`. - [`redpanda_iceberg_translation_parquet_rows_added`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_iceberg_translation_parquet_rows_added): Total rows written to Parquet files. Useful for understanding record-level throughput. - [`redpanda_iceberg_translation_translations_finished`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_iceberg_translation_translations_finished): Number of completed translator executions. A stalling or zero rate indicates translation has stopped. For metrics related to DLQ files, invalid records, and catalog commit failures, see [Troubleshooting metrics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-troubleshooting/#troubleshooting-metrics). > 💡 **TIP** > > If translation consistently lags despite available CPU headroom, the workload may be partition-bound. Each core translates its assigned partitions independently, so distributing data across more partitions allows more cores to contribute to translation and can improve total throughput. --- # Page 413: Query Iceberg Topics using AWS Glue **URL**: https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-topics-aws-glue.md --- # Query Iceberg Topics using AWS Glue This guide walks you through querying Redpanda topics as Iceberg tables stored in AWS S3, using a catalog integration with [AWS Glue](https://docs.aws.amazon.com/glue/latest/dg/components-overview.html#data-catalog-intro). For general information about Iceberg catalog integrations in Redpanda, see [Use Iceberg Catalogs](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/). After reading this page, you will be able to: - Authorize Redpanda to access AWS Glue Data Catalog. - Configure a Redpanda cluster to use AWS Glue as an Iceberg REST catalog. - Query Iceberg topic data in AWS Glue Data Catalog using Amazon Athena. ## Prerequisites - An AWS account with access to [AWS Glue Data Catalog](https://docs.aws.amazon.com/glue/latest/dg/what-is-glue.html). - AWS Glue Data Catalog must be in the same AWS account and region as the cluster. - Redpanda version 25.2 or later. - [`rpk`](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/) installed or updated to the latest version. - You can also use the Redpanda Cloud API to [reference secrets in your cluster configuration](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/#set-cluster-configuration-properties). - Admin permissions to create IAM policies and roles in AWS. ## Limitations ### Lowercase field names required Use only lowercase field names. AWS Glue converts all table column names to lowercase, and Redpanda requires exact column name matches to manage schemas. Using uppercase letters prevents Redpanda from finding matching columns, which breaks schema management. ### Nested partition spec support AWS Glue does not support partitioning on nested fields. If Redpanda detects that the default partitioning `(hour(redpanda.timestamp))` based on the record metadata is in use, it will instead apply an empty partition spec `()`, which means the table will not be partitioned. To use partitioning, you must implement custom partitioning using your own partition columns (that is, columns that are not nested). > 📝 **NOTE** > > In Redpanda versions 25.2.1 and earlier, an empty partition spec `()` can cause a known issue that prevents certain engines like Amazon Redshift from successfully querying the table. To resolve this issue, specify custom partitioning, or upgrade Redpanda to versions 25.2.2 or later. ### Manual deletion of Iceberg tables The AWS Glue catalog integration does not support automatic deletion of Iceberg tables from Redpanda. To manually delete Iceberg tables in AWS Glue, you must either: - Set the cluster property `iceberg_delete` to `false` when you configure the catalog integration. - Override the cluster property `iceberg_delete` by setting the topic property `redpanda.iceberg.delete` to `false` for the topic you want to delete. When `iceberg_delete` or the topic override `redpanda.iceberg.delete` is set to `false`, you can delete the Redpanda topic, and then delete the table in AWS Glue and the Iceberg data and metadata files in the S3 bucket. If you plan to re-create the topic after deleting it, you must delete the table data entirely before re-creating the topic. ## Authorize access to AWS Glue How you grant Glue access depends on your cluster type. ### BYOC clusters For BYOC clusters created in March 2026 or later, Redpanda automatically provisions the required AWS Glue IAM policy and attaches it to the cluster’s IAM role when you enable Iceberg. You don’t need to manually create IAM policies or roles for Glue access. For BYOC clusters created before March 2026, you must re-run `rpk cloud byoc aws apply --redpanda-id=` to provision the Glue IAM policy before enabling Iceberg. This is a one-time operation that updates the cluster’s IAM role with the necessary Glue permissions. ### BYOVPC clusters On BYOVPC clusters, Redpanda doesn’t create or attach the AWS Glue IAM policies, regardless of when you created the cluster. Running `rpk cloud byoc aws apply` doesn’t grant Glue access. Instead, the [Redpanda BYOVPC Terraform module](https://registry.terraform.io/modules/redpanda-data/redpanda-byovpc/aws/latest) provides the policies, and you attach them to the cluster’s IAM roles. 1. In your `redpanda-data/redpanda-byovpc/aws` module configuration, set `enable_glue_iceberg_catalog = true`. Use module version 2.1.16 or later. If you enable Redpanda SQL, use 2.1.19 or later, which adds a read-only Glue policy for the SQL engine. ```hcl module "redpanda_byovpc" { source = "redpanda-data/redpanda-byovpc/aws" # ... existing module configuration ... enable_glue_iceberg_catalog = true } ``` The module adds the required Glue actions to the Redpanda agent’s permissions boundary. It also creates the following Glue IAM policies and exports their ARNs: - `glue_iceberg_policy_arn`: Read/write access for the brokers. - `glue_iceberg_read_only_policy_arn`: Read-only access for the Redpanda SQL engine. The module creates this policy only if you also set `enable_redpanda_sql = true`. If you enable Redpanda SQL and you set `iceberg_default_catalog_namespace` to a value other than the default, set the module’s `glue_iceberg_namespaces` variable to the same value. The read-only policy grants access only to the Glue databases in `glue_iceberg_namespaces`, which defaults to `["redpanda"]`. 2. Run `terraform init -upgrade`, and then run `terraform apply`. If your configuration sets a module `version`, first change it to `2.1.16` or later, or to `2.1.19` or later if you enable Redpanda SQL. 3. After Redpanda creates the cluster, attach the Glue policies to the cluster’s IAM roles. Redpanda creates these roles when it creates the cluster, so the module can’t attach the policies for you. Attach the policies from the Terraform workspace that creates the cluster: - `glue_iceberg_policy_arn` to `redpanda-cloud-storage-manager-`: The brokers use this role to create and update Iceberg tables in AWS Glue. - `glue_iceberg_read_only_policy_arn` to `redpanda--redpanda-oxla-cluster`: If you enable Redpanda SQL, the SQL engine uses this role to read the Glue catalog when you query Iceberg topics. If you later disable Redpanda SQL, detach this policy first. Otherwise, disabling Redpanda SQL can fail. See [Disable Redpanda SQL](https://docs.redpanda.com/cloud-data-platform/sql/get-started/enable-sql-byovpc-aws/#disable-redpanda-sql). Replace `` with your cluster ID. In the example, replace `redpanda_cluster.cluster` with the name of your `redpanda_cluster` resource: ```hcl resource "aws_iam_role_policy_attachment" "glue_storage_manager" { role = "redpanda-cloud-storage-manager-${redpanda_cluster.cluster.id}" policy_arn = module.redpanda_byovpc.glue_iceberg_policy_arn depends_on = [redpanda_cluster.cluster] } # Only if Redpanda SQL is enabled resource "aws_iam_role_policy_attachment" "glue_rpsql_engine" { role = "redpanda-${redpanda_cluster.cluster.id}-redpanda-oxla-cluster" policy_arn = module.redpanda_byovpc.glue_iceberg_read_only_policy_arn depends_on = [redpanda_cluster.cluster] lifecycle { create_before_destroy = true } } ``` Without the broker role attachment, Iceberg translation fails on its first call to AWS Glue. Redpanda writes no data files and no dead-letter queue records. Without the SQL engine role attachment, `REFRESH` of the Glue-backed catalog fails with a permissions error. If you attached `glue_iceberg_policy_arn` to the SQL engine role before module version 2.1.19, the SQL engine has write access to every Glue database in the account and region. To switch the SQL engine to the read-only policy: 1. If your configuration sets a module `version`, change it to `2.1.19` or later. 2. Run `terraform init -upgrade`, and then run `terraform apply`. The upgraded module creates the read-only policy. 3. Update the `glue_rpsql_engine` resource to match the example: set `policy_arn` to `module.redpanda_byovpc.glue_iceberg_read_only_policy_arn`, and add the `lifecycle` block. Then run `terraform apply`. With `create_before_destroy`, Terraform attaches the read-only policy before it detaches the old one, so queries keep working. Before you delete a BYOVPC cluster, detach the Glue policies from both roles. If you use Terraform, run `terraform destroy` in the workspace that creates the cluster, which removes the attachments first. ## Configure authentication and credentials You can configure credentials for the AWS Glue Data Catalog integration in either of the following ways: - Allow Redpanda to use the same object storage credential properties already configured for S3. This is the recommended approach. On BYOC clusters, the cluster’s existing AWS credentials already include the necessary Glue permissions. On BYOVPC clusters, they include these permissions after you [attach the Glue policy](#byovpc-clusters). For an example cluster configuration that uses the same IAM credentials for both S3 and AWS Glue, see the **Use cluster’s IAM credentials** tab in the [next section](#update-cluster-configuration). - If you want to configure authentication to AWS Glue separately from authentication to S3, there are equivalent credential configuration properties named `iceberg_rest_catalog_aws_*` that override the object storage credentials. These properties only apply to REST catalog authentication, and never to S3 authentication: - `iceberg_rest_catalog_credentials_source` - Set the property to `sts` if you want to use the cluster’s default IAM role. - Set to `config_file` if you want to scope Glue access through your own IAM user and policy instead of the cluster’s default IAM role, or if you want to use static credentials. - `iceberg_rest_catalog_aws_access_key` (static credentials only) - `iceberg_rest_catalog_aws_secret_key` (static credentials only), added as a secret value (see the [next section](#update-cluster-configuration) for details) - `iceberg_rest_catalog_aws_region` For an example cluster configuration that uses separate access keys for AWS Glue, see the **Use static credentials (override IAM)** tab in the [next section](#update-cluster-configuration). ## Update cluster configuration To configure your Redpanda cluster to enable Iceberg on a topic and integrate with the AWS Glue Data Catalog: 1. Edit your cluster configuration to set the `iceberg_enabled` property to `true`, and set the catalog integration properties listed in the example below. By default, Redpanda creates Iceberg tables in a namespace called `redpanda`. Because AWS Glue provides a single catalog per account, each Redpanda cluster that writes to the same Glue catalog must use a distinct namespace to avoid table name collisions. To set a unique namespace, also set `iceberg_default_catalog_namespace` when you set `iceberg_enabled`. This property cannot be changed after Iceberg is enabled. Use `rpk` as shown in the following examples, or [use the Cloud API](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/#set-cluster-configuration-properties) to update these cluster properties. The update might take several minutes to complete. ### Use cluster’s IAM credentials ```bash # Glue requires Redpanda Iceberg tables to be manually deleted # so iceberg_delete is set to false. rpk cloud login rpk profile create --from-cloud rpk cluster config set \ iceberg_enabled=true \ iceberg_delete=false \ iceberg_default_catalog_namespace='[""]' \ iceberg_catalog_type=rest \ iceberg_rest_catalog_endpoint=https://glue..amazonaws.com/iceberg \ iceberg_rest_catalog_authentication_mode=aws_sigv4 \ iceberg_rest_catalog_credentials_source=sts \ iceberg_rest_catalog_aws_region= \ iceberg_rest_catalog_base_location=s3:/// ``` ### Use static credentials (override IAM) ```bash # Glue requires Redpanda Iceberg tables to be manually deleted # so iceberg_delete is set to false. rpk cluster config set \ iceberg_enabled=true \ iceberg_delete=false \ iceberg_default_catalog_namespace='[""]' \ iceberg_catalog_type=rest \ iceberg_rest_catalog_endpoint=https://glue..amazonaws.com/iceberg \ iceberg_rest_catalog_authentication_mode=aws_sigv4 \ iceberg_rest_catalog_credentials_source=config_file \ iceberg_rest_catalog_aws_region= \ iceberg_rest_catalog_aws_access_key= \ iceberg_rest_catalog_aws_secret_key='${secrets.}' \ iceberg_rest_catalog_base_location=s3:/// ``` Use your own values for the following placeholders: - ``: A unique namespace for this cluster’s Iceberg tables. Each Redpanda cluster that writes to the same Glue catalog must use a distinct namespace to avoid table name collisions. If omitted, the default namespace `redpanda` is used. - ``: The AWS region where your Data Catalog is located. The region in the AWS Glue endpoint must match the region specified in your `iceberg_rest_catalog_aws_region` property. - `` and ``: AWS Glue requires you to specify the base location where Redpanda stores Iceberg data and metadata files. You must use an S3 URI; for example, `s3:///iceberg`. - Bucket name: For BYOC clusters, the bucket name is `redpanda-cloud-storage-`. For BYOVPC clusters, use the name of the object storage bucket you created as a [customer-managed resource](https://docs.redpanda.com/cloud-data-platform/get-started/cluster-types/byoc/aws/vpc-byo-aws/#configure-the-redpanda-network-and-cluster). This must be the same bucket used for your cluster’s object storage. You cannot specify a different bucket for Iceberg data. - Warehouse: This is a name you choose as the logical name (such as `iceberg`) for the warehouse represented by all Redpanda Iceberg topic data in the cluster. As a security best practice, do not use the bucket root for the base location. Always specify a subfolder to avoid interfering with the rest of your cluster’s data in object storage. - `` (static credentials only): The AWS access key ID for your Glue service account. - `` (static credentials only): The name of the secret that stores the AWS secret access key for your Glue service account. To reference a secret in a cluster property, for example `iceberg_rest_catalog_aws_secret_key`, you must first [store the secret value](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/#store-a-secret-for-rest-catalog-authentication). ```bash Successfully updated configuration. New configuration version is 2. ``` 2. Enable the integration for a topic by configuring the topic property `redpanda.iceberg.mode`. The following examples show how to use [`rpk`](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/) to either create a new topic or alter the configuration for an existing topic and set the Iceberg mode to `key_value`. The `key_value` mode creates a two-column Iceberg table for the topic, with one column for the record metadata including the key, and another binary column for the record’s value. See [Specify Iceberg Schema](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/specify-iceberg-schema/) for more details on Iceberg modes. Create a new topic and set `redpanda.iceberg.mode`: ```bash rpk topic create --topic-config=redpanda.iceberg.mode=key_value ``` Set `redpanda.iceberg.mode` for an existing topic: ```bash rpk topic alter-config --set redpanda.iceberg.mode=key_value ``` 3. Produce to the topic. For example, ```bash echo "hello world\nfoo bar\nbaz qux" | rpk topic produce --format='%k %v\n' ``` You should see the topic as a table with data in AWS Glue Data Catalog. The data may take some time to become visible, depending on your `iceberg_target_lag_ms` setting. 1. In AWS Glue Studio, go to Databases. 2. Select the `redpanda` database. The `redpanda` database and the table within are automatically added for you. The table name is the same as the topic name. ## Query Iceberg table You can query the Iceberg table using different engines, such as Amazon Athena, PyIceberg, or Apache Spark. To query the table or view the table data in AWS Glue, ensure that your account has the necessary permissions to access the catalog, database, and table. To query the table in Amazon Athena: 1. On the list of tables in AWS Glue Studio, click "Table data" under the **View data** column. 2. Click "Proceed" to be redirected to the Athena query editor. 3. In the query editor, select AwsDataCatalog as the data source, and select the `redpanda` database. 4. The SQL query editor should be pre-populated with a query that selects 10 rows from the Iceberg table. Run the query to see a preview of the table data. ```sql SELECT * FROM "AwsDataCatalog"."redpanda"."" limit 10; ``` Your query results should look like the following: ```sql +-----------------------------------------------------+----------------+ | redpanda | value | +-----------------------------------------------------+----------------+ | {partition=0, offset=0, timestamp=2025-07-21 | 77 6f 72 6c 64 | | 18:11:25.070000, headers=null, key=[B@1900af31} | | +-----------------------------------------------------+----------------+ ``` ### Manage access for query engine users Redpanda manages the permissions between Redpanda and the AWS Glue Data Catalog. To grant your end users and query engines (such as Amazon Athena or Apache Spark) read access to the Iceberg tables, use [AWS Lake Formation](https://docs.aws.amazon.com/lake-formation/latest/dg/what-is-lake-formation.html) to assign table-level and column-level permissions. ## Suggested reading - [Query Iceberg Topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/query-iceberg-topics/) --- # Page 414: Query Iceberg Topics using Databricks and Unity Catalog **URL**: https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-topics-databricks-unity.md --- # Query Iceberg Topics using Databricks and Unity Catalog This guide walks you through querying Redpanda topics as managed Iceberg tables in Databricks, with AWS S3 as object storage and a catalog integration using [Unity Catalog](https://docs.databricks.com/aws/en/data-governance/unity-catalog). For general information about Iceberg catalog integrations in Redpanda, see [Use Iceberg Catalogs](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/). After reading this page, you will be able to: - Configure a Unity Catalog integration for Redpanda Iceberg topics with AWS S3 - Query Redpanda topic data as Iceberg tables in Databricks SQL ## Prerequisites - A Databricks workspace in the same region as your S3 bucket. See the [list of supported AWS regions](https://docs.databricks.com/aws/en/resources/supported-regions#supported-regions-list). - Unity Catalog enabled in your Databricks workspace. See the [Databricks documentation](https://docs.databricks.com/aws/en/data-governance/unity-catalog/get-started) to set up Unity Catalog for your workspace. - [Predictive optimization](https://docs.databricks.com/aws/en/optimizations/predictive-optimization#enable-predictive-optimization) enabled for Unity Catalog. > 📝 **NOTE** > > When you enable predictive optimization, you must also set the following configurations in your Databricks workspace. These configurations allow predictive optimization to automatically generate column statistics and carry out background compaction for Iceberg tables: > > ```sql > SET spark.databricks.delta.liquid.lazyClustering.backfillStats=true; > SET spark.databricks.delta.computeStats.autoConflictResolution=true; > ``` > > To run `OPTIMIZE` manually, or to fix slow queries on tables that contain data written before Redpanda 26.2.3, see [Improve query performance](#improve-query-performance). - [External data access](https://docs.databricks.com/aws/en/external-access/admin) enabled in your metastore. - Workspace admin privileges to complete the steps to create a Unity Catalog storage credential and external location that connects your cluster’s object storage bucket to Databricks. ## Limitations The Redpanda integration with Unity Catalog has these limitations. ### Unsupported data types The following data types are not currently supported for managed Iceberg tables: | Iceberg type | Equivalent Avro type | | --- | --- | | uuid | uuid | | fixed(L) | fixed | | time | time-millis, time-micros | There are no limitations for Protobuf types. ### Query performance for data written before Redpanda 26.2.3 Queries in Databricks SQL can be slow or time out on tables that contain data written before Redpanda 26.2.3. Databricks SQL cannot skip data files in these tables, so each query reads the full table. To fix this, see [Improve query performance](#improve-query-performance). ## Create a Unity Catalog storage credential A storage credential is a Databricks object that controls access to external object storage, in this case S3. You associate a storage credential with an AWS IAM role that defines what actions Unity Catalog can perform in the S3 bucket. Follow the steps in the [Databricks documentation](https://docs.databricks.com/aws/en/connect/unity-catalog/cloud-storage/storage-credentials) to create an AWS IAM role that has the required permissions for the bucket. When you have completed these steps, you should have the following configured in AWS and Databricks: - A self-assuming IAM role, meaning you’ve defined the role trust policy so the role trusts itself. - Two IAM policies attached to the IAM role. The first policy grants Unity Catalog read and write access to the bucket. The second policy allows Unity Catalog to configure file events. - A storage credential in Databricks associated with the IAM role, using the role’s ARN. You also use the storage credential’s external ID in the role’s trust relationship policy to make the role self-assuming. ## Create a Unity Catalog external location The external location stores the Unity Catalog-managed Iceberg metadata, and the Iceberg data written by Redpanda. You must use the same bucket configured for object storage for your Redpanda cluster. For BYOC clusters, the bucket name is `redpanda-cloud-storage-`, where `` is the ID of your Redpanda cluster. For BYOVPC clusters, use the name of the object storage bucket you created as a customer-managed resource. Follow the steps in the [Databricks documentation](https://docs.databricks.com/aws/en/connect/unity-catalog/cloud-storage/external-locations) to **manually** create an external location. You can create the external location in the Catalog Explorer or with SQL. You must create the external location manually because the location needs to be associated with the existing object storage bucket URL, `s3://`. ## Choose a catalog setup You can either create a new catalog dedicated to Redpanda topics or use an existing catalog. If you create a new catalog, Redpanda automatically creates the required schema for you. If you need to integrate with an existing catalog, you must manually create the schema in that catalog before Redpanda creates any Iceberg tables. After you set up your catalog, the authorization and Redpanda configuration steps are the same for both options. ### Option 1: Create a new catalog (recommended) Follow the steps in the Databricks documentation to [create a standard catalog](https://docs.databricks.com/aws/en/catalogs/create-catalog). When you create the catalog, specify the external location you created in the previous step as the storage location. In this setup, Redpanda creates the default `redpanda` schema for you. You use the catalog name when you set the Iceberg cluster configuration properties in Redpanda in a later step. ### Option 2: Use an existing catalog with a pre-created schema If you need to integrate Redpanda with an existing Unity Catalog catalog object, follow the steps to [create a schema](https://docs.databricks.com/aws/en/schemas/create-schema) in the catalog. - By default, Redpanda creates tables in a schema named `redpanda`. If you want to use a different schema, set `iceberg_default_catalog_namespace` before enabling Iceberg, then manually create that schema in the catalog. - Set the schema’s managed storage location to the same S3 bucket used for object storage, using the external location you created in the previous step. Unity Catalog resolves managed storage locations through a hierarchy of metastore > catalog > schema. If you assign the schema its own managed storage location, Redpanda can use the existing catalog while the schema stores its managed Iceberg data in the schema-specific location. For example: - Your existing Unity Catalog catalog stores managed data in `s3://`. - You manually create a `redpanda` schema in that catalog and override its managed storage location, through the external location, to the S3 bucket that Redpanda uses for your cluster’s object storage (`s3://redpanda-cloud-storage-` for BYOC, or your customer-managed bucket for BYOVPC). For more information, see the [Unity Catalog managed storage location hierarchy](https://docs.databricks.com/aws/en/data-governance/unity-catalog/#managed-storage-location-hierarchy) in the Databricks documentation. ## Authorize access to Unity Catalog Redpanda recommends using OAuth for service principals to grant Redpanda access to Unity Catalog. 1. Follow the steps in the [Databricks documentation](https://docs.databricks.com/aws/en/dev-tools/auth/oauth-m2m) to create a service principal, and then generate an OAuth secret. You use the client ID and secret to set Iceberg cluster configuration properties in Redpanda in the next step. 2. Open your catalog in the Catalog Explorer, then click **Permissions**. 3. Click **Grant** to grant the service principal the following permissions on the catalog: - `ALL PRIVILEGES` - `EXTERNAL USE SCHEMA` The Iceberg integration for Redpanda also supports using bearer tokens. ## Update cluster configuration To configure your Redpanda cluster to enable Iceberg on a topic and integrate with Unity Catalog: 1. Edit your cluster configuration to set the `iceberg_enabled` property to `true`, and set the Unity Catalog integration properties. Use `rpk` like in the following example, or use the Cloud API to [update these cluster properties](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/#set-cluster-configuration-properties). The update might take several minutes to complete. To reference a secret in a cluster property, you must first [store the secret value](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/#store-a-secret-for-rest-catalog-authentication). ```bash rpk cloud login rpk profile create --from-cloud rpk cluster config set \ iceberg_enabled=true \ iceberg_catalog_type=rest \ iceberg_rest_catalog_endpoint=https:///api/2.1/unity-catalog/iceberg-rest \ iceberg_rest_catalog_authentication_mode=oauth2 \ iceberg_rest_catalog_oauth2_server_uri=https:///oidc/v1/token \ iceberg_rest_catalog_oauth2_scope=all-apis \ iceberg_rest_catalog_client_id= \ iceberg_rest_catalog_client_secret='${secrets.}' \ iceberg_rest_catalog_warehouse= \ iceberg_disable_snapshot_tagging=true # Optional. Set a custom namespace only if you want to use a schema other than the default `redpanda` # iceberg_default_catalog_namespace='[""]' ``` Use your own values for the following placeholders: - ``: The URL of your [Databricks workspace instance](https://docs.databricks.com/aws/en/workspace/workspace-details#workspace-instance-names-urls-and-ids); for example, `cust-success.cloud.databricks.com`. - ``: The client ID of the service principal you created in an earlier step. - ``: The name of the client secret of the service principal you created in an earlier step. - ``: The name of your catalog in Unity Catalog. ```bash Successfully updated configuration. New configuration version is 2. ``` 2. Enable the integration for a topic by configuring the topic property `redpanda.iceberg.mode`. The following examples show how to use [`rpk`](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/) to either create a new topic or alter the configuration for an existing topic and set the Iceberg mode to `key_value`. The `key_value` mode creates an Iceberg table for the topic consisting of two columns, one for the record metadata including the key, and another binary column for the record’s value. See [Specify Iceberg Schema](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/specify-iceberg-schema/) for more details on Iceberg modes. Create a new topic and set `redpanda.iceberg.mode`: ```bash rpk topic create --topic-config=redpanda.iceberg.mode=key_value ``` Set `redpanda.iceberg.mode` for an existing topic: ```bash rpk topic alter-config --set redpanda.iceberg.mode=key_value ``` 3. Produce to the topic. For example: ```bash echo "hello world\nfoo bar\nbaz qux" | rpk topic produce --format='%k %v\n' ``` You should see the topic as a table with data in Unity Catalog. The data may take some time to become visible, depending on your `iceberg_target_lag_ms` setting. 4. In Catalog Explorer, open your catalog. You should see a `redpanda` schema (or the namespace you configured with `iceberg_default_catalog_namespace`), in addition to `default` and `information_schema`. 5. The schema and the table residing within it are automatically added for you. The table name is the same as the topic name. ## Query Iceberg table using Databricks SQL You can query the Iceberg table using different engines, such as Databricks SQL, PyIceberg, or Apache Spark. To query the table or view the table data in Catalog Explorer, ensure that your account has the necessary permissions to read the table. The following example shows how to query the Iceberg table using SQL in Databricks SQL. 1. In the Databricks console, open **SQL Editor**. 2. In the query editor, run: ```sql /* Ensure that the catalog and table name are correctly parsed in case they contain special characters. If you set iceberg_default_catalog_namespace to a custom namespace, replace `redpanda` with that namespace in this query. */ SELECT * FROM ``.redpanda.`` LIMIT 10; ``` Your query results should look like the following: ```sql -- Example for redpanda.iceberg.mode=key_value with 1 record produced to topic +----------------------------------------------------------------------+------------+ | redpanda | value | +----------------------------------------------------------------------+------------+ | {"partition":0,"offset":"0","timestamp":"2025-04-02T18:57:11.127Z", | 776f726c64 | | "headers":null,"key":"68656c6c6f"} | | +----------------------------------------------------------------------+------------+ ``` ### Manage access for query engine users Redpanda manages the permissions between Redpanda and Unity Catalog. To grant your end users or query engines read access to the Iceberg tables, use Unity Catalog to assign the appropriate privileges. Review the Databricks documentation on [granting permissions to objects](https://docs.databricks.com/aws/en/data-governance/unity-catalog/manage-privileges/?language=SQL#grant-permissions-on-objects-in-a-unity-catalog-metastore) and [Unity Catalog privileges](https://docs.databricks.com/aws/en/data-governance/unity-catalog/manage-privileges/privileges) for details. ### Improve query performance Redpanda writes many small data files to each Iceberg table. To compact small files and cluster the data, run `OPTIMIZE` periodically, or let predictive optimization run it for you. Redpanda versions earlier than 26.2.3 do not write column statistics for the partition column to the Iceberg metadata. Databricks SQL uses these statistics to skip data files. It does not use the Iceberg partition spec to skip files. If the statistics are missing, Databricks SQL scans the full table, even if the query filters on the partition column. As a result, queries can be slow or time out. This problem applies to each table that contains data files written while your cluster ran a Redpanda version earlier than 26.2.3. To find the Redpanda version of your cluster, go to the cluster **Overview** page in the Redpanda Cloud UI. A cluster upgrade to Redpanda 26.2.3 or later does not add statistics to the existing files. To fix the problem, run these statements in Databricks for each affected table. The `ANALYZE TABLE` statement adds the missing statistics for the partition columns. The `OPTIMIZE` statement then compacts and clusters the data by the partition column. ```sql ANALYZE TABLE ``.redpanda.`` COMPUTE STATISTICS FOR COLUMNS ; OPTIMIZE ``.redpanda.``; ``` Replace `` with a comma-separated list of the source columns in the table’s partition spec. For the default partition spec, `hour(redpanda.timestamp)`, use `` `redpanda`.`timestamp` ``. If you set `iceberg_default_catalog_namespace` to a custom namespace, replace the `redpanda` schema name in both statements with that namespace. Do not change the `redpanda` column name. For details, see [ANALYZE TABLE … COMPUTE STATISTICS](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-aux-analyze-compute-statistics) and [OPTIMIZE](https://docs.databricks.com/aws/en/sql/language-manual/delta-optimize) in the Databricks documentation. For data written by Redpanda 26.2.3 or later, you do not need to run `ANALYZE`. ## Suggested reading - [Query Iceberg Topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/query-iceberg-topics/) --- # Page 415: Use Iceberg Topics with GCP Lakehouse **URL**: https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-topics-gcp-biglake.md --- # Use Iceberg Topics with GCP Lakehouse > 💡 **TIP** > > This guide is for integrating Iceberg topics with a managed REST catalog. Integrating with a REST catalog is recommended for production deployments. If it is not possible to use a REST catalog, you can use the [filesystem-based catalog](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/#object-storage). For an example of using the filesystem-based catalog to access Iceberg topics, see the [Getting Started with Iceberg Topics on Redpanda BYOC](https://www.redpanda.com/blog/iceberg-topics-redpanda-cloud-byoc-setup) blog post. This guide walks you through querying Redpanda topics as Iceberg tables stored in Google Cloud Storage, using a REST catalog integration with [Google Lakehouse for Apache Iceberg](https://docs.cloud.google.com/lakehouse/docs/introduction) (formerly BigLake). After completing this guide, you will be able to: - Create a catalog in GCP Lakehouse for Iceberg topic data. - Configure a Redpanda cluster to use GCP Lakehouse as an Iceberg REST catalog. - Query Iceberg topic data from Google BigQuery. For general information about Iceberg catalog integrations in Redpanda, see [Use Iceberg Catalogs](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/). > 📝 **NOTE** > > Check the [Lakehouse product page](https://docs.cloud.google.com/lakehouse/docs) for the latest status and availability of the REST Catalog API. ## Prerequisites - A Google Cloud Platform (GCP) project. - Lakehouse must be in the same GCP project as the cluster. Cross-project Lakehouse is not supported. If you do not have permissions to manage GCP resources such as VMs, storage buckets, and service accounts in your project, ask your project owner to create or update them for you. - The [`gcloud` CLI](https://docs.cloud.google.com/sdk/docs/install) installed and configured for your GCP project. - [Lakehouse (BigLake) API](https://cloud.google.com/bigquery/docs/blms-rest-catalog) enabled for your GCP project. - Redpanda version 25.3 or later. - `rpk` [installed or updated](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/) to the latest version. - You can also use the Redpanda Cloud API to [reference secrets in your cluster configuration](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/#set-cluster-configuration-properties). > 📝 **NOTE** > > For BYOC clusters created before June 9, 2026, you must re-run `rpk cloud byoc gcp apply --redpanda-id= --project-id=` to enable the required API services before following this guide. This is a one-time operation. ## Limitations ### Multi-region bucket support The Lakehouse runtime catalog does not support multi-region buckets. Use single-region buckets to store your Iceberg topics. ### Catalog deletion Currently, it is not possible to delete non-empty Lakehouse Iceberg catalogs through the Lakehouse interface. If you need to reconfigure your setup, create a new bucket or use the REST API to remove the existing catalog. ### Topic names Lakehouse does not support Iceberg table names that contain dots (`.`). When creating Iceberg topics in Redpanda that you plan to access through Lakehouse, either: - Use the `iceberg_topic_name_dot_replacement` cluster property to set a replacement string for dots in topic names. Ensure that the replacement value does not cause table name collisions. For example, `current.orders` and `current_orders` would both map to the same table name if you set the replacement to an underscore (`_`). - Ensure that the new topic names do not include dots. You must also set the `iceberg_dlq_table_suffix` property to a value that does not include dots or tildes (`~`). See [Configure Redpanda for Iceberg](#configure-redpanda-for-iceberg) for the list of cluster properties to set when enabling the Lakehouse REST catalog integration. ## Set up Google Cloud resources For BYOC clusters, the required Lakehouse IAM permissions are automatically provisioned and attached to the cluster’s service account when Iceberg is enabled with a Lakehouse endpoint. You can skip to [Create a Lakehouse catalog](#create-a-lakehouse-catalog). For BYOVPC clusters, Redpanda Cloud does not grant the Lakehouse permissions when you enable Iceberg. If you provision your GCP resources with the [Redpanda BYOVPC Terraform module](https://registry.terraform.io/modules/redpanda-data/redpanda-byovpc/gcp/latest) version 1.0.4 or later, the module does the following: - Grants the BigLake Editor and Service Usage Consumer roles to the Redpanda cluster service account. - If you set `enable_redpanda_sql = true`, grants the BigLake Viewer and Service Usage Consumer roles to the [Redpanda SQL](https://docs.redpanda.com/cloud-data-platform/sql/get-started/enable-sql-byovpc-gcp/) service account. This requires module version 1.0.5 or later. - Enables the `biglake.googleapis.com` and `bigquery.googleapis.com` APIs in your GCP project. Module version 1.0.4 grants BigLake Editor instead of BigLake Viewer to the SQL service account, which gives the SQL engine write access to the catalog. If you use version 1.0.4 with Redpanda SQL, upgrade to 1.0.5 or later. The upgrade replaces BigLake Editor with BigLake Viewer on the SQL service account, and you don’t need to change anything by hand. If you use module version 1.0.4 or later (1.0.5 or later if you enable Redpanda SQL), you can skip to [Create a Lakehouse catalog](#create-a-lakehouse-catalog). If you use an earlier module version or provision the resources another way, you must enable the two APIs. You must also grant the Service Usage Consumer and BigLake Editor roles in [Grant required permissions](#grant-required-permissions) to the cluster service account. If you enable [Redpanda SQL](https://docs.redpanda.com/cloud-data-platform/sql/get-started/overview/), also grant the Service Usage Consumer role to the SQL service account, and grant `roles/biglake.viewer` instead of `roles/biglake.editor`. On the bucket, grant the SQL service account `roles/storage.objectViewer` instead of `roles/storage.objectAdmin`. ### Grant required permissions Grant the necessary permissions to your service account. To run the following commands, replace the placeholder values: - ``: The name of your service account. - ``: The name of your storage bucket. 1. Grant the service account the [Storage Object Admin role](https://docs.cloud.google.com/storage/docs/access-control/iam-roles) to access the bucket: ```bash gcloud storage buckets add-iam-policy-binding gs:// \ --member="serviceAccount:@$(gcloud config get-value project).iam.gserviceaccount.com" \ --role="roles/storage.objectAdmin" ``` 2. Grant [Service Usage Consumer](https://docs.cloud.google.com/iam/docs/roles-permissions/serviceusage) and [BigLake Editor](https://docs.cloud.google.com/iam/docs/roles-permissions/biglake#biglake.editor) roles for using the Iceberg REST catalog: ```bash gcloud projects add-iam-policy-binding $(gcloud config get-value project) \ --member="serviceAccount:@$(gcloud config get-value project).iam.gserviceaccount.com" \ --role="roles/serviceusage.serviceUsageConsumer" gcloud projects add-iam-policy-binding $(gcloud config get-value project) \ --member="serviceAccount:@$(gcloud config get-value project).iam.gserviceaccount.com" \ --role="roles/biglake.editor" ``` ### Create a Lakehouse catalog Create a Lakehouse Iceberg REST catalog using the [`gcloud biglake`](https://docs.cloud.google.com/sdk/gcloud/reference/biglake/iceberg/catalogs/create) command: ```bash gcloud biglake iceberg catalogs create --catalog-type=gcs-bucket --project= ``` Replace the placeholder values: - ``: Use the name of your storage bucket as the catalog ID. - ``: Your GCP project ID. ## Configure Redpanda for Iceberg 1. Edit your cluster configuration to set the `iceberg_enabled` property to `true`, and set the catalog integration properties listed in the example below. Use `rpk` as shown in the following example, or [use the Cloud API](https://docs.redpanda.com/cloud-data-platform/manage/cluster-maintenance/config-cluster/#set-cluster-configuration-properties) to update these cluster properties. The update might take several minutes to complete. ```bash rpk cloud login rpk profile create --from-cloud rpk cluster config set \ iceberg_enabled=true \ iceberg_catalog_type=rest \ iceberg_rest_catalog_endpoint=https://biglake.googleapis.com/iceberg/v1/restcatalog \ iceberg_rest_catalog_authentication_mode=gcp \ iceberg_rest_catalog_warehouse=gs:/// \ iceberg_rest_catalog_gcp_user_project= \ iceberg_dlq_table_suffix=_dlq ``` - ``: Your Redpanda cluster ID. - ``: For BYOC clusters, the bucket name is `redpanda-cloud-storage-`. For BYOVPC clusters, use the name of the object storage bucket you created as a customer-managed resource. - ``: Your GCP project ID. - You must set the `iceberg_dlq_table_suffix` property to a value that does not include dots or tildes (`~`). The example above uses `_dlq` as the suffix for the [dead-letter queue (DLQ) table](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-troubleshooting/#dead-letter-queue). 2. Enable the REST catalog integration for a topic by configuring the topic property `redpanda.iceberg.mode`. The following examples show how to use [`rpk`](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/) to either create a new topic or alter the configuration for an existing topic and set the Iceberg mode to `key_value`. The `key_value` mode creates a two-column Iceberg table for the topic, with one column for the record metadata including the key, and another binary column for the record’s value. See [Specify Iceberg Schema](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/specify-iceberg-schema/) for more details on Iceberg modes. Create a new topic and set `redpanda.iceberg.mode`: ```bash rpk topic create --topic-config=redpanda.iceberg.mode=key_value ``` Set `redpanda.iceberg.mode` for an existing topic: ```bash rpk topic alter-config --set redpanda.iceberg.mode=key_value ``` Iceberg data can take a few moments to become available in Lakehouse. ## Query Iceberg topics in BigQuery 1. Navigate to the [BigQuery console](https://console.cloud.google.com/bigquery). 2. Query your Iceberg topic using SQL. For example, to query the `transactions` topic in the quickstart cluster: ```sql SELECT * FROM `>redpanda`.transactions ORDER BY redpanda.timestamp DESC LIMIT 10 ``` Replace `` with your bucket name. Your Redpanda topic is now available as Iceberg tables in Lakehouse, allowing you to run analytics queries directly on your streaming data. ### Manage access for query engine users Redpanda manages the permissions between Redpanda and the BigLake catalog. To grant your end users and query engines read access to the Iceberg tables in BigQuery, see [Grant permissions for BigLake tables](https://cloud.google.com/bigquery/docs/manage-open-source-metadata#grant_permissions) in the Google Cloud documentation. ## Suggested reading - [Use Iceberg Catalogs](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/) - [Query Iceberg Topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/query-iceberg-topics/) - [Google Lakehouse for Apache Iceberg documentation](https://docs.cloud.google.com/lakehouse/docs/introduction) --- # Page 416: Troubleshoot Iceberg Topics **URL**: https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-troubleshooting.md --- # Troubleshoot Iceberg Topics Diagnose and resolve errors in Redpanda Iceberg translation, including dead-letter queue (DLQ) inspection and record reprocessing. Use this page to: - Diagnose Iceberg translation errors using DLQ tables and metrics - Reprocess or drop invalid records from the DLQ table ## Dead-letter queue If Redpanda encounters an error while writing a record to the Iceberg table, Redpanda by default writes the record to a separate DLQ Iceberg table named `~dlq`. The following can cause errors to occur when translating records in the `value_schema_id_prefix` and `value_schema_latest` modes to the Iceberg table format: - Redpanda cannot find the embedded schema ID in the Schema Registry. - Redpanda fails to translate one or more schema data types to an Iceberg type. - In `value_schema_id_prefix` mode, you do not use the Schema Registry wire format with the magic byte. The DLQ table itself uses the `key_value` schema, consisting of two columns: the record metadata including the key, and a binary column for the record’s value. > 📝 **NOTE** > > Topic property misconfiguration, such as [overriding the default behavior of `value_schema_latest` mode](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/specify-iceberg-schema/#override-value-schema-latest-default) but not specifying the fully qualified Protobuf message name, does not cause records to be written to the DLQ table. Instead, Redpanda pauses the topic data translation to the Iceberg table until you fix the misconfiguration. ### Inspect DLQ table You can inspect the DLQ table for records that failed to write to the Iceberg table, and you can take further action on these records, such as transforming and reprocessing them, or debugging issues that occurred upstream. The following example produces a record to a topic named `ClickEvent` and does not use the Schema Registry wire format that includes the magic byte and schema ID: ```bash echo '"key1" {"user_id":2324,"event_type":"BUTTON_CLICK","ts":"2024-11-25T20:23:59.380Z"}' | rpk topic produce ClickEvent --format='%k %v\n' ``` Querying the DLQ table returns the record that was not translated: ```sql SELECT value FROM ."ClickEvent~dlq"; -- Fully qualified table name ``` ```bash +-------------------------------------------------+ | value | +-------------------------------------------------+ | 7b 22 75 73 65 72 5f 69 64 22 3a 32 33 32 34 2c | | 22 65 76 65 6e 74 5f 74 79 70 65 22 3a 22 42 55 | | 54 54 4f 4e 5f 43 4c 49 43 4b 22 2c 22 74 73 22 | | 3a 22 32 30 32 34 2d 31 31 2d 32 35 54 32 30 3a | | 32 33 3a 35 39 2e 33 38 30 5a 22 7d | +-------------------------------------------------+ ``` The data is in binary format, and the first byte is not `0x00`, indicating that it was not produced with a schema. ### Reprocess DLQ records You can apply a transformation and reprocess the record in your data lakehouse to the original Iceberg table. In this case, you have a JSON value represented as a UTF-8 binary. Depending on your query engine, you might need to decode the binary value first before extracting the JSON fields. Some query engines decode the binary value automatically: ClickHouse SQL example to reprocess DLQ record ```sql SELECT CAST(jsonExtractString(json, 'user_id') AS Int32) AS user_id, jsonExtractString(json, 'event_type') AS event_type, jsonExtractString(json, 'ts') AS ts FROM ( SELECT CAST(value AS String) AS json FROM .`ClickEvent~dlq` -- Ensure that the table name is properly parsed ); ``` ```bash +---------+--------------+--------------------------+ | user_id | event_type | ts | +---------+--------------+--------------------------+ | 2324 | BUTTON_CLICK | 2024-11-25T20:23:59.380Z | +---------+--------------+--------------------------+ ``` You can now insert the transformed record back into the main Iceberg table. Redpanda recommends using an exactly-once processing strategy to avoid duplicates when reprocessing records. ### Drop invalid records To disable the default behavior and drop an invalid record, set the `redpanda.iceberg.invalid.record.action` topic property to `drop`. You can also configure the default cluster-wide behavior for invalid records by setting the `iceberg_invalid_record_action` property. ## Troubleshooting metrics The following [Iceberg metrics](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#iceberg-metrics) help identify translation errors, invalid records, and catalog connectivity issues: - [`redpanda_iceberg_translation_dlq_files_created`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_iceberg_translation_dlq_files_created): Number of DLQ Parquet files created. A non-zero and increasing value indicates records are failing to translate. See [Inspect DLQ table](#inspect-dlq-table) to examine the failed records. - [`redpanda_iceberg_translation_invalid_records`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_iceberg_translation_invalid_records): Number of invalid records encountered during translation, labeled by cause. See [Drop invalid records](#drop-invalid-records) to configure how Redpanda handles these records. - [`redpanda_iceberg_rest_client_num_commit_table_update_requests_failed`](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#redpanda_iceberg_rest_client_num_commit_table_update_requests_failed): Failed table commit requests to the REST catalog. Applies only when using a REST catalog (`iceberg_catalog_type: rest`). Persistent failures indicate catalog connectivity or permission issues. --- # Page 417: Migrate Iceberg Catalogs **URL**: https://docs.redpanda.com/cloud-data-platform/manage/iceberg/migrate-iceberg-catalog.md --- # Migrate Iceberg Catalogs Use the procedures in this topic when moving from the filesystem-based `object_storage` catalog to a managed REST catalog, or when changing between REST catalogs. By doing so, you can switch your cluster from one Iceberg catalog backend to another without losing untranslated topic data. This procedure guides you through pausing Iceberg translation per topic, draining pending commits to the old catalog, applying the new catalog configuration, and restarting the cluster. After completing these steps, you will be able to: - Verify that a target Iceberg catalog supports your existing schemas and partition specs - Pause Iceberg translation and drain pending commits without losing untranslated data - Apply new catalog configuration and resume translation safely > ❗ **IMPORTANT** > > Do not change `iceberg_catalog_type` or any other catalog cluster property in place without following this procedure. In-flight commits and untranslated data can be lost or stuck if the catalog changes mid-translation. ## Prerequisites - Iceberg topics enabled and running on your Redpanda cluster. - Network connectivity from all brokers to the new catalog endpoint. - Credentials configured for the new catalog (REST endpoint, authentication mode, secret or token). For configuration guidance for each catalog type, see [Use Iceberg Catalogs](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/). - The new catalog must support the current schema and partition spec of every Iceberg topic. See [Verify catalog compatibility](#verify-catalog-compatibility). ## Verify catalog compatibility Before starting the migration, verify that the new catalog can host every Iceberg topic’s table with its existing schema and partition spec. If the new catalog is incompatible with your existing schemas or partition specs, already-translated Parquet files will fail to commit, and translation will stall in a state that is difficult to recover from. The simplest validation is to manually create a test table in the new catalog with the same schema and partition spec as one of your Iceberg topics. If the create call fails, fix the partition spec or schema before migrating. Delete the test table after validation. > ⚠️ **CAUTION** > > AWS Glue does not support partitioning on a nested field, which is Redpanda’s default partition spec for Iceberg topics. If you migrate to AWS Glue, you must change the partition spec to a Glue-compatible form before starting the migration procedure. ## Run the migration 1. Save the current `retention.ms` and `retention.bytes` values for every Iceberg topic, then set both to `-1` (infinite retention): ```bash rpk topic alter-config --set retention.ms=-1 --set retention.bytes=-1 ``` While Iceberg translation is paused in the next step, the topic’s retention anchor on the log is released. Without infinite retention, the cluster could delete untranslated data before the migration completes. 2. Pause Iceberg translation on every Iceberg topic by setting `redpanda.iceberg.mode` to `disabled`. Save each topic’s previous mode value so you can restore it later. ```bash rpk topic alter-config --set redpanda.iceberg.mode=disabled ``` Setting the mode to `disabled` stops new translation while letting already-translated data finish committing to the old catalog. For more about Iceberg modes, see [Specify Iceberg Schema](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/specify-iceberg-schema/). > 📝 **NOTE** > > Do not change `iceberg_enabled` at the cluster level. The Iceberg integration must remain enabled at the cluster level so that pending commits can drain to the old catalog. 3. Wait for pending commits to drain. Monitor the `redpanda_iceberg_pending_commit_lag` metric until it reaches `0` for every Iceberg topic-partition. This metric reports the number of offsets pending a commit to the Iceberg catalog. While it is non-zero, Redpanda is still flushing translated data to the old catalog. A non-zero value here is expected while translation is paused, and reflects new records the cluster has not yet translated. > 💡 **TIP** > > If you scrape Prometheus, the following expression returns `0` only when every Iceberg-topic partition has fully drained: > > ```promql > sum(redpanda_iceberg_pending_commit_lag) > ``` 4. Apply the new catalog configuration. For example, to switch from `object_storage` to a REST catalog, update the catalog cluster properties: ```bash rpk cluster config set iceberg_catalog_type rest rpk cluster config set iceberg_rest_catalog_endpoint rpk cluster config set iceberg_rest_catalog_authentication_mode oauth2 # Set additional credential properties for your chosen authentication mode. ``` For full guidance on setting catalog cluster properties, see [Connect to a REST catalog](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/#rest) and the individual [REST catalog integration pages](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/rest-catalog/). 5. Restart Redpanda. The catalog cluster properties require a restart to take effect. Coordinate the restart with Redpanda Support. The restart must occur after `redpanda_iceberg_pending_commit_lag` has reached `0` and before you resume translation. 6. After the cluster comes up, check broker logs for successful catalog requests and the absence of authentication errors to verify the new catalog connection. 7. Resume Iceberg translation by restoring `redpanda.iceberg.mode` on every Iceberg topic to its previous value: ```bash rpk topic alter-config --set redpanda.iceberg.mode= ``` 8. Restore `retention.ms` and `retention.bytes` on every Iceberg topic to the values you saved before starting the migration. ## Verify the migration After the migration completes, confirm that new data is reaching the new catalog: - Query an Iceberg table in your query engine using the new catalog and confirm that row counts continue to increase as your topic produces new records. - Check broker logs for any commit failures referencing the new catalog. Repeated failures often indicate a schema or partition spec mismatch. See [Troubleshooting](#troubleshooting) for details. ## Troubleshooting - Pending commits stuck after restart: A schema or partition spec mismatch between the original tables and the new catalog is the most common cause. See [Verify catalog compatibility](#verify-catalog-compatibility). If you cannot resolve the mismatch, contact [Redpanda Support](https://support.redpanda.com/hc/en-us/requests/new). - Authentication errors against the new REST catalog: Verify that the credential cluster properties (for example, `iceberg_rest_catalog_client_id`, `iceberg_rest_catalog_client_secret`, `iceberg_rest_catalog_token`) match what the new catalog expects. For OAuth, also check `iceberg_rest_catalog_oauth2_server_uri`. - Translation does not resume after restoring `redpanda.iceberg.mode`: Check that `redpanda_iceberg_pending_translation_lag` is increasing as new records are produced. If it remains `0`, the cluster is not translating new records. Verify that your producer is still writing to the topic and that the topic’s mode value is one of `key_value`, `value_schema_id_prefix`, or `value_schema_latest`. --- # Page 418: Migrate to Iceberg Topics **URL**: https://docs.redpanda.com/cloud-data-platform/manage/iceberg/migrate-to-iceberg-topics.md --- # Migrate to Iceberg Topics Migrate existing Iceberg pipelines to Redpanda Iceberg topics to simplify your architecture and reduce operational overhead. After reading this page, you will be able to: - Compare external Iceberg integrations with Iceberg Topics architectures - Implement data merge strategies using SQL patterns - Execute validation checks and perform cutover procedures ## Why migrate to Iceberg Topics Redpanda’s built-in Iceberg-enabled topics offer a simpler alternative to external Iceberg integrations for writing streaming data to Iceberg tables. > 📝 **NOTE** > > This page focuses on migrating from Kafka Connect Iceberg Sink. The migration patterns and SQL examples can be adapted for other Iceberg sources such as Apache Flink or Spark. ### Kafka Connect Iceberg Sink comparison The following table compares Kafka Connect Iceberg Sink with Redpanda Iceberg Topics: | Aspect | Kafka Connect Iceberg Sink | Iceberg Topics | | --- | --- | --- | | Infrastructure | Requires external Kafka Connect cluster | Built into Redpanda brokers | | Dependencies | Separate service to manage | No external dependencies | | Setup time | Medium (deploy connector) | Fast (enable topic property and post schema) | ## Prerequisites To migrate from an existing Iceberg integration to Iceberg Topics, you must have: - [Iceberg Topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/about-iceberg-topics/) enabled on your Redpanda cluster. - Understanding of your current schema format (Avro, Protobuf, or JSON Schema). - For Kafka Connect migrations, knowledge of your Kafka Connect configuration, especially if using `iceberg.tables.route-field` for multi-table routing. - If migrating multi-table fan-out patterns, [data transforms](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/how-transforms-work/) enabled on your cluster. - Access to both source and target (Iceberg Topics) tables in your query engine. - Query engine access (Snowflake, Databricks, ClickHouse, or Spark) for data merging. ## Migration steps Redpanda recommends following a phased approach to ensure data consistency and minimize risk: 1. Enable Iceberg on target topics and verify new data flows. 2. Run both systems concurrently during transition. 3. Choose a strategy to combine historical and new data. 4. Verify data completeness and accuracy. 5. Disable the external Iceberg integration. > ❗ **IMPORTANT** > > Iceberg Topics cannot append to existing Iceberg tables that are not created by Redpanda. You must create new Iceberg tables and merge historical data separately. ### Enable Iceberg Topics For simple migrations (one topic mapping to one Iceberg table), enable the Iceberg integration for your Redpanda topics. 1. Set the `iceberg_enabled` configuration property on your cluster to `true`: ###### rpk ```bash rpk cloud login rpk profile create --from-cloud rpk cluster config set iceberg_enabled true ``` ###### Cloud API ```bash # Store your cluster ID in a variable export RP_CLUSTER_ID= # Retrieve a Redpanda Cloud access token export RP_CLOUD_TOKEN=$(curl -X POST "https://auth.prd.cloud.redpanda.com/oauth/token" \ -H "content-type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials" \ -d "client_id=" \ -d "client_secret=") # Update cluster configuration to enable Iceberg topics curl -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" -X PATCH \ "https://api.cloud.redpanda.com/v1/clusters/${RP_CLUSTER_ID}" \ -H 'accept: application/json' \ -H 'content-type: application/json' \ -d '{"cluster_configuration":{"custom_properties": {"iceberg_enabled":true}}}' ``` 2. Configure the `redpanda.iceberg.mode` property for the topic: ```bash rpk topic alter-config --set redpanda.iceberg.mode= ``` Choose the mode based on your message format and schema configuration. For Kafka Connect migrations, use this mapping: | Kafka Connect Converter | Recommended Iceberg Mode | | --- | --- | | `io.confluent.connect.avro.AvroConverter` | `value_schema_id_prefix` (messages already use Schema Registry wire format) | | `io.confluent.connect.protobuf.ProtobufConverter` | `value_schema_id_prefix` (messages already use Schema Registry wire format) | | `org.apache.kafka.connect.json.JsonConverter` with schemas | `value_schema_latest` (Schema Registry resolves schema automatically) | | `org.apache.kafka.connect.json.JsonConverter` with embedded schemas | `key_value` (schema included with each message) | See [Specify Iceberg Schema](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/specify-iceberg-schema/) to learn more about the different Iceberg modes. 3. If using `value_schema_id_prefix` or `value_schema_latest` modes, register a schema for the topic: ```bash rpk registry schema create -value --schema --type ``` > ❗ **IMPORTANT** > > If using the `value_schema_id_prefix` mode, schema subjects must use the `-value` [naming convention](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-id-validation/#set-subject-name-strategy-per-topic) (TopicNameStrategy). Note the schema ID returned, in case you need it for troubleshooting. 4. Verify that new records are being written to the Iceberg table: - Check that data appears in your query engine. - Validate that the schema translation is correct. - Confirm record counts are increasing. #### Multi-table fan-out pattern If your existing integration routes records to multiple Iceberg tables based on a field value (for example, Kafka Connect’s `iceberg.tables.route-field` property), you need to implement equivalent routing logic. You create separate Iceberg-enabled topics for each target table, and Redpanda automatically creates corresponding Iceberg tables. Use either of the following approaches to route records to the correct topic: ##### Option 1: Data transforms with separate topics (recommended) Use a data transform to read the routing field from each message and write records to separate Iceberg-enabled topics. This approach keeps routing logic within Redpanda and avoids external dependencies. When using Iceberg modes that require schema validation, the transform can register schemas dynamically and encode messages with the appropriate format. 1. Enable data transforms on your cluster: ```bash rpk cluster config set data_transforms_enabled true ``` 2. Create output topics and enable Iceberg with Schema Registry validation: ```bash rpk topic create rpk topic alter-config --set redpanda.iceberg.mode=value_schema_id_prefix rpk topic alter-config --set redpanda.iceberg.mode=value_schema_id_prefix rpk topic alter-config --set redpanda.iceberg.mode=value_schema_id_prefix ``` 3. Implement a transform function that: 1. Reads the routing field from each input message. 2. If using Schema Registry validation, registers schemas dynamically and encodes messages with the appropriate format. 3. Writes to a specific output topic based on the routing field. 4. Deploy the transform, specifying multiple output topics: ```bash rpk transform deploy \ --file transform.wasm \ --name \ --input-topic \ --output-topic \ --output-topic \ --output-topic ``` 5. Validate the fanout by checking that each output topic receives the correct records. For a complete implementation example with dynamic schema registration, see [Multi-topic fan-out with Schema Registry](https://docs.redpanda.com/cloud-data-platform/develop/data-transforms/build/#multi-topic-fanout). The example demonstrates Schema Registry wire format encoding for use with `value_schema_id_prefix` mode. ##### Option 2: External stream processor Use an external stream processor for complex routing logic: 1. Use a stream processor ([Redpanda Connect](https://docs.redpanda.com/cloud-data-platform/develop/connect/about/) or Flink) to split records. 2. Write to separate Iceberg-enabled topics. This approach is more complex but offers more flexibility for advanced routing requirements not supported by data transforms. ### Validate Schema Registry integration If using [`value_schema_id_prefix`](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/specify-iceberg-schema/#value_schema_id_prefix) mode, verify that messages use the Schema Registry [wire format](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-overview/#wire-format). ```bash rpk topic consume --num=1 --format='%v\n' | xxd | head -n 1 ``` If the first byte is not `00` (magic byte), you must configure your producer to use the wire format. The `value_schema_id_prefix` mode also requires that schema subjects follow the TopicNameStrategy: `-value`. Verify your schemas use the correct naming: ```bash rpk registry schema list ``` #### Verify no records in DLQ Check that no records failed validation and were written to the dead-letter queue. If records are present, see [Records in DLQ table](#records-in-dlq-table) for resolution steps. ```sql SELECT COUNT(*) FROM ."~dlq"; ``` ### Run systems in parallel Keep your existing Iceberg integration running while Iceberg Topics is enabled. This provides a safety net during the transition period: - New data flows to both the source tables and new Iceberg Topics tables. - You can validate data consistency between both systems. - You have a fallback option if issues arise. Run a query to compare record counts between systems: ```sql -- Source table SELECT COUNT(*) AS source_count FROM .; -- Iceberg Topics table SELECT COUNT(*) AS iceberg_topics_count FROM .; ``` Record counts should increase at similar rates, accounting for the time Iceberg Topics was enabled. Check for DLQ records (see [Records in DLQ table](#records-in-dlq-table)). Monitor Iceberg topic metrics to validate that data is flowing at expected rates: - `redpanda_iceberg_translation_parquet_rows_added`: Track rows written to Iceberg tables (compare with source write rate) - `redpanda_iceberg_translation_translations_finished`: Number of completed translation executions - `redpanda_iceberg_translation_invalid_records`: Records that failed validation - `redpanda_iceberg_translation_dlq_files_created`: Dead-letter queue activity - `redpanda_iceberg_rest_client_num_commit_table_update_requests_failed`: Failed table commits to catalog If using data transforms for multi-table fanout, also monitor: - `redpanda_transform_lag`: Records pending processing in transform input topic For a complete list of Iceberg metrics, see the [Iceberg metrics reference](https://docs.redpanda.com/cloud-data-platform/reference/public-metrics-reference/#iceberg-metrics). > 💡 **TIP** > > Run both systems for at least 24-48 hours to ensure stability before proceeding with data merge. ### Merge historical data Choose a strategy to combine your historical data with new Iceberg Topics data. #### Option 1: INSERT INTO pattern (recommended) Use this approach to create a unified table with all data, taking into consideration the following: - You want a single table for queries. - You can afford the one-time data copy cost. - You need optimal query performance. This SQL pattern uses partition and offset metadata to identify and copy only records not yet in the target table: ```sql -- Step 1: Find the latest offset per partition in the target (Iceberg Topics) table WITH latest_offsets AS ( SELECT partition, MAX(offset) AS max_offset FROM target_iceberg_topics_table GROUP BY partition ) -- Step 2: Insert records from source table that don't exist in target INSERT INTO target_iceberg_topics_table SELECT s.* FROM source_table AS s LEFT JOIN latest_offsets AS t ON s.partition = t.partition WHERE t.max_offset IS NULL -- Partition not seen before in target OR s.offset > t.max_offset; -- Record is newer than target's latest offset ``` - The `latest_offsets` CTE finds the highest offset in the target table for each partition. - The `LEFT JOIN` ensures you include partitions never seen before in the target (`t.max_offset IS NULL`). - The `WHERE` clause filters to only records with offsets greater than the target’s latest. - This avoids duplicates by using Kafka partition and offset as the deduplication key. This approach may take significant time for large datasets. Consider executing this process during low-query periods. You can also execute on an incremental basis to ease the load on your query engine, for example, by date or partition ranges. #### Option 2: View-based query federation Use this approach to query both tables without copying data if: - You cannot afford data copy time or cost. - You need immediate access to a unified view. - Query complexity and performance are acceptable with federated queries. - You may consolidate data later. Create a view that queries both tables and deduplicates on the fly: ```sql CREATE VIEW unified_iceberg_view AS WITH latest_offsets AS ( SELECT partition, MAX(offset) AS max_offset FROM target_iceberg_topics_table GROUP BY partition ), historical_data AS ( SELECT s.* FROM source_table AS s LEFT JOIN latest_offsets AS t ON s.partition = t.partition WHERE t.max_offset IS NULL OR s.offset <= t.max_offset -- Only historical records not in target ), new_data AS ( SELECT * FROM target_iceberg_topics_table ) SELECT * FROM historical_data UNION ALL SELECT * FROM new_data; ``` Most Iceberg-compatible query engines support views, including Snowflake, Databricks, ClickHouse, and Spark. ### Validate the migration After completing the data merge, verify the migration before cutting over: - Record counts match between source and target: ```sql -- Compare record counts SELECT 'Source' AS table_name, COUNT(*) AS record_count FROM . UNION ALL SELECT 'Target', COUNT(*) FROM .; ``` - All partitions are represented in the target: ```sql -- Check for missing partitions SELECT DISTINCT partition FROM . EXCEPT SELECT DISTINCT partition FROM .; -- Should return no rows ``` - Date ranges cover the full historical period. Compare `MIN(timestamp)` and `MAX(timestamp)` between source and target tables to ensure the target covers the same time range. - No gaps in offset sequences: ```sql -- Check for offset gaps (may indicate missing data) WITH offset_check AS ( SELECT partition, offset, LAG(offset) OVER (PARTITION BY partition ORDER BY offset) AS prev_offset FROM . ) SELECT * FROM offset_check WHERE offset - prev_offset > 1; -- Should return no rows ``` - Sample queries return expected results. Spot check specific records by ID to verify data accuracy. - Schema translation is correct. Run `DESCRIBE` on both tables and verify all fields are present with correct data types. - New records are flowing to Iceberg Topics. Check record count for a recent time window (for example, the last hour). - Query performance is acceptable. - Monitoring and alerts are configured. - No records in DLQ (see [Records in DLQ table](#records-in-dlq-table)). ### Troubleshoot common migration issues #### Records in DLQ table Iceberg Topics write records that fail validation to a dead-letter queue (DLQ) table. Records may appear in the DLQ due to: - Schema Registry issues. For example, using the wrong schema subject name, or Redpanda cannot find the embedded schema ID in Schema Registry. - When using `value_schema_id_prefix` mode: messages not encoded with Schema Registry wire format. - Incompatible schema changes. For example, changing field types or removing required fields. - Data type translation failures. To check for DLQ records during migration: ```sql SELECT COUNT(*) FROM ."~dlq"; ``` If the count is greater than zero, inspect the failed records. See [Troubleshoot Iceberg Topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-troubleshooting/) for steps to inspect and reprocess DLQ records. #### Multi-table fan-out transform issues If the transform does not process messages, check if: - The specified output topics don’t exist or aren’t enabled with Iceberg. - The routing logic in the transform is incorrect, or the routing field is missing from input messages. - (When using Schema Registry validation) The schema registration failed during initialization, preventing the transform from starting. To check the transform status: ```bash rpk transform list ``` To view logs and check for errors: ```bash rpk transform logs ``` To check for routing errors: ```bash rpk transform logs | grep -i "unknown\|error" ``` If using Schema Registry validation, verify schema registration: ```bash # Check transform logs for schema registration messages rpk transform logs | grep -i "schema" # List registered schemas rpk registry schema list ``` ### Plan for rollback Before cutting over, ensure you have a rollback strategy. See the [Pre-cutover checklist](#pre-cutover-checklist) in the cutover section to verify you’re ready. #### Rollback during parallel operation If you discover issues while both systems are running: 1. Keep producing to both systems. 2. Point consumers back to source tables. 3. Investigate Iceberg Topics issues using troubleshooting section. 4. Fix issues and re-validate. 5. Attempt cutover again when ready. #### Rollback after external integration disabled > ⚠️ **WARNING** > > Rollback after stopping your external Iceberg integration may result in data loss or gaps. If you must rollback after disabling the external integration: 1. Restart your external Iceberg integration immediately. 2. Identify data written only to Iceberg Topics during the gap. 3. Export that data from Iceberg Topics tables: ```sql SELECT * FROM iceberg_topics_table WHERE timestamp > ''; ``` 4. Write exported data back to the source system (for example, Kafka Connect input topics or directly to source tables). 5. Verify data completeness across both systems. 6. Resume operations on the external integration. Redpanda recommends maintaining the ability to rollback for at least seven days after cutover to allow for issue discovery. ### Cut over to Iceberg Topics #### Pre-cutover checklist Before disabling your external Iceberg integration, ensure you have completed all validation steps: - All historical data is successfully merged (see [Merge historical data](#merge-historical-data)). - Parallel operation is complete and stable for at least 24-48 hours. - All validation queries pass (see [Validate the migration](#validate-the-migration)). - No records in DLQ tables, or all DLQ records are investigated and resolved. - Query performance meets requirements. - Downstream consumers are successfully tested with Iceberg Topics tables. - Monitoring and alerts are configured. - Rollback plan is verified and documented. #### Cutover procedure 1. Set an appropriate maintenance window, ideally during low-traffic periods. 2. Stop your external Iceberg integration. **For Kafka Connect:** ```bash # Stop connector curl -X PUT http:///kafka-connect/clusters/iceberg-sink-connector/stop # Or delete connector (permanent) curl -X DELETE http:///kafka-connect/clusters/iceberg-sink-connector ``` 3. Monitor Iceberg Topics to ensure data continues flowing. 4. Verify that no new records are being written to source tables: ```sql SELECT MAX(timestamp) FROM .; -- Should not change after integration is stopped ``` 5. Run validation queries from [Validate the migration](#validate-the-migration) after 1-2 hours of operation. 6. Wait for a short period, such as 24-48 hours, to monitor and validate stability. 7. If migrating to a unified table of historical plus new data, optionally delete old source tables after an extended validation period (for example, at least seven days): > 📝 **NOTE** > > Ensure you have backups before deleting historical data. Some organizations keep old tables for compliance or audit purposes. ```sql DROP TABLE .; ``` 8. Decommission external Iceberg infrastructure after an extended safety period (30+ days, for example). If any issues arise during cutover, see [Plan for rollback](#plan-for-rollback). ## Next steps - [Query Iceberg Topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/query-iceberg-topics/) - [About Iceberg Topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/about-iceberg-topics/) --- # Page 419: Query Iceberg Topics **URL**: https://docs.redpanda.com/cloud-data-platform/manage/iceberg/query-iceberg-topics.md --- # Query Iceberg Topics When you access Iceberg topics from a data lakehouse or other Iceberg-compatible tools, how you consume the data depends on the topic [Iceberg mode](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/specify-iceberg-schema/) and whether you’ve registered a schema for the topic in the [Redpanda Schema Registry](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-overview/). You do not need to rely on complex ETL jobs or pipelines to access real-time data from Redpanda. After reading this page, you will be able to: - Query Redpanda topic data from an Iceberg-compatible engine - Grant end-user and query engine access to Iceberg data ## Access Iceberg tables Redpanda generates an Iceberg table with the same name as the topic. Depending on the processing engine and your Iceberg catalog implementation, you may also need to define the table (for example using `CREATE TABLE`) to point the data lakehouse to its location in the catalog. For BYOC clusters, the bucket name and table location are as follows: | Cloud provider | Bucket or container name | Iceberg table location | | --- | --- | --- | | AWS | `redpanda-cloud-storage-` | `redpanda-iceberg-catalog/redpanda/` | | Azure | ``
The Redpanda cluster ID is also used as the container name (ID) and the storage account ID. | | | GCP | `redpanda-cloud-storage-` | | For BYOVPC clusters, the bucket name is the name you chose when you created the object storage bucket as a customer-managed resource. For Azure clusters, you must add the public IP addresses or ranges from the REST catalog service, or other clients requiring access to the Iceberg data, to your cluster’s allow list. Alternatively, add subnet IDs to the allow list if the requests originate from the same Azure region. For example, to add subnet IDs to the allow list through the Control Plane API [`PATCH /v1/clusters/`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster) endpoint, run: ```bash curl -X PATCH https://api.cloud.redpanda.com/v1/clusters/ \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${RP_CLOUD_TOKEN}" \ -d @- << EOF { "cloud_storage": { "azure": { "allowed_subnet_ids": [ ] } } } EOF ``` ### Grant access to query engine users Redpanda manages the service-to-service permissions between Redpanda and the catalog (see [Use Iceberg Catalogs](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/)). However, you are responsible for granting your end users and query engines (such as Amazon Athena, Apache Spark, Trino, or Snowflake) read access to the Iceberg data. Use either or both of the following approaches to control access: #### Cloud storage prefix-level access Grant query engine roles or users read access to the Iceberg data prefix in the cluster’s storage bucket. This controls who can read the underlying data and metadata files. Scope permissions to specific prefixes to restrict access to individual tables. - AWS (S3): Use IAM policies to grant `s3:GetObject` and `s3:ListBucket` on the Iceberg prefix (for example, `/redpanda-iceberg-catalog/*`). See [Using IAM policies with Amazon S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-iam-policies.html). - GCP (GCS): Use IAM conditions or bucket-level policies to grant `storage.objects.get` and `storage.objects.list` on the Iceberg prefix. See [GCS IAM permissions](https://cloud.google.com/storage/docs/access-control/iam). - Azure (Blob Storage): Use Azure RBAC roles such as Storage Blob Data Reader scoped to the container or prefix. See [Authorize access to blob data](https://learn.microsoft.com/en-us/azure/storage/blobs/authorize-access-azure-active-directory). #### Catalog-level table access If you use a REST catalog, you can control access at the table level through the catalog’s own access control layer. Use this approach when query engines access tables through the catalog rather than reading files directly. - AWS Glue: Use [AWS Lake Formation](https://docs.aws.amazon.com/lake-formation/latest/dg/what-is-lake-formation.html) to grant table-level and column-level permissions. - Databricks Unity Catalog: See the [Unity Catalog privileges documentation](https://docs.databricks.com/en/data-governance/unity-catalog/manage-privileges/index.html). - Snowflake Open Catalog: See [Open Catalog access control](https://docs.snowflake.com/en/user-guide/opencatalog/access-control). - GCP BigLake: See [BigLake table permissions](https://cloud.google.com/bigquery/docs/manage-open-source-metadata#grant_permissions). ### Refresh table data Some query engines may require you to manually refresh the Iceberg table snapshot (for example, by running a command like `ALTER TABLE REFRESH;`) to see the latest data. If your engine needs the full JSON metadata path, use the following: ```none redpanda-iceberg-catalog/redpanda//metadata/v.metadata.json ``` This provides read access to all snapshots written as of the specified table version (denoted by `version-number`). > 📝 **NOTE** > > Redpanda automatically removes expired snapshots on a periodic basis. Snapshot expiry helps maintain a smaller metadata size and reduces the window available for [time travel](#time-travel-queries). ## Query examples To follow along with the examples on this page, suppose you produce the same stream of events to a topic `ClickEvent`, which uses a schema, and another topic `ClickEvent_key_value`, which uses the key-value mode. The topic’s Iceberg data is stored in an AWS S3 bucket. A sample record contains the following data: ```bash {"user_id": 2324, "event_type": "BUTTON_CLICK", "ts": "2024-11-25T20:23:59.380Z"} ``` > 📝 **NOTE** > > The query examples on this page use `redpanda` as the Iceberg namespace, which is the default. If you configured a different namespace using `iceberg_default_catalog_namespace`, replace `redpanda` with your configured namespace. ### Topic with schema (`value_schema_id_prefix` mode) > 📝 **NOTE** > > The steps in this section also apply to the `value_schema_latest` mode, except the produce step. The `value_schema_latest` mode is not compatible with the Schema Registry wire format. The [`rpk topic produce`](#reference:rpk/rpk-topic/rpk-topic-produce) command embeds the wire format header, so you must use your own producer code with `value_schema_latest`. Assume that you have created the `ClickEvent` topic, set `redpanda.iceberg.mode` to `value_schema_id_prefix`, and are connecting to a REST-based Iceberg catalog. The following is an Avro schema for `ClickEvent`: `schema.avsc` ```avro { "type" : "record", "namespace" : "com.redpanda.examples.avro", "name" : "ClickEvent", "fields" : [ { "name": "user_id", "type" : "int" }, { "name": "event_type", "type" : "string" }, { "name": "ts", "type": "string" } ] } ``` 1. Register the schema under the `ClickEvent-value` subject: ```bash rpk registry schema create ClickEvent-value --schema path/to/schema.avsc --type avro ``` 2. Produce to the `ClickEvent` topic using the following format: ```bash echo '"key1" {"user_id":2324,"event_type":"BUTTON_CLICK","ts":"2024-11-25T20:23:59.380Z"}' | rpk topic produce ClickEvent --format='%k %v\n' --schema-id=topic ``` The `value_schema_id_prefix` mode requires that you produce to a topic using the [Schema Registry wire format](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-overview/#wire-format), which includes the magic byte and schema ID in the prefix of the message payload. This allows Redpanda to identify the correct schema version in the Schema Registry for a record. 3. The following Spark SQL query returns values from columns in the `ClickEvent` table, with the table structure derived from the schema, and column names matching the schema fields. If you’ve integrated a catalog, query engines such as Spark SQL provide Iceberg integrations that allow easy discovery and access to existing Iceberg tables in object storage. ```sql SELECT * FROM ``.redpanda.ClickEvent; ``` ```bash +-----------------------------------+---------+--------------+--------------------------+ | redpanda | user_id | event_type | ts | +-----------------------------------+---------+--------------+--------------------------+ | {"partition":0,"offset":0,"timestamp":2025-03-05 15:09:20.436,"headers":null,"key":null} | 2324 | BUTTON_CLICK | 2024-11-25T20:23:59.380Z | +-----------------------------------+---------+--------------+--------------------------+ ``` ### Topic in key-value mode In `key_value` mode, you do not associate the topic with a schema in the Schema Registry, which means using semi-structured data in Iceberg. The record keys and values can have an arbitrary structure, so Redpanda stores them in [binary format](https://iceberg.apache.org/spec/#primitive-types) in Iceberg. In this example, assume that you have created the `ClickEvent_key_value` topic, and set `redpanda.iceberg.mode` to `key_value`. 1. Produce to the `ClickEvent_key_value` topic using the following format: ```bash echo '"key1" {"user_id":2324,"event_type":"BUTTON_CLICK","ts":"2024-11-25T20:23:59.380Z"}' | rpk topic produce ClickEvent_key_value --format='%k %v\n' ``` 2. The following Spark SQL query returns the semi-structured data in the `ClickEvent_key_value` table. The table consists of two columns: one named `redpanda`, containing the record key and other metadata, and another binary column named `value` for the record’s value: ```sql SELECT * FROM ``.redpanda.ClickEvent_key_value; ``` ```bash +-----------------------------------+------------------------------------------------------------------------------+ | redpanda | value | +-----------------------------------+------------------------------------------------------------------------------+ | {"partition":0,"offset":0,"timestamp":2025-03-05 15:14:30.931,"headers":null,"key":key1} | {"user_id":2324,"event_type":"BUTTON_CLICK","ts":"2024-11-25T20:23:59.380Z"} | +-----------------------------------+------------------------------------------------------------------------------+ ``` Depending on your query engine, you might need to first decode the binary value to display the record key and value using a SQL helper function. For example, see the [`decode` and `unhex`](https://spark.apache.org/docs/latest/api/sql/index.html#unhex) Spark SQL functions, or the [HEX_DECODE_STRING](https://docs.snowflake.com/en/sql-reference/functions/hex_decode_string) Snowflake function. Some engines may also automatically decode the binary value for you. ### Time travel queries Some query engines, such as Spark, support time travel with Iceberg, allowing you to query the table as it existed at a specific point in the past. You can run a time travel query by specifying a timestamp or version number. Redpanda automatically removes expired snapshots on a periodic basis, which also reduces the window available for time travel queries. By default, Redpanda retains snapshots for five days, so you can query Iceberg tables as of up to five days ago. The following example queries a `ClickEvent` table at a specific timestamp in Spark: ```sql SELECT * FROM ``.redpanda.ClickEvent TIMESTAMP AS OF '2025-03-02 10:00:00'; ``` --- # Page 420: Query Iceberg Topics using Snowflake and Open Catalog **URL**: https://docs.redpanda.com/cloud-data-platform/manage/iceberg/redpanda-topics-iceberg-snowflake-catalog.md --- # Query Iceberg Topics using Snowflake and Open Catalog This guide walks you through querying Redpanda topics as Iceberg tables in [Snowflake](https://docs.snowflake.com/en/user-guide/tables-iceberg), with Amazon S3 as object storage and a catalog integration using [Open Catalog](https://docs.snowflake.com/en/user-guide/opencatalog/overview). After reading this page, you will be able to: - Configure AWS IAM credentials granting Open Catalog access to your S3 bucket - Integrate Redpanda Iceberg topics with Snowflake using Open Catalog ## Prerequisites - `rpk` or familiarity with the Redpanda Cloud API to use secrets in your cluster configuration. For `rpk`, see [Install or Update rpk](https://docs.redpanda.com/cloud-data-platform/manage/rpk/rpk-install/). For the Cloud API, you must [authenticate](https://docs.redpanda.com/api/cloud-controlplane/authentication) using a service account. - A Snowflake account. - An Open Catalog account. To [create an Open Catalog account](https://other-docs.snowflake.com/en/opencatalog/create-open-catalog-account), you require ORGADMIN access in Snowflake. ## Authorize access to Open Catalog You must create an AWS IAM policy and role that Open Catalog and Snowflake use to access the S3 bucket where your Iceberg data is stored. Redpanda writes Iceberg data and metadata files to the bucket using your cluster’s existing object storage credentials, so Redpanda does not need additional IAM configuration for its own S3 access. You finish configuring this role’s trust policy when you create the catalog and the external volume, using values that Open Catalog and Snowflake generate for you. ### Create an IAM policy Create an IAM policy with the following S3 permissions, scoped to your cluster’s storage bucket: ```json { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:GetObjectVersion", "s3:DeleteObject", "s3:DeleteObjectVersion" ], "Resource": "arn:aws:s3:::/*" }, { "Effect": "Allow", "Action": [ "s3:ListBucket", "s3:GetBucketLocation" ], "Resource": "arn:aws:s3:::" } ] } ``` Replace `` with the name of your cluster’s object storage bucket. You use this same IAM policy for both the Open Catalog role and the Snowflake external volume. For BYOC clusters, the bucket name is `redpanda-cloud-storage-`, where `` is the ID of your Redpanda cluster. For BYOVPC clusters, use the name of the object storage bucket you created as a customer-managed resource. ### Create an IAM role Create an IAM role and attach the IAM policy you created. Open Catalog and Snowflake each need this role’s ARN before they can generate the IAM user and external ID values you use to finish configuring the trust policy, so create the role with a temporary trust relationship for now: 1. In the AWS IAM console, create a new role. 2. For the trusted entity type, select **AWS account**. Under **An AWS account**, select **This account**. 3. Attach the IAM policy you created. 4. Note the role’s ARN (``). You update this role’s trust policy after Open Catalog and Snowflake generate the values you need, when you create the catalog and the external volume. ## Create a catalog in Open Catalog Create the catalog that Redpanda’s Iceberg data and metadata are registered to, with your Tiered Storage S3 bucket configured as external storage: 1. In Open Catalog, create a new catalog. 2. For **S3 role ARN**, enter ``, the ARN of the IAM role you created. 3. Configure the catalog’s external storage location to point to your Tiered Storage S3 bucket. > 📝 **NOTE** > > Your Open Catalog account must be in the same AWS region as your S3 bucket. 4. On the Open Catalog home page, in the **Catalogs** pane, select the catalog you created. Under **Storage Details**, copy the **IAM user arn** (``). 5. If you didn’t specify an external ID when you created the IAM role, Open Catalog generates one for you (``). Record this value. For complete steps, see the [Open Catalog documentation](https://docs.snowflake.com/en/user-guide/opencatalog/create-catalog). ### Update the IAM role trust policy for Open Catalog Update the trust policy for the IAM role you created, using the IAM user ARN and external ID that Open Catalog generated when you created the catalog: ```json { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "sts:ExternalId": "" } } } ] } ``` After you update the trust policy, Open Catalog can assume the role to read and write Iceberg data and metadata in your S3 bucket. ## Create a Snowflake external volume Create a Snowflake external volume using the same IAM role you created for Open Catalog. Snowflake provisions its own IAM user to assume the role, so you add a second statement to the role’s trust policy rather than replacing the statement that trusts Open Catalog: 1. In Snowflake, run `CREATE EXTERNAL VOLUME`, pointing `STORAGE_AWS_ROLE_ARN` to the IAM role you created: ```sql CREATE OR REPLACE EXTERNAL VOLUME STORAGE_LOCATIONS = ( ( NAME = '' STORAGE_PROVIDER = 'S3' STORAGE_BASE_URL = 's3:///' STORAGE_AWS_ROLE_ARN = '' STORAGE_AWS_EXTERNAL_ID = '' ) ) ALLOW_WRITES = TRUE; ``` Use your own values for the following placeholders: - ``: Provide a name for your external volume in Snowflake. - ``: Provide a name for the storage location. - ``: Choose an external ID for the volume’s trust relationship, distinct from the external ID Open Catalog uses. If you don’t set `STORAGE_AWS_EXTERNAL_ID`, Snowflake generates one for you. 2. Run `DESC EXTERNAL VOLUME` to retrieve the IAM user ARN that Snowflake generated for the volume: ```sql DESC EXTERNAL VOLUME ; ``` Record the `STORAGE_AWS_IAM_USER_ARN` value from the output (``). 3. Add a new statement to the IAM role’s trust policy for the volume’s IAM user ARN and external ID, alongside the existing statement that trusts Open Catalog: > ❗ **IMPORTANT** > > Add this as a new statement in the trust policy’s `Statement` array. If you replace the existing trust policy instead, Open Catalog loses access to the bucket. ```json { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "sts:ExternalId": "" } } }, { "Effect": "Allow", "Principal": { "AWS": "" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "sts:ExternalId": "" } } } ] } ``` 4. Run `SYSTEM$VERIFY_EXTERNAL_VOLUME` to confirm Snowflake can access the bucket: ```sql SELECT SYSTEM$VERIFY_EXTERNAL_VOLUME(''); ``` For complete steps, see the [Snowflake documentation](https://docs.snowflake.com/en/user-guide/tables-iceberg-configure-external-volume-s3). ## Set up catalog integration using Open Catalog To integrate Iceberg-enabled topics with Open Catalog, create a service connection and configure catalog roles. ### Create a new Open Catalog service connection for Redpanda To create a new service connection to integrate the Iceberg-enabled topics into Open Catalog: 1. In Open Catalog, select **Connections**, then **\+ Connection**. 2. In **Configure Service Connection**, provide a name. Open Catalog creates a new principal with this name. 3. Make sure **Create new principal role** is selected. 4. Enter a name for the principal role. Then, click **Create**. After you create the connection, get the client ID and client secret. Save these credentials to add to your cluster configuration in a later step. ### Create a catalog role Grant privileges to the principal created in the previous step: 1. In Open Catalog, select **Catalogs**, and select your catalog. 2. On the **Roles** tab of your catalog, click **\+ Catalog Role**. 3. Give the catalog role a name. 4. Under **Privileges**, select `CATALOG_MANAGE_CONTENT`. This provides full management [privileges](https://docs.snowflake.com/en/user-guide/opencatalog/access-control#catalog-privileges) for the catalog. Then, click **Create**. 5. On the **Roles** tab of the catalog, click **Grant to Principal Role**. 6. Select the catalog role you just created. 7. Select the principal role you created earlier. Click **Grant**. ### Update cluster configuration To configure your Redpanda cluster to enable Iceberg on a topic and integrate with Open Catalog: 1. [Store the Open Catalog client secret in your cluster](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/#store-a-secret-for-rest-catalog-authentication) using `rpk` or the Data Plane API. 2. [Edit your cluster configuration](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/#use-a-secret-in-cluster-configuration) to set the `iceberg_enabled` property to `true`, and set the catalog integration properties listed in the example below using `rpk` or the Control Plane API. For example, to use `rpk cluster config set`, run: ```bash rpk cluster config set \ iceberg_enabled=true \ iceberg_catalog_type=rest \ iceberg_rest_catalog_endpoint=https://-.snowflakecomputing.com/polaris/api/catalog \ iceberg_rest_catalog_authentication_mode=oauth2 \ iceberg_rest_catalog_client_id= \ iceberg_rest_catalog_client_secret='${secrets.}' \ iceberg_rest_catalog_warehouse= # Optional properties: # iceberg_translation_interval_ms_default=1000 # iceberg_catalog_commit_interval_ms=1000 ``` Use your own values for the following placeholders: - `` and ``: Your [Open Catalog account URI](https://docs.snowflake.com/en/sql-reference/sql/create-catalog-integration-open-catalog#required-parameters) is composed of these values. > 💡 **TIP** > > In Snowflake, navigate to **Admin**, then **Accounts**. Click the ellipsis near your Open Catalog account name, and select **Manage URLs**. The **Current URL** contains `` and ``. - ``: The client ID of the service connection you created in an earlier step. - ``: The name of the secret you created in the previous step. You must pass the secret name to the `${secrets.}` placeholder, not the secret value itself. - ``: The name of your catalog in Open Catalog. ```bash Successfully updated configuration. New configuration version is 2. ``` 3. Enable the integration for a topic by configuring the topic property `redpanda.iceberg.mode`. This mode creates an Iceberg table for the topic consisting of two columns: one for the record metadata including the key, and another binary column for the record’s value. See [Enable Iceberg integration](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/about-iceberg-topics/#enable-iceberg-integration) for more details on Iceberg modes. Use any of the following to set `redpanda.iceberg.mode`: - `rpk`. See the following examples to run `rpk topic` commands. - The Cloud UI. Navigate to **Topics** to create a new topic and specify `redpanda.iceberg.mode` in **Additional Configuration**, or edit an existing topic under the topic’s **Configuration** tab. - The Data Plane API to [create a new topic](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-topicservice_createtopic) or [update a property for an existing topic](https://docs.redpanda.com/api/doc/cloud-dataplane/operation/operation-topicservice_updatetopicconfigurations). Specify the key-value pair for `redpanda.iceberg.mode` in the request body. The following examples show how to use `rpk` to create a new topic or alter the configuration for an existing topic, setting the Iceberg mode to `key_value`. Create a new topic and set `redpanda.iceberg.mode`: ```bash rpk topic create --topic-config=redpanda.iceberg.mode=key_value ``` Set `redpanda.iceberg.mode` for an existing topic: ```bash rpk topic alter-config --set redpanda.iceberg.mode=key_value ``` 4. Produce to the topic. For example, ```bash echo "hello world\nfoo bar\nbaz qux" | rpk topic produce --format='%k %v\n' ``` The topic appears as a table in Open Catalog. 1. In Open Catalog, select **Catalogs**, then open your catalog. 2. Under your catalog, you will see the `redpanda` namespace (or the namespace you configured with `iceberg_default_catalog_namespace`), and a table with the name of your topic. The namespace and the table are automatically added for you. ## Query Iceberg table in Snowflake To query the topic in Snowflake, you must create a [catalog integration](https://docs.snowflake.com/en/user-guide/tables-iceberg#catalog-integration) so that Snowflake has access to the table data and metadata. ### Configure catalog integration with Snowflake 1. Run the [`CREATE CATALOG INTEGRATION`](https://docs.snowflake.com/sql-reference/sql/create-catalog-integration-open-catalog) command in Snowflake: ```sql CREATE CATALOG INTEGRATION CATALOG_SOURCE = POLARIS TABLE_FORMAT = ICEBERG CATALOG_NAMESPACE = 'redpanda' REST_CONFIG = ( CATALOG_URI = '' WAREHOUSE = '' ) REST_AUTHENTICATION = ( TYPE = OAUTH OAUTH_CLIENT_ID = '' OAUTH_CLIENT_SECRET = '' OAUTH_ALLOWED_SCOPES = ('PRINCIPAL_ROLE:ALL') ) REFRESH_INTERVAL_SECONDS = 30 ENABLED = TRUE; ``` Use your own values for the following placeholders: - ``: Provide a name for your Iceberg catalog integration in Snowflake. - ``: Your [Open Catalog account URI](https://docs.snowflake.com/en/sql-reference/sql/create-catalog-integration-open-catalog#required-parameters) (`https://-.snowflakecomputing.com/polaris/api/catalog`). - ``: The name of your catalog in Open Catalog. - ``: The client ID of the service connection you created in an earlier step. - ``: The client secret of the service connection you created in an earlier step. 2. Run the following command to verify that the catalog is integrated correctly: ```sql SELECT SYSTEM$LIST_ICEBERG_TABLES_FROM_CATALOG(''); ``` ```bash # Example result for redpanda.iceberg.mode=key_value +-----------------------------------------------------------------------+ | SYSTEM$LIST_ICEBERG_TABLES_FROM_CATALOG('') | +-----------------------------------------------------------------------+ | [{"namespace":"redpanda","name":""}] | +-----------------------------------------------------------------------+ ``` ### Create Iceberg table in Snowflake After creating the catalog integration, you must create an externally-managed table in Snowflake. You must run your Snowflake queries against this table. In your Snowflake database, run the [CREATE ICEBERG TABLE](https://docs.snowflake.com/en/sql-reference/sql/create-iceberg-table-rest) command. The following example also specifies that the table should automatically refresh metadata: ```sql CREATE ICEBERG TABLE CATALOG = '' EXTERNAL_VOLUME = '' CATALOG_TABLE_NAME = '' AUTO_REFRESH = TRUE ``` Use your own values for the following placeholders: - ``: Provide a name for your table in Snowflake. - ``: The name of the catalog integration you configured in an earlier step. - ``: The name of the external volume you configured using the Tiered Storage bucket. - ``: The name of the table in your catalog, which is the same as your Redpanda topic name. ### Query the Iceberg table To verify that Snowflake has successfully created the table containing the topic data, run the following: ```sql SELECT * FROM ; ``` Your query results should look like the following: ```bash # Example for redpanda.iceberg.mode=key_value with 3 records produced to topic +--------------------------------------------------------------------------------------------------------------+------------+ | REDPANDA | VALUE | +--------------------------------------------------------------------------------------------------------------+------------+ | { "partition": 0, "offset": 0, "timestamp": "2025-02-07 16:29:50.122", "headers": null, "key": "68656C6C6F"} | 776F726C64 | | { "partition": 0, "offset": 1, "timestamp": "2025-02-07 16:29:50.122", "headers": null, "key": "666F6F"} | 626172 | | { "partition": 0, "offset": 2, "timestamp": "2025-02-07 16:29:50.122", "headers": null, "key": "62617A" } | 717578 | +--------------------------------------------------------------------------------------------------------------+------------+ ``` ### Manage access for query engine users Redpanda manages the permissions between Redpanda and Open Catalog. To grant your Snowflake users or other query engines read access to the Iceberg tables, use [Open Catalog access control](https://docs.snowflake.com/en/user-guide/opencatalog/access-control) to assign catalog privileges. For example, you can grant `TABLE_READ_DATA` to a read-only role rather than the `CATALOG_MANAGE_CONTENT` privilege used by the Redpanda service principal. ## Suggested reading - [Query Iceberg Topics](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/query-iceberg-topics/) --- # Page 421: Integrate with REST Catalogs **URL**: https://docs.redpanda.com/cloud-data-platform/manage/iceberg/rest-catalog.md --- # Integrate with REST Catalogs > 💡 **TIP** > > These guides are for integrating Iceberg topics with managed REST catalogs. Integrating with a REST catalog is recommended for production deployments. If it is not possible to use a REST catalog, you can use the [filesystem-based catalog](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/use-iceberg-catalogs/#object-storage). For an example of using the filesystem-based catalog to access Iceberg topics, see the [Getting Started with Iceberg Topics on Redpanda BYOC](https://www.redpanda.com/blog/iceberg-topics-redpanda-cloud-byoc-setup) blog post. - [Query Iceberg Topics using AWS Glue](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-topics-aws-glue/) Add Redpanda topics as Iceberg tables that you can access through the AWS Glue Data Catalog. - [Query Iceberg Topics using Databricks and Unity Catalog](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-topics-databricks-unity/) Add Redpanda topics as Iceberg tables that you can query in Databricks managed by Unity Catalog. - [Use Iceberg Topics with GCP Lakehouse](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-topics-gcp-biglake/) Add Redpanda topics as Iceberg tables to Google Lakehouse for Apache Iceberg that you can query from Google BigQuery. - [Query Iceberg Topics using Snowflake and Open Catalog](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/redpanda-topics-iceberg-snowflake-catalog/) Add Redpanda topics as Iceberg tables that you can query in Snowflake using an Open Catalog integration. --- # Page 422: Specify Iceberg Schema **URL**: https://docs.redpanda.com/cloud-data-platform/manage/iceberg/specify-iceberg-schema.md --- # Specify Iceberg Schema In [Iceberg-enabled clusters](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/about-iceberg-topics/#enable-iceberg-integration), the `redpanda.iceberg.mode` topic property determines how Redpanda maps topic data to the Iceberg table structure. You can have the generated Iceberg table match the structure of a schema in Schema Registry, or you can use the `key_value` mode where Redpanda stores the record values as-is in the table. After reading this page, you will be able to: - Configure the redpanda.iceberg.mode property when you create or update a topic - Choose the Iceberg mode that produces the table structure your data consumers need - Apply independent translation for record keys, values, and headers ## Supported Iceberg modes Redpanda supports the following modes for Iceberg topics: ### key_value Creates an Iceberg table using a simple schema, consisting of two columns, one for the record metadata including the key, and another binary column for the record’s value. ### value_schema_id_prefix Creates an Iceberg table whose structure matches the Redpanda schema for the topic, with columns corresponding to each field. You must register a schema in [Schema Registry](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-overview/) and producers must write to the topic using the Schema Registry wire format. In the [Schema Registry wire format](https://docs.redpanda.com/cloud-data-platform/manage/schema-reg/schema-reg-overview/#wire-format), a "magic byte" and schema ID are embedded in the message payload header. Producers to the topic must use the wire format in the serialization process so Redpanda can determine the schema used for each record, use the schema to define the Iceberg table, and store the topic values in the corresponding table columns. ### value_schema_latest Creates an Iceberg table whose structure matches the latest schema registered for the subject in Schema Registry. You must register a schema in Schema Registry. Producers cannot use the wire format in `value_schema_latest` mode. Redpanda expects the serialized message as-is without the magic byte or schema ID prefix in the record value. > 📝 **NOTE** > > The `value_schema_latest` mode is not compatible with the [`rpk topic produce`](#reference:rpk/rpk-topic/rpk-topic-produce) command which embeds the wire format header. You must use your own producer code to produce to topics in `value_schema_latest` mode. The latest schema is cached periodically. The cache period is defined by the cluster property `iceberg_latest_schema_cache_ttl_ms` (default: 5 minutes). ### disabled Default for `redpanda.iceberg.mode`. Disables writing to an Iceberg table for the topic. > 📝 **NOTE** > > The following modes are compatible with producing to an Iceberg topic using Redpanda Console: > > - `key_value` > > - Starting in version 25.2, `value_schema_latest` with a JSON schema > > > Otherwise, records may fail to write to the Iceberg table and instead write to the [dead-letter queue](https://docs.redpanda.com/cloud-data-platform/manage/iceberg/iceberg-troubleshooting/#dead-letter-queue). ## Configure Iceberg mode for a topic You can set the Iceberg mode for a topic when you create the topic, or you can update the mode for an existing topic. Option 1. Create a new topic and set `redpanda.iceberg.mode`: ```bash rpk topic create --topic-config=redpanda.iceberg.mode= ``` Option 2. Set `redpanda.iceberg.mode` for an existing topic: ```bash rpk topic alter-config --set redpanda.iceberg.mode= ``` ### Override `value_schema_latest` default In `value_schema_latest` mode, you only need to set the property value to the string `value_schema_latest`. This enables the default behavior of `value_schema_latest` mode, which determines the subject for the topic using the TopicNameStrategy. For example, if your topic is named `sensor` the schema is looked up in the `sensor-value` subject. For Protobuf data, the default behavior also deserializes records using the first message defined in the corresponding Protobuf schema stored in Schema Registry. If you use a different strategy other than the topic name to derive the subject name, you can override the default behavior of `value_schema_latest` mode and explicitly set the subject name. To override the default behavior, use the following optional syntax: ```bash value_schema_latest:subject=,protobuf_name= ``` - For both Avro and Protobuf, specify a different subject name by using the key-value pair `subject=`, for example `value_schema_latest:subject=sensor-data`. - For Protobuf only: - Specify a different message definition by using a key-value pair `protobuf_name=`. You must use the fully qualified name, which includes the package name, for example, `value_schema_latest:protobuf_name=com.example.manufacturing.SensorData`. - To specify both a different subject and message definition, separate the key-value pairs with a comma, for example: `value_schema_latest:subject=my_protobuf_schema,protobuf_name=com.example.manufacturing.SensorData`. > 📝 **NOTE** > > If you don’t specify the fully qualified Protobuf message name, Redpanda pauses the data translation to the Iceberg table until you fix the topic misconfiguration. ## Configure key, value, and header translation In addition to the [supported modes](#supported-iceberg-modes), `redpanda.iceberg.mode` also accepts a section-based syntax that lets you independently configure how Redpanda translates the record key, value, and headers into the Iceberg table. The `key_value`, `value_schema_id_prefix`, and `value_schema_latest` modes are shorthand for common combinations of these sections (see [Iceberg mode shorthands](#iceberg-mode-shorthands)). The `key` and `headers` sections change fields inside the `redpanda` system struct column (`redpanda.key` and the `value` field of each entry in `redpanda.headers`), while the `value` section changes the columns outside that struct. See [How Iceberg modes translate to table format](#how-iceberg-modes-translate-to-table-format) for the base row structure that every generated table includes. Use the following syntax to configure one or more sections: ```bash
: