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

ECS Tooling - Mapping & Template Settings #2342

Open
daniel-rhoades opened this issue May 28, 2024 · 0 comments
Open

ECS Tooling - Mapping & Template Settings #2342

daniel-rhoades opened this issue May 28, 2024 · 0 comments

Comments

@daniel-rhoades
Copy link

daniel-rhoades commented May 28, 2024

Within USAGE.md (line 402 - Mapping & Template Settings), it describes how to specify a template file:

The --template-settings-legacy argument defines [index level settings (https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-modules-settings) that will be applied to the legacy index template in the generated artifacts. The --template-settings argument now defines those same settings, but for the composable template in the generated artifacts.

This is an example template.json to be passed with --template-setting-legacy:

{
  "index_patterns": ["mylog-*"],
  "order": 1,
  "settings": {
    "index": {
      "mapping": {
        "total_fields": {
          "limit": 10000
        }
      },
      "refresh_interval": "1s"
    }
  },
  "mappings": {}
}

[...]

For template.json, the mappings object is left empty: {}. Likewise the properties object remains empty in the mapping.json example. This will be filled in automatically by the script.

However, using the example (given for --template-setting-legacy) for --template causes the ECS Tooling to error:

...
 File "[...]/ecs/scripts/generators/es_template.py", line 263, in finalize_template
    template['template']['mappings'] = mappings_section
KeyError: 'template'

Wrapping settings within a template element resolves the issue, since this would then be compliant with the standard index template schema.

If this behaviour is expected, perhaps the documentation just updating.

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

No branches or pull requests

1 participant