On This Page

Home / Cribl as Code/ Cribl SDKs (Preview)/ SDK Code Examples/Add a Cribl Search Pack and Create a Lake Dataset with the Cribl SDK

Add a Cribl Search Pack and Create a Lake Dataset 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:

This example includes the Pack URL for Cribl Search AWS VPC Flow Logs, which is used as the value of the source parameter. To get the URL for a different Pack, see Get the URL for a Search Pack.

About Code Examples

Code examples use Bearer token authentication. Read the SDK authentication documentation to learn how to configure authentication. The API Credential that you use to obtain the Bearer token must have the necessary Permissions for the operations in the code examples.

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

Cribl Search and Cribl Lake are available only on Cribl.Cloud, so this page does not include examples for on-prem deployments.

Code examples do not include all available body parameters. For a complete list of body parameters for specific endpoints, refer to the documentation in the API Reference.

Python SDK (Cribl.Cloud)

Get the URL for a Search Pack

To add a Search Pack from the Cribl Packs Dispensary or the Dispensary GitHub Repository, provide the Pack URL as the value for the source parameter in your request. The URL must be the direct URL location of the .crbl file for the Pack.

Read Pack Repositories to learn about the differences between the Cribl Packs Dispensary and the Dispensary GitHub Repository.

Here’s how to get a Pack’s URL from the Cribl Packs Dispensary:

  1. Search the Cribl Packs Dispensary to find the Pack that you want to add. Select the Pack’s tile to open the Pack sidebar.

  2. Open the developer tools for your browser and select the Network tab.

  3. At the upper-right of the Pack sidebar, select the download icon.

  4. In your browser’s developer tools, in the Name column, select the entry for the Pack’s .crbl file and the Headers tab. Copy the Request URL: the copied URL is the value to provide for the source parameter in your request.

Location of Pack URL in Browser’s Developer Tools
Location of Pack URL in Browser’s Developer Tools

To get a Pack’s URL from the Dispensary GitHub Repository:

  1. Search the Dispensary GitHub Repository to find the repository for the Pack that you want to add. Select the Pack’s repository to open it.

  2. In the right sidebar, select Releases.

  3. On the Releases page, find the release that you want to use and expand the Assets section.

  4. In the Assets section, find the .crbl file for the Pack. Right-click the .crbl file and select the option to copy the link. The copied link URL is the value to provide for the source parameter in your request.

Location of .crbl File Link to Use as the Pack URL
Location of .crbl File Link to Use as the Pack URL