Skip to content

Slack ​

slack is a messaging platform for teams and organizations where they can collaborate, share ideas and information.

Bruin supports Slack as a source for Ingestr assets, and you can use it to ingest data from Slack into your data warehouse.

In order to set up Slack connection, you need to add a configuration item in the .bruin.yml file and in asset file. You need the api_key. For details on how to obtain these credentials, please refer here.

Follow the steps below to correctly set up Slack as a data source and run ingestion:

Configuration ​

Step 1: Add a connection to .bruin.yml file ​

To connect to Slack, you need to add a configuration item to the connections section of the .bruin.yml file. This configuration must comply with the following schema:

yaml
    connections:
      slack:
        - name: "my-slack"
          api_key: "YOUR_SLACK_API_KEY"

Step 2: Create an asset file for data ingestion ​

To ingest data from Slack, you need to create an asset configuration file. This file defines the data flow from the source to the destination. Create a YAML file (e.g., slack_ingestion.yml) inside the assets folder and add the following content:

yaml
name: public.slack
type: ingestr
connection: postgres

parameters:
  source_connection: my-slack
  source_table: 'users'
  destination: postgres
  • name: The name of the asset.
  • type: Specifies the type of the asset. It will be always ingestr type for Slack.
  • connection: This is the destination connection.
  • source_connection: The name of the Slack connection defined in .bruin.yml.
  • source_table: The name of the data table in Slack you want to ingest.

Available Source Tables ​

TablePKInc KeyInc StrategyDetails
channelsid-replaceRetrieves information about all the channels
usersid-replaceRetrieves all the users
messages:chan1,chan2tstsappend/mergeRetrieves messages from specified channels (e.g., general, memes). Multiple channels can be listed separated by commas
access_logsuser_id-appendRetrieves access logs

Step 3: Run asset to ingest data ​

bash
bruin run assets/slack_ingestion.yml

As a result of this command, Bruin will ingest data from the given Slack table into your Postgres database.