Table: slack_search - Query Slack Search Results using SQL
Slack Search is a feature within Slack that allows you to find specific items within your workspace, including messages, files, and users. It provides a way to navigate through the large amount of data generated in a busy workspace, and can be used to locate specific pieces of information, or to understand the context of a discussion or project. Slack Search helps you stay informed about the content and context of communications in your workspace.
Table Usage Guide
The slack_search
table provides insights into the search results within Slack. As a Slack workspace administrator or a team lead, explore specific details through this table, including messages, files, and users that match the search criteria. Utilize it to uncover information about communications, such as the context of a discussion, the details of a project, or the specific pieces of information you are looking for.
Important Notes
- You must specify the
query
in thewhere
clause to query this table.
Examples
Search for anything using standard slack search syntax
Explore the usage of standard Slack search syntax to pinpoint specific conversations. This can be particularly useful in larger teams where tracking down important information from a particular user or channel after a certain date can be time-consuming and challenging.
select user_name, timestamp, channel ->> 'name' as channel, textfrom slack_searchwhere query = 'in:#steampipe from:nathan urgent after:3/12/2021';
select user_name, timestamp, json_extract(channel, '$.name') as channel, textfrom slack_searchwhere query = 'in:#steampipe from:nathan urgent after:3/12/2021';
Consolidate results of multiple searches
Analyze the settings to understand urgent messages from specific users in a particular channel after a certain date. This can help in prioritizing responses and managing communication effectively.
select user_name, timestamp, channel ->> 'name' as channel, textfrom slack_searchwhere query in( 'in:#steampipe from:nathan urgent after:3/12/2021', 'in:#steampipe from:kai urgent after:3/12/2021' );
select user_name, timestamp, json_extract(channel, '$.name') as channel, textfrom slack_searchwhere query in( 'in:#steampipe from:nathan urgent after:3/12/2021', 'in:#steampipe from:kai urgent after:3/12/2021' );
Schema for slack_search
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
attachments | jsonb | Attachments matching the query. | |
blocks | jsonb | Block sections in the matching artifact. | |
channel | jsonb | Channel or conversation where the search result was found. | |
permalink | text | URL for the search result. | |
query | text | = | The search query. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
text | text | Search result text, including query. | |
timestamp | timestamp with time zone | Timestamp of the matching artifact. | |
type | text | Type of the artifact matching the search. | |
user_id | text | ID of the user responsible for the matching text. | |
user_name | text | Name of the user responsible for the matching text. | |
workspace_domain | text | =, !=, ~~, ~~*, !~~, !~~* | The domain name for the workspace. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- slack
You can pass the configuration to the command with the --config
argument:
steampipe_export_slack --config '<your_config>' slack_search