Skip to content

Commit

Permalink
Merge pull request #300 from nsano-rururu/add_slack_alert_fields_to_s…
Browse files Browse the repository at this point in the history
…chema_yaml

Added slack_alert_fields to schema.yaml
  • Loading branch information
jertel authored Jun 26, 2021
2 parents 8f9ab97 + aa101ac commit 5155a58
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
13 changes: 13 additions & 0 deletions elastalert/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ definitions:
milliseconds: {type: number}
schedule: {type: string}

slackField: &slackField
type: object
additionalProperties: false
properties:
title: {type: string}
value: {type: string}
short: {type: boolean}

arrayOfSlackFields: &arrayOfSlackField
type: array
items: *slackField

mattermostField: &mattermostField
type: object
additionalProperties: false
Expand Down Expand Up @@ -502,6 +514,7 @@ properties:
slack_parse_override: {enum: [none, full]}
slack_text_string: {type: string}
slack_proxy: {type: string}
slack_alert_fields: *arrayOfSlackField
slack_ignore_ssl_errors: {type: boolean}
slack_title: {type: string}
slack_title_link: {type: string}
Expand Down
8 changes: 4 additions & 4 deletions tests/alerters/slack_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,12 +850,12 @@ def test_slack_alert_fields():
{
'title': 'Host',
'value': 'somefield',
'short': 'true'
'short': True
},
{
'title': 'Sensors',
'value': '@timestamp',
'short': 'true'
'short': True
}
],
'alert_subject': 'Cool subject',
Expand Down Expand Up @@ -884,12 +884,12 @@ def test_slack_alert_fields():
'fields':
[
{
'short': 'true',
'short': True,
'title': 'Host',
'value': 'foobarbaz'
},
{
'short': 'true',
'short': True,
'title': 'Sensors',
'value': '2016-01-01T00:00:00'
}
Expand Down

0 comments on commit 5155a58

Please sign in to comment.