Each rule is a seperate json file which consists of some rule options and a series of actions to execute if the rule matches. A rule will generally be either a match from slack input, a schedule or a web url.
json:
{
"rule": "Say Hello",
"match": "hello",
"actions": [
{
"type": "hex-response",
"command": "Hello ${hex.user}!"
}
]
}
yaml:
---
rule: "Say Hello"
match: "hello"
actions:
- type: "hex-response"
command: "Hello ${hex.user}!"
- Config:
rule
- Description: Name of the rule, also used as the title for formatted output
- Default:
- Type: string
- Config:
match
- Description: String to match with * as wild card or /../ as regular expression
- Default:
- Type: string
- Config:
schedule
- Description: Cron style schedule with seconds
- Default:
- Type: string
- Config:
url
- Description: URL to match for incoming webhooks
- Default:
- Type: string
- Config:
acl
- Description: A comma delimited list of users and channels allowed to execute the rule
- Default: *
- Type: string
- Config:
channel
- Description: A channel to send output to if a schedule or if you want a place for all output to be copied to
- Default:
- Type: string
- Config:
format
- Description: Flag to format output when displaying in slack
- Default: false
- Type: bool
- Config:
threaded
- Description: Flag to set if the messages for each action should be threaded
- Default: false
- Type: bool
- Config:
output_fail_only
- Description: Flag to only output if a failure
- Default: false
- Type: bool
- Config:
output_on_change
- Description: Flag to output on any status change
- Default: false
- Type: bool
- Config:
group_output
- Description: Flag to output all actions as one message
- Default: false
- Type: bool
- Config:
lock
- Description: Flag to lock running to one at a time
- Default: false
- Type: bool
- Config:
help
- Description: Custom help to display for the rule
- Default:
- Type: string
- Config:
hide
- Description: Flag for displaying help or not when user lists commands
- Default: false
- Type: bool
- Config:
active
- Description: Flag for if the rule is run or not
- Default: true
- Type: bool
- Config:
debug
- Description: Flag for extra debug output in the logs
- Default: false
- Type: bool
- Config:
type
- Description: The type of action, also known as the plugin to execute
- Default:
- Type: string
- Config:
command
- Description: The command to give the plugin to resolve
- Default:
- Type: string
- Config:
hide_output
- Description: An option to not show the output of an action
- Default: false
- Type: bool
- Config:
output_to_var
- Description: An option to take the output of the action and save it to the
hex.outputs.<action number>.response
var - Default: false
- Type: bool
- Config:
output_fail_only
- Description: Flag to only output action if a failure
- Default: false
- Type: bool
- Config:
run_on_fail
- Description: A flag to let this action run if previous steps have failed
- Default: false
- Type: bool
- Config:
last_config
- Description: A flag to reuse the previous actions configuration (as a time saver)
- Default: false
- Type: bool
- Config:
config
- Description: A set of key/value string pairs that can be plugin specific
- Default:
- Type: string key/value