class_docstr: SlackOutput handles all alert dispatching for Slack
class_docstr_tok: ["SlackOutput","handles","all","alert","dispatching","for","Slack"]
docstr: Send alert text to Slack
  
  Publishing:
      By default the slack output sends a slack message comprising some default intro text
      and a series of attachments containing:
      * alert description
      * alert record, chunked into pieces if it's too long
  
      To override this behavior use the following fields:
  
      - @slack.text (str):
              Replaces the text that appears as the first line in the slack message.
  
      - @slack.attachments (list[dict]):
              A list of individual slack attachments to include in the message. Each
              element of this list is a dict that must adhere to the syntax of attachments
              on Slack's API.
  
              @see cls._standardize_custom_attachments() for some insight into how individual
              attachments can be written.
  
  Args:
      alert (Alert): Alert instance which triggered a rule
      descriptor (str): Output descriptor
  
  Returns:
      bool: True if alert was sent successfully, False otherwise
docstr_tok: ["Send","alert","text","to","Slack","Publishing",":","By","default","the","slack","output","sends","a","slack","message","comprising","some","default","intro","text","and","a","series","of","attachments","containing",":","*","alert","description","*","alert","record",",","chunked","into","pieces","if","it","'s","too","long","To","override","this","behavior","use","the","following","fields",":","-","@","slack.text","(","str",")",":","Replaces","the","text","that","appears","as","the","first","line","in","the","slack","message",".","-","@","slack.attachments","(","list","[","dict","]",")",":","A","list","of","individual","slack","attachments","to","include","in","the","message",".","Each","element","of","this","list","is","a","dict","that","must","adhere","to","the","syntax","of","attachments","on","Slack","'s","API",".","@","see","cls._standardize_custom_attachments","(",")","for","some","insight","into","how","individual","attachments","can","be","written",".","Args",":","alert","(","Alert",")",":","Alert","instance","which","triggered","a","rule","descriptor","(","str",")",":","Output","descriptor","Returns",":","bool",":","True","if","alert","was","sent","successfully",",","False","otherwise"]
code: def _dispatch(self, alert, descriptor):
      """Send alert text to Slack
  
      Publishing:
          By default the slack output sends a slack message comprising some default intro text
          and a series of attachments containing:
          * alert description
          * alert record, chunked into pieces if it's too long
  
          To override this behavior use the following fields:
  
          - @slack.text (str):
                  Replaces the text that appears as the first line in the slack message.
  
          - @slack.attachments (list[dict]):
                  A list of individual slack attachments to include in the message. Each
                  element of this list is a dict that must adhere to the syntax of attachments
                  on Slack's API.
  
                  @see cls._standardize_custom_attachments() for some insight into how individual
                  attachments can be written.
  
      Args:
          alert (Alert): Alert instance which triggered a rule
          descriptor (str): Output descriptor
  
      Returns:
          bool: True if alert was sent successfully, False otherwise
      """
      creds = self._load_creds(descriptor)
      if not creds:
          return False
  
      publication = compose_alert(alert, self, descriptor)
  
      slack_message = self._format_message(alert, publication)
  
      try:
          self._post_request_retry(creds["url"], slack_message)
      except OutputRequestFailure:
          return False
  
      return True
  
file_path: streamalert/streamalert/alert_processor/outputs/slack.py
imports: import html
  from collections import OrderedDict
  from streamalert.alert_processor.helpers import compose_alert, elide_string_middle
  from streamalert.alert_processor.outputs.output_base import OutputDispatcher, OutputProperty, OutputRequestFailure, StreamAlertOutput
  from streamalert.shared.logger import get_logger
label_desc: Use image node_id 10 for calling the SlackOutput obj's underlying member method code with example usage: obj._dispatch(alert, descriptor) and returns: True, False, False