The current spec/validation rules for TSDB fields allows setting a constant_keyword field as dimension. The package builds and the validation step succeeds. However, upon trying to install the package, it fails with:
Error: can't install the package: could not zip-install package; API status code = 500; response body = {"statusCode":500,"error":"Internal Server Error","message":"mapper_parsing_exception\n\tCaused by:\n\t\tmapper_parsing_exception: unknown parameter [time_series_dimension] on mapper [namespace] of type [constant_keyword]\n\tRoot causes:\n\t\tmapper_parsing_exception: unknown parameter [time_series_dimension] on mapper [namespace] of type [constant_keyword]"}
Similar to #1106, the list of supported types for dimension fields is validated in
|
var allowedDimensionTypes = []string{ |
Which allows for constant_keyword.
Steps to reproduce:
With elastic-package
- set some constant keyword as TSDB dimension. For example in the linux integration:
diff --git a/packages/linux/data_stream/conntrack/fields/base-fields.yml b/packages/linux/data_stream/conntrack/fields/base-fields.yml
index 55fc16df87..a88e935670 100644
--- a/packages/linux/data_stream/conntrack/fields/base-fields.yml
+++ b/packages/linux/data_stream/conntrack/fields/base-fields.yml
@@ -1,20 +1,25 @@
- name: data_stream.type
type: constant_keyword
description: Data stream type.
+ dimension: true
- name: data_stream.dataset
type: constant_keyword
description: Data stream dataset.
+ dimension: true
- name: data_stream.namespace
type: constant_keyword
description: Data stream namespace.
+ dimension: true
- name: '@timestamp'
type: date
description: Event timestamp.
- name: event.module
type: constant_keyword
description: Event module
+ dimension: true
value: linux
- name: event.dataset
type: constant_keyword
description: Event dataset
+ dimension: true
value: linux.conntrack
diff --git a/packages/linux/data_stream/conntrack/manifest.yml b/packages/linux/data_stream/conntrack/manifest.yml
index 254989e11e..78a64a2758 100644
--- a/packages/linux/data_stream/conntrack/manifest.yml
+++ b/packages/linux/data_stream/conntrack/manifest.yml
@@ -1,5 +1,7 @@
title: System conntrack metrics
type: metrics
+elasticsearch:
+ index_mode: "time_series"
streams:
- input: linux/metrics
vars:
- build and install the package:
elastic-package build
[...]
2026/03/10 17:27:29 DEBUG Validating built .zip package (path: /home/ainsoph/devel/github.com/elastic/integrations/build/packages/linux-1.1.0.zip)
Package built: /home/ainsoph/devel/github.com/elastic/integrations/build/packages/linux-1.1.0.zip
Done
Observe the build works, the
elastic-package install -v
[...]
2026/03/10 17:21:52 DEBUG Validating built .zip package (path: /home/ainsoph/devel/github.com/elastic/integrations/build/packages/linux-1.1.0.zip)
Error: can't install the package: could not zip-install package; API status code = 500; response body = {"statusCode":500,"error":"Internal Server Error","message":"mapper_parsing_exception\n\tCaused by:\n\t\tmapper_parsing_exception: unknown parameter [time_series_dimension] on mapper [namespace] of type [constant_keyword]\n\tRoot causes:\n\t\tmapper_parsing_exception: unknown parameter [time_series_dimension] on mapper [namespace] of type [constant_keyword]"}
With Kibana devtools
PUT _index_template/validate-constant-keyword-tsdb
{
"index_patterns": [
"test-const*"
],
"data_stream": {},
"template": {
"settings": {
"index.mode": "time_series",
"index.routing_path": [
"app_environment"
]
},
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
},
"app_environment": {
"type": "constant_keyword",
"value": "production",
"time_series_dimension": true
},
"memory_usage": {
"type": "float",
"time_series_metric": "gauge"
}
}
}
}
}
It fails with a similar error:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "composable template [validate-constant-keyword-tsdb] template after composition is invalid"
}
],
"type": "illegal_argument_exception",
"reason": "composable template [validate-constant-keyword-tsdb] template after composition is invalid",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "invalid composite mappings for [validate-constant-keyword-tsdb]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping: unknown parameter [time_series_dimension] on mapper [app_environment] of type [constant_keyword]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "unknown parameter [time_series_dimension] on mapper [app_environment] of type [constant_keyword]"
}
}
}
},
"status": 400
}
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "composable template [validate-constant-keyword-tsdb] template after composition is invalid"
}
],
"type": "illegal_argument_exception",
"reason": "composable template [validate-constant-keyword-tsdb] template after composition is invalid",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "invalid composite mappings for [validate-constant-keyword-tsdb]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping: unknown parameter [time_series_dimension] on mapper [app_environment] of type [constant_keyword]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "unknown parameter [time_series_dimension] on mapper [app_environment] of type [constant_keyword]"
}
}
}
},
"status": 400
}
The current spec/validation rules for TSDB fields allows setting a
constant_keywordfield as dimension. The package builds and the validation step succeeds. However, upon trying to install the package, it fails with:Similar to #1106, the list of supported types for dimension fields is validated in
package-spec/code/go/internal/validator/semantic/validate_dimensions.go
Line 36 in 3e48996
Which allows for
constant_keyword.Steps to reproduce:
With elastic-package
Observe the build works, the
With Kibana devtools
It fails with a similar error: