Skip to content

Commit

Permalink
Handle error.stack_trace case for ES 6.x template (#1176)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebeahan authored Dec 8, 2020
1 parent 5f5c4ec commit 8e1e8b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.next.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Thanks, you're awesome :-) -->

* Added a notice highlighting that the `tracing` fields are not nested under the
namespace `tracing.` #1162
* ES 6.x template data types will fallback to supported types. #1171
* ES 6.x template data types will fallback to supported types. #1171, #1176

#### Deprecated

Expand Down
7 changes: 7 additions & 0 deletions scripts/generators/es_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ def generate_template_version(elasticsearch_version, mappings_section, out_dir,
if elasticsearch_version == 6:
es6_mappings_section = copy.deepcopy(mappings_section)
es6_type_fallback(es6_mappings_section['properties'])

# error.stack_trace needs special handling to set
# index: false and doc_values: false
error_stack_trace_mappings = es6_mappings_section['properties']['error']['properties']['stack_trace']
error_stack_trace_mappings.setdefault('index', False)
error_stack_trace_mappings.setdefault('doc_values', False)

template['mappings'] = {'_doc': es6_mappings_section}
else:
template['mappings'] = mappings_section
Expand Down

0 comments on commit 8e1e8b7

Please sign in to comment.