Default to @timestamp in composable template datastream definition#59317
Default to @timestamp in composable template datastream definition#59317andreidan merged 29 commits intoelastic:masterfrom
Conversation
This makes the data_stream timestamp field specification optional when defining a composable template. When there isn't one specified it will default to `@timestamp`.
|
Pinging @elastic/es-core-features (:Core/Features/Data streams) |
|
Pinging @elastic/es-docs (>docs) |
There was a problem hiding this comment.
Docs LGTM.
Since @timestamp will soon be both the required and default timestamp field, I don't see much point in telling users to supply a non-empty data_stream object body, even optionally. Let me know if there is some context I'm missing tho. Thanks!
| (Optional, string) The name of the timestamp field. This field must be present | ||
| in all documents indexed into the data stream and must be of type | ||
| <<date, `date`>> or <<date_nanos, `date_nanos`>>. | ||
| <<date, `date`>> or <<date_nanos, `date_nanos`>>. Defaults to `@timestamp`. |
There was a problem hiding this comment.
I'd change the last sentence to:
Must be
@timestamp, which is the default.
@jrodewig if a user doesn't supply the empty |
|
@dakrone Sorry for the confusion. I wasn't clear in my original comment. I meant that we should just tell users to supply: Instead of: The defs produce the same results now so there is no point of even telling them about the |
@jrodewig I agree it's rather redundant. However I believe the plan is to eventually allow a custom timestamp field configuration. Happy to keep it simple for now and not mention it if that's your preference though. @martijnvg what do you think? |
Co-authored-by: James Rodewig <james.rodewig@elastic.co>
|
@elasticmachine update branch |
+1, and I think we shouldn't even allow the |
|
@elasticmachine update branch |
martijnvg
left a comment
There was a problem hiding this comment.
Looks good. I left a question
|
|
||
| static { | ||
| PARSER.declareString(ConstructingObjectParser.constructorArg(), DataStream.TIMESTAMP_FIELD_FIELD); | ||
| PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), DataStream.TIMESTAMP_FIELD_FIELD); |
There was a problem hiding this comment.
maybe remove this field from the xcontent format? So that the only valid format is an empty json object?
There was a problem hiding this comment.
Yes, good point. i'll drop the field completely in the POJO but keep the data_stream empty JSON object
…lastic#59317) This makes the data_stream timestamp field specification optional when defining a composable template. When there isn't one specified it will default to `@timestamp`. (cherry picked from commit 5609353) Signed-off-by: Andrei Dan <andrei.dan@elastic.co>
This reverts commit 909de77.
|
@andreidan The PR description states that this PR "makes the data_stream timestamp field specification optional", but it looks like it actually removes it completely. Could you please clarify or update the PR description if it's incorrect? |
Removes the `@timestamp` field mapping from several data stream index template snippets. With #59317, the `@timestamp` field defaults to a `date` field data type for data streams.
|
@cjcenizal thanks for pointing it out. changed the description to reflect the actual/final behaviour. |
elastic#71670 Caused by elastic/elasticsearch#59317 Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
elastic#71670 Caused by elastic/elasticsearch#59317 Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
elastic#71670 Caused by elastic/elasticsearch#59317 Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
elastic#71670 Caused by elastic/elasticsearch#59317 Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
#71670 Caused by elastic/elasticsearch#59317 Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
#71670 Caused by elastic/elasticsearch#59317 Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
This removes the data_stream timestamp field specification when
defining a composable template.
The timestamp field is locked to
@timestampfor which we provide a defaultmapping of type
datewith default options (added with #59244 ), but the usercan still provide a custom mapping in the template.
The
data_streamdefinition in the composable template is now an empty object:Relates to #53100