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

Remove _all field from template for ES >= 6.0 #3778

Merged
merged 1 commit into from
Mar 22, 2017

Conversation

exekias
Copy link
Contributor

@exekias exekias commented Mar 21, 2017

Elasticsearch 6 deprecates _all field, this PR adds new templates for ES6 (removing _all), and moves 5.X ones back to *.template-es5x.json, following the same logic from es2x.

This change is only for 5.x branch, as master has template generation in place and I will have to tackle this from the code. Ideally I can wait for #3681 to be merged so we forget about shipping one file per ES version.

@exekias exekias added in progress Pull request is currently in progress. review labels Mar 21, 2017
@7AC
Copy link
Contributor

7AC commented Mar 21, 2017

Is there an issue for the ES change? Might want to link that in the commit message.

@exekias
Copy link
Contributor Author

exekias commented Mar 21, 2017

This is the change in ES: elastic/elasticsearch#22144

@exekias exekias force-pushed the support-es6x-templates branch 2 times, most recently from ca56ebf to 20b28fb Compare March 21, 2017 00:38
@@ -1,9 +1,6 @@
{
"mappings": {
"_default_": {
"_all": {
Copy link
Member

Choose a reason for hiding this comment

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

We should probably now call this template fielbeat.template.6x.json. Otherwise I think it is confusing that the "default" template is not for the stable version.

#template.versions.5x.enabled: true

# Path to the Elasticsearch 5.x version of the template file.
#template.versions.5x.path: "${path.config}/filebeat.template-es5x.json"
Copy link
Member

Choose a reason for hiding this comment

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

See my comment below about the naming. For the next months until 6 is GA, loading the 5.x is going to be the expected default. I'm thinking if we should have path config now for all versions? Problem is that we add even more config options (which will be remove afterwards) :-( WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I see the issue, had my doubts when setting it, perhaps the best thing we can do is switching to template-es6x and keep template.json as the default. Then deprecate this in 6.0 and move to the path based solution? Doing it now would break config compatibility

@exekias exekias force-pushed the support-es6x-templates branch 2 times, most recently from 3ed1927 to 912ecf0 Compare March 21, 2017 12:32
@exekias
Copy link
Contributor Author

exekias commented Mar 21, 2017

jenkins, package it please

@exekias
Copy link
Contributor Author

exekias commented Mar 21, 2017

Ready for a second review :)

@exekias exekias removed the in progress Pull request is currently in progress. label Mar 21, 2017
@@ -161,6 +165,8 @@ func TestOutputLoadTemplate(t *testing.T) {

if strings.HasPrefix(client.Connection.version, "2.") {
templatePath = "../../libbeat.template-es2x.json"
} else if strings.HasPrefix(client.Connection.version, "5.") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo here? Should it be 6.?

@tsg
Copy link
Contributor

tsg commented Mar 21, 2017

LGTM, apart from the minor comment above. Also, please add a CHANGELOG line.

ES 6.0 deprecates `_all`, see elastic/elasticsearch#22144.

`*.template-es6x.json` has been added in case Elasticsearch 6.X is
detected
@tsg tsg merged commit 1b778ef into elastic:5.x Mar 22, 2017
@tsg
Copy link
Contributor

tsg commented Mar 22, 2017

Nice work!

@ruflin
Copy link
Member

ruflin commented Mar 24, 2017

@exekias Nice work. Did you manually test this one with elasticsearch master? (manually)

@exekias
Copy link
Contributor Author

exekias commented Mar 24, 2017

Yes I did, worked for me :) I also checked how it was failing before my change

@ruflin
Copy link
Member

ruflin commented Mar 25, 2017

Awesome 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants