Back to plugin list
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
v4.6.0
Type
Source
Platforms
Date Published
Price per 1M rows
Starting from $15
monthly free quota
1M rows
Set up process #
brew install cloudquery/tap/cloudquery
1. Download CLI and login
2. Create source and destination configs
Plugin configurationOverview #
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: "v4.6.0"
tables: ["*"]
destinations: ["postgresql"]
# Slack specific configuration
# Learn more about the configuration options at https://cql.ink/slack_source
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.concurrency
(integer
, optional, default:10000
) A best effort maximum number of Go routines to use. Lower this number to reduce memory usage.scheduler
(string
, optional, default:dfs
) The scheduler to use when determining the priority of resources to sync. Supported values aredfs
(depth-first search),round-robin
,shuffle
andshuffle-queue
.For more information about this, see performance tuning.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;