Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ public final class WatcherIndexTemplateRegistryField {
// version 3: include watch status in history
// version 6: upgrade to ES 6, removal of _status field
// version 7: add full exception stack traces for better debugging
// version 8: fix slack attachment property not to be dynamic, causing field type issues
// Note: if you change this, also inform the kibana team around the watcher-ui
public static final String INDEX_TEMPLATE_VERSION = "7";
public static final String INDEX_TEMPLATE_VERSION = "8";
public static final String HISTORY_TEMPLATE_NAME = ".watch-history-" + INDEX_TEMPLATE_VERSION;
public static final String TRIGGERED_TEMPLATE_NAME = ".triggered_watches";
public static final String WATCHES_TEMPLATE_NAME = ".watches";
Expand Down
7 changes: 7 additions & 0 deletions x-pack/plugin/core/src/main/resources/watch-history.json
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,13 @@
"properties" : {
"color" : {
"type" : "keyword"
},
"fields" : {
"properties" : {
"value" : {
"type" : "text"
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@
},
"input": {
"simple": {
"foo" : "something from input"
"foo" : "something from input",
"hits" : {
"hits" : [
{ "_source" : { "name" : "first", "value" : "2018-04-26T11:45:12.518Z" } },
{ "_source" : { "name" : "second", "value" : "anything" } }
]
}
}
},
"actions": {
Expand Down Expand Up @@ -49,7 +55,20 @@
}
]
}
]
],
"dynamic_attachments" : {
"list_path" : "ctx.payload.hits.hits",
"attachment_template" : {
"title": "Title",
"fields" : [
{
"title" : "Field title {{_source.name}}",
"value" : "{{_source.value}}",
"short" : true
}
]
}
}
}
}
}
Expand Down