-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Support v2 templates in ES indexing calls #17809
Comments
Pinging @elastic/ingest-management (Team:Ingest Management) |
Pinging @elastic/integrations (Team:Integrations) |
In case the generated templates are the same from Beats POV, I would opt to not send a |
Agreed on both points, assuming Beats does not need to do any v1->v2 migration work (which seems quite likely to be the case, but will know for sure after #17829) . |
@urso @ycombinator what would be the best way to enable that? Are you planning to have an option in the output that we can just set? |
@ph Yes, that could be one way: an option in the |
Good point, I think it depends at how we want to expose this to other use case. If we do not, we could add a new option under This seem to be a temporary usage so I would go on the easiest way to implement it. |
Good point — this option will go away at some point, probably 9.0. Easiest would be to make it an option on the ES output (potentially undocumented). So I'm +1 for this unless @urso has a different preference. |
No real preference :) We also have a 'private' CLI flag named In case we really introduce a |
Looks like the 'API' to install templates is changing as well:
|
We have added a workaround in the 7.8/7.x released of the agent. |
To make sure we use the v2 templates we must send on bulk request the params `prefer_v2_templates=true` if not it will default to v1 and will not try to use the v2 template at all. Reference: elastic#17809
#18318) * [Elastic Agent] Add params `prefer_v2_templates=true` on the ES output To make sure we use the v2 templates we must send on bulk request the params `prefer_v2_templates=true` if not it will default to v1 and will not try to use the v2 template at all. Reference: #17809 * [Libbeat] Respect the `parameters` option defined in the ES output. This make sure that any values defined in the `parameters` option of the ES output is correctly added to every bulk request query string. Fixes: #18325 * Adding tests Co-authored-by: Nicolas Ruflin <[email protected]>
The indexing part did become much easier for us ( |
@urso indeed its much simplier now. thanks for closing this. |
elastic#18318) * [Elastic Agent] Add params `prefer_v2_templates=true` on the ES output To make sure we use the v2 templates we must send on bulk request the params `prefer_v2_templates=true` if not it will default to v1 and will not try to use the v2 template at all. Reference: elastic#17809 * [Libbeat] Respect the `parameters` option defined in the ES output. This make sure that any values defined in the `parameters` option of the ES output is correctly added to every bulk request query string. Fixes: elastic#18325 * Adding tests Co-authored-by: Nicolas Ruflin <[email protected]> (cherry picked from commit d152d08)
#18318) (#18464) * [Elastic Agent] Add params `prefer_v2_templates=true` on the ES output To make sure we use the v2 templates we must send on bulk request the params `prefer_v2_templates=true` if not it will default to v1 and will not try to use the v2 template at all. Reference: #17809 * [Libbeat] Respect the `parameters` option defined in the ES output. This make sure that any values defined in the `parameters` option of the ES output is correctly added to every bulk request query string. Fixes: #18325 * Adding tests Co-authored-by: Nicolas Ruflin <[email protected]> (cherry picked from commit d152d08) Co-authored-by: Pier-Hugues Pellerin <[email protected]>
Elasticsearch is introducing v2 of index templates. To understand the motivation for this change and it's details, see: elastic/elasticsearch#53101.
In
7.x
(once elastic/elasticsearch#55411 is merged), Elasticsearch indexing APIs will accept an optional query string parameter:prefer_v2_templates
. In7.x
, the default value for this parameter will befalse
, indicating that v1 templates should be used. In8.0
, the default value will change totrue
, indicating that v2 templates should be used.This issue is to track changes needed in Beats to work with v2 templates. Concretely:
For
7.x
Beats:prefer_v2_templates=false
in indexing requests to Elasticsearch.prefer_v2_templates=true
in indexing requests to Elasticsearch.Starting
8.0.0
, Beats will use v2 index templates, either ones they create on their own (in standalone mode) or because Fleet created them beforehand. So such Beats should passprefer_v2_templates=true
in indexing requests to Elasticsearch.Related: #17829
The text was updated successfully, but these errors were encountered: