Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Composable Templates to support Elasticsearch 8.0 #980

Merged

Conversation

kaisecheng
Copy link
Contributor

@kaisecheng kaisecheng commented Nov 19, 2020

Elasticsearch's /_template API is being deprecated in 7.8, this PR migrate to Composable Templates (see: elastic/elasticsearch#53101).
Fix: #944

  • Use the new endpoint _index_template to manage template if elasticsearch version >= 8
  • Add a new template 8x with priority set for default usage
  • Data stream option will be handled in elasticsearch data stream plugin
  • Bump version

@kaisecheng kaisecheng changed the title [WIP] Implement Composable Templates to support Elasticsearch 8.0 Implement Composable Templates to support Elasticsearch 8.0 Nov 23, 2020
@kaisecheng kaisecheng assigned kaisecheng and unassigned kaisecheng Nov 23, 2020
@elasticsearch-bot elasticsearch-bot self-assigned this Nov 23, 2020
@@ -59,7 +59,12 @@ def default_mapping_from_mappings(mappings)
end

def field_properties_from_template(template_name, field)
mappings = @es.indices.get_template(name: template_name)[template_name]["mappings"]
template = get_template(@es, template_name)
mappings = if ESHelper.es_version_satisfies?(">=8")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: maybe for consistency we could also have a get_mapping method similar to get_template?

@colinsurprenant
Copy link
Contributor

LGTM
Thanks @kaisecheng!
Left minor comment, feel free to merge.

@kaisecheng kaisecheng merged commit 853871b into logstash-plugins:master Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Composable Templates to support Elasticsearch 8.0
3 participants