Creating Our Sources and Destinations
We need to create two Sources (dev -> datagen, prod -> syslog) and two Destinations (dev -> Elasticsearch dev index, prod -> Elasticsearch prod index). Let's get started...
- Click the
Stream Devtop tab. - In Cribl's own top nav, click the
Cribllogo at left to unroll the product selector. - Select
Streamfrom this menu to expand Stream's top nav. - Click
Manageon this top nav. - Click into the
defaultWorker Group. - Click the
Datasubmenu, then clickSources. - On the resulting
Manage Sourcespage, locate theDatagentile near the bottom (you can type its name into the filter box), and click the tile. - On the resulting
Manage Sources / Datagenpage, clickAdd Source. - In the
Add Sourcedialog, forInput ID, enterdev_apache. - From the
Data Generator Filedrop-down, select theapache_common.logfile. - Click the dialog's
Advanced Settingsleft tab, and then enterdevin theEnvironmentfield. (This key setting instructs Stream to enable this Apache datagen Source only in ourdevenvironment.) - Click
Save, and look for a green confirmation message. - Click
Commitat Stream's upper right corner. NOTE: There might be a pending deploy from our original commit. If so, go ahead and deploy. This will allow theCommitbutton to become active again. - In the resulting
Git Changes – Group defaultdialog, enter a commit message (e.g.,Enable datagen on dev). - Click
Commit and Deploy, and look for green confirmation messages.
In a distributed environment, you must commit changes to the local Git repo, and deploy them, for your new configuration to take effect on any Worker Group.
Note the dev_apache ID we gave this Source. In a multi-instance environment – e.g., with a development and a production branch, like we're configuring here) – it's helpful to identify the environment as you configure an environment-specific component. This makes it easier to troubleshoot and understand data flow.
After a couple of minutes, your new configuration should be deployed to the development environment.
The resulting entry on the Manage Datagen Sources page might show up as greyed out and Inactive. Some Stream versions have a bug where the UI doesn't properly honor the Environment setting (CRIBL-7532). You can still validate that your Datagen is working:
- Click the
dev_apacherow to reopen this Source's config dialog. - Click the dialog's
Live Datatab.
If the resulting capture window shows data flowing, then the Source is set up properly, and you can just close the dialog. If it doesn't show data flowing, go back and check your config against the setup steps above. If the config looks correct, then it likely hasn't fully deployed yet. Wait a few minutes, and try again.
Now let's configure the production Source. Note that although we'll bind this Source to our production environment (branch), we'll configure it here in the same development Stream instance.
Why? Because GitOps. When we set our production Stream instance to its Push workflow, we made it a read-only environment. It can now get new configs only via a push operation from its remote repo.
- If you're still on the Datagen Source dialog, click its close box.
- On the
Manage Sourcespage's left sidebar, clickSyslog. - On the
Manage Sources / Syslogpage, clickAdd Source. - In the
Add Sourcedialog, enterprod_apachein theInput IDfield, and enter the number6514in theTCP portfield. (We'll ingest data only via TCP, not UDP.) - Click the dialog's
Advanced Settingsleft tab, and then enterprodin theEnvironmentfield. - Click
Save, and look for a green confirmation message. - Click
Commitat Stream's upper right corner. - In the resulting
Git Changes – Group defaultdialog, enter a commit message (e.g.,Enable Apache syslog on prod). - Click
Commit and Deploy, and look for green confirmation messages.
The prod_apache source should show up in the list of Syslog Sources, but greyed out. This is its intended state here in the development environment.
We now have our two Sources configured properly. Let's do the same with our Destinations. For the sake of resources, we'll use a single Elasticsearch instance, but with two different indices: dev and prod.
Development
- From Stream's submenu, click
Data > Destinations. - Locate and click the
Elasticsearchtile. (You can typeElasticinto the filter box, or scroll down to find the tile.) - On the resulting
Manage Destinations / Elasticsearchpage, clickAdd Destination. - In the
Add Destinationdialog, forOutput ID, enterdev_logs. - In the
Bulk API URLscolumn'sURLfield, enter:http://elasticsearch-master:9200/_bulk - In the
Index or Data Stream*field, enterdev. - Click the
Advanced Settingsleft tab. - Scroll down to the
Environmentfield and enterdev. - Click
Save, and look for a green confirmation message.
Production
- Still on the
Manage Destinations / Elasticsearchpage, again clickAdd Destination, to create a different instance of this Destination. - In the
Add Destinationdialog, for theOutput ID, enterprod_logs. - In the
Bulk API URLscolumn'sURLfield, enter:http://elasticsearch-master:9200/_bulk - In the
Index or Data Stream*field, enterprod. - Click the
Advanced Settingsleft tab. - Scroll down to the
Environmentfield and enterprod - Click
Save, and look for a green confirmation message. - Click
Commitat Stream's upper right corner, enter a commit message (e.g.,Enable 2 Elasticsearch Destinations), and then clickCommit and Deploy.
Our two Sources and two Destinations are configured. Now let's create our Route and Pipeline, and get GitOps going.