Collection Basics
In this module, you'll become familiar with the simulated REST server, and then set up a simple REST collector in Cribl Stream.
Testing with curl
β
To verify that the REST server is running, open your Sandbox terminal and run the following command:
curl http://rest-server
You will receive a response:
It's a goat parade! ππππππππππππππππππππ
Congratulations! You've successfully obtained sample data from the server.
Configure REST Collector in Cribl Streamβ
Now we'll configure the same curl
command as a REST Collector in Cribl Stream.
We've identified an issue with the current Cribl software release that breaks the instructions in this lab. We'll fix it soon.
For now, you'll need to substitute the following domain name for all examples in the course:
`http://rest-server.${C.env.SANDBOX_NAMESPACE}.svc.cluster.local`
For example, if the instructions tell you to use:
`http://rest-server/goats/are/awesome`
You would use this URL instead:
`http://rest-server.${C.env.SANDBOX_NAMESPACE}.svc.cluster.local/goats/are/awesome`
Navigate to the REST Collector Source page. From the top nav of your Cribl Stream Sandbox, with Manage active, select Data > Sources, then select Collectors > REST from the Data Sources page's tiles. Click Add Collector to open the REST > Add Collector modal, which provides the following options and fields.
Note: If you do not see any Collector tiles, make sure you disable any ad blockers on the Cribl Sandbox's browser tab.
-
In the Collector ID field, enter
goat_parade
. -
In the Collect URL field, enter
'http://rest-server'
Note: the quotes are important! This is a JavaScript expressionβenabled field, and you must either wrap static strings inside quotes (single or double), or use the backtick (```), for template literal (string) evaluation.
-
At the bottom left, click βΊ Save & Run. In the Run configuration modal, click Run again.
We'll discuss filtering data later in this course.
In the Preview modal, the resulting goat parade output should match what you obtained using the curl
command.
Conclusionβ
You've set up a simple Collector to pull data and generate events from REST API data!
In the next module, you'll understand how Discovery works with Collection...