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

Define ecs.version as a constant_keyword field #9043

Closed
axw opened this issue Sep 6, 2022 · 2 comments · Fixed by #9208
Closed

Define ecs.version as a constant_keyword field #9043

axw opened this issue Sep 6, 2022 · 2 comments · Fixed by #9208
Assignees
Milestone

Comments

@axw
Copy link
Member

axw commented Sep 6, 2022

We set ecs.version using a model processor, in the apm-server code, based on the version of the github.com/elastic/ecs/code/go/ecs module in use:

// ecsVersionBatchProcessor is a model.BatchProcessor that sets the ECSVersion
// field of each event to the ECS library version.
func ecsVersionBatchProcessor(ctx context.Context, b *model.Batch) error {
for i := range *b {
event := &(*b)[i]
event.ECSVersion = ecs.Version
}
return nil
}

An older version of APM Server may send documents to the data streams, and the ingest pipeline is responsible for upgrading/transforming documents to the appropriate format. Therefore I believe it makes sense for the ECS version to be set by the installed ingest pipeline and index template. We can do this by making ecs.version a constant_keyword field.

This will also allow the code to be simplified, and documents to be made (slightly) smaller.

@axw axw added the enhancement label Sep 6, 2022
@simitt
Copy link
Contributor

simitt commented Sep 14, 2022

the ingest pipeline is responsible for upgrading/transforming documents to the appropriate format.

Would this issue also contain the work to put the ingest pipeline for adding the ECS version in place?

@axw
Copy link
Member Author

axw commented Sep 14, 2022

Would this issue also contain the work to put the ingest pipeline for adding the ECS version in place?

I think all we need to do is:

  • set ecs.version to a constant_keyword field in each data stream's ecs.yml file, and specify the constant value
  • stop setting ecs.version in documents sent to Elasticsearch

@simitt simitt added this to the 8.6 milestone Sep 14, 2022
@axw axw self-assigned this Sep 27, 2022
@axw axw closed this as completed in #9208 Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants