Skip to content

Commit 1392521

Browse files
authored
Making schema more strict (Yelp#8)
* Making schema more strict
1 parent 53ab1ba commit 1392521

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

elastalert/schema.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ definitions:
1111
type: [string, array]
1212
items: {type: [string, array]}
1313

14+
timedelta: &timedelta
15+
type: object
16+
additionalProperties: false
17+
properties:
18+
days: {type: number}
19+
weeks: {type: number}
20+
hours: {type: number}
21+
minutes: {type: number}
22+
seconds: {type: number}
23+
milliseconds: {type: number}
24+
1425
timeFrame: &timeframe
1526
type: object
1627
additionalProperties: false
@@ -205,12 +216,12 @@ properties:
205216

206217
### Kibana Discover App Link
207218
generate_kibana_discover_url: {type: boolean}
208-
kibana_discover_app_url: {type: string}
219+
kibana_discover_app_url: {type: string, format: uri}
209220
kibana_discover_version: {type: string, enum: ['7.3', '7.2', '7.1', '7.0', '6.8', '6.7', '6.6', '6.5', '6.4', '6.3', '6.2', '6.1', '6.0', '5.6']}
210-
kibana_discover_index_pattern_id: {type: string}
211-
kibana_discover_columns: {type: array, items: {type: string}}
212-
kibana_discover_from_timedelta: *timeframe
213-
kibana_discover_to_timedelta: *timeframe
221+
kibana_discover_index_pattern_id: {type: string, minLength: 1}
222+
kibana_discover_columns: {type: array, items: {type: string, minLength: 1}, minItems: 1}
223+
kibana_discover_from_timedelta: *timedelta
224+
kibana_discover_to_timedelta: *timedelta
214225

215226
# Alert Content
216227
alert_text: {type: string} # Python format string

0 commit comments

Comments
 (0)