On This Page

Home / Cribl as Code/ Cribl SDKs (Preview)/ SDK Code Examples/Configure Resources with the Cribl SDK

Configure Resources with the Cribl SDK

Preview Feature

The Cribl SDKs are Preview features that are still being developed. We do not recommend using them in a production environment, because the features might not be fully tested or optimized for performance, and related documentation could be incomplete.

Please continue to submit feedback through normal Cribl support channels, but assistance might be limited while the features remain in Preview.

This code example demonstrates how to use the Python SDK for the control plane to create the following resources in Cribl Stream:

  • A Worker Group to manage the configuration.
  • A Syslog Source to receive data on port 9021.
  • An S3 Destination to store processed data.
  • A Pipeline that filters events and keeps only data in the eventSource and eventID fields.
  • A Route that connects the Source, Pipeline, and Destination.

This example also deploys the resource configurations to a Worker Group to make them active.

About the Code Examples

The code examples use Bearer token authentication. Read the SDK authentication documentation to learn how to configure authentication. The Permissions granted to your Bearer token must include creating and managing resources.

Replace the variables in the examples with the corresponding information for your Cribl deployment.

For on-prem deployments, to use https in the URLs, you must configure Transport Layer Security (TLS).

The resource configurations in the examples do not include all available body parameters. For a complete list of body parameters for each resource, refer to the endpoint documentation in the API Reference.

Python SDK (Cribl.Cloud)Python SDK (On-Prem Deployment)