PostSlack

Description:

Sends a message on Slack. The FlowFile content (e.g. an image) can be uploaded and attached to the message.

Additional Details...

Tags:

slack, post, notify, upload, message

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, whether a property supports the NiFi Expression Language, and whether a property is considered "sensitive", meaning that its value will be encrypted. Before entering a value in a sensitive property, ensure that the nifi.properties file has an entry for the property nifi.sensitive.props.key.

NameDefault ValueAllowable ValuesDescription
Post Message URLhttps://slack.com/api/chat.postMessageSlack Web API URL for posting text messages to channels. It only needs to be changed if Slack changes its API URL.
File Upload URLhttps://slack.com/api/files.uploadSlack Web API URL for uploading files to channels. It only needs to be changed if Slack changes its API URL.
Access TokenOAuth Access Token used for authenticating/authorizing the Slack request sent by NiFi.
Sensitive Property: true
ChannelSlack channel, private group, or IM channel to send the message to.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
TextText of the Slack message to send. Only required if no attachment has been specified and 'Upload File' has been set to 'No'.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Upload FlowFilefalse
  • Yes Upload and attach FlowFile content to the Slack message.
  • No Don't upload and attach FlowFile content to the Slack message.
Whether or not to upload and attach the FlowFile content to the Slack message.
File TitleTitle of the file displayed in the Slack message. The property value will only be used if 'Upload FlowFile' has been set to 'Yes'.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
File Name${filename}Name of the file to be uploaded. The property value will only be used if 'Upload FlowFile' has been set to 'Yes'. If the property evaluated to null or empty string, then the file name will be set to 'file' in the Slack message.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
File Mime Type${mime.type}Mime type of the file to be uploaded. The property value will only be used if 'Upload FlowFile' has been set to 'Yes'. If the property evaluated to null or empty string, then the mime type will be set to 'application/octet-stream' in the Slack message.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)

Dynamic Properties:

Dynamic Properties allow the user to specify both the name and value of a property.

NameValueDescription
<Arbitrary name>JSON snippet specifying a Slack message "attachment"The property value will be converted to JSON and will be added to the array of attachments in the JSON payload being sent to Slack. The property name will not be used by the processor.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)

Relationships:

NameDescription
successFlowFiles are routed to success after being successfully sent to Slack
failureFlowFiles are routed to failure if unable to be sent to Slack

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
slack.file.urlThe Slack URL of the uploaded file. It will be added if 'Upload FlowFile' has been set to 'Yes'.

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component requires an incoming relationship.

System Resource Considerations:

None specified.