Back to plugin list
slack
Official
Premium

Slack

The CloudQuery Slack plugin extracts information from your Slack organization(s) and loads it into any supported CloudQuery destination

Publisher

cloudquery

Latest version

v3.2.3

Type

Source

Platforms
Date Published

Mar 12, 2024

Price per 1M rows

$20

free quota

1M rows

Set up process


brew install cloudquery/tap/cloudquery

1. Download CLI and login

See installation options

2. Create source and destination configs

Plugin configuration

cloudquery sync slack.yml postgresql.yml

3. Run the sync

CloudQuery sync

Overview

The CloudQuery Slack plugin extracts information from your Slack organization(s) and loads it into any supported CloudQuery destination (e.g. PostgreSQL, BigQuery, Snowflake, and more).

Installation

Install a custom Slack app with read-only permissions into your workspace by clicking the button below and following the instructions:
Once installed into the workspace, go to Install App (under Settings) and copy the Bot User OAuth Token. You will need this in your source config.

Configuration

This example syncs from Slack to a Postgres destination, using bot token authentication. The (top level) source spec section is described in the Source Spec Reference.
kind: source
# Common source-plugin configuration
spec:
  name: slack
  path: cloudquery/slack
  registry: cloudquery
  version: "v3.2.3"
  tables: ["*"]
  destinations: ["postgresql"]

  # Slack specific configuration
  spec:
    # required
    token: "${SLACK_API_TOKEN}"

Slack Spec

This is the (nested) spec used by the Slack source plugin.
  • token (string) (required)
    An API token to access Slack resources. This can be obtained by creating a Slack app.
  • debug (boolean) (optional) (default: false)
    Turn on to activate debug logging from the Slack SDK.

Syncing message histories

The Slack source plugin supports syncing of message histories, but only for channels that the bot is added to. If you would like to sync the messages and threads in a channel, add the CloudQuery bot that you installed in Step 1 to the channel before running a sync, and make sure that the slack_conversation_histories table is included in the tables list in your Slack plugin source config.

Example Queries

List all active users in the Slack workspace

select id, name from slack_users where deleted is not true;

Rank users by number of messages sent in public channels

select
    u.name, count(h.user)
from slack_conversation_histories h
    join slack_conversation_replies r on h.ts = r.conversation_history_ts
    join slack_users u on u.id = h.user
group by u.name order by count desc;

List all bookmarks

select title, link from slack_conversation_bookmarks;

List URLs to all uploaded files

select title, url_private from slack_files;

List all external files

select title, url_private from slack_files where is_external is true;


Subscribe to product updates

Be the first to know about new features.