Skip to content
6 changes: 6 additions & 0 deletions docs/changelog/117701.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 117701
summary: Watcher history index has too many indexed fields -
area: Watcher
type: bug
issues:
- 71479
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ public final class WatcherIndexTemplateRegistryField {
// version 14: move watch history to data stream
// version 15: remove watches and triggered watches, these are now system indices
// version 16: change watch history ILM policy
// version 17: exclude input chain from indexing
// Note: if you change this, also inform the kibana team around the watcher-ui
public static final int INDEX_TEMPLATE_VERSION = 16;
public static final int INDEX_TEMPLATE_VERSION = 17;
public static final String HISTORY_TEMPLATE_NAME = ".watch-history-" + INDEX_TEMPLATE_VERSION;
public static final String HISTORY_TEMPLATE_NAME_NO_ILM = ".watch-history-no-ilm-" + INDEX_TEMPLATE_VERSION;
public static final String[] TEMPLATE_NAMES = new String[] { HISTORY_TEMPLATE_NAME };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@
"enabled": false
}
}
},
{
"disabled_result_input_chain_fields": {
"path_match": "result.input.chain",
"mapping": {
"type": "object",
"enabled": false
}
}
}
],
"dynamic": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@
"enabled": false
}
}
},
{
"disabled_result_input_chain_fields": {
"path_match": "result.input.chain",
"mapping": {
"type": "object",
"enabled": false
}
}
}
],
"dynamic": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void testFailedInputResultWithDotsInFieldNameGetsStored() throws Exceptio
String chainedPath = SINGLE_MAPPING_NAME
+ ".properties.result.properties.input.properties.chain.properties.chained.properties.search"
+ ".properties.request.properties.body.enabled";
assertThat(source.getValue(chainedPath), is(false));
assertThat(source.getValue(chainedPath), nullValue());
} else {
String path = SINGLE_MAPPING_NAME
+ ".properties.result.properties.input.properties.search.properties.request.properties.body.enabled";
Expand Down Expand Up @@ -168,11 +168,11 @@ public void testPayloadInputWithDotsInFieldNameWorks() throws Exception {
XContentType.JSON
);

// lets make sure the body fields are disabled
// let's make sure the body fields are disabled or, in the case of chained, the whole object is not indexed
if (useChained) {
String path = SINGLE_MAPPING_NAME
+ ".properties.result.properties.input.properties.chain.properties.chained.properties.payload.enabled";
assertThat(source.getValue(path), is(false));
assertThat(source.getValue(path), nullValue());
} else {
String path = SINGLE_MAPPING_NAME + ".properties.result.properties.input.properties.payload.enabled";
assertThat(source.getValue(path), is(false));
Expand Down