-
Notifications
You must be signed in to change notification settings - Fork 449
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description of the problem including expected versus actual behavior:
Trying script/generator.py for the first time, I stumble upon a stack trace throwing KeyError: 'error'. I initially though I maybe passed wrong parameters but it looks like example documented in USAGE.md also have the same issue.
Thanks for writing this tool, I'm eager to use it since it can greatly help me to generate/maintain configuration for custom Beats indices. Let me know if I can somehow help you further.
Steps to reproduce:
git clone https://github.com/elastic/ecs && cd ecs- Running
generator.pyas documented inUSAGE.md:
$ python3 scripts/generator.py --ref v1.6.0 \
--subset usage-example/fields/subset.yml \
--include usage-example/fields/custom/ \
--out usage-example/ \
--template-settings usage-example/fields/template-settings.json \
--mapping-settings usage-example/fields/mapping-settings.jsonProvide logs (if relevant):
Loading schemas from git ref v1.6.0
Running generator. ECS version 1.6.0
Loading user defined schemas: ['usage-example/fields/custom/']
/Users/florent/Sources/ecs/scripts/schema/cleaner.py:185: UserWarning: Example value for field `header_flags` contains an object or array which must be quoted to avoid YAML interpretation.
This will cause an exception when running in strict mode.
Warning check:
check_example_value(field, strict=strict_mode)
/Users/florent/Sources/ecs/scripts/schema/cleaner.py:185: UserWarning: Example value for field `resolved_ip` contains an object or array which must be quoted to avoid YAML interpretation.
[...]
Traceback (most recent call last):
File "/Users/florent/Sources/ecs/scripts/generator.py", line 106, in <module>
main()
File "/Users/florent/Sources/ecs/scripts/generator.py", line 60, in main
es_template.generate_legacy(flat, ecs_version, out_dir, args.template_settings, args.mapping_settings)
File "/Users/florent/Sources/ecs/scripts/generators/es_template.py", line 109, in generate_legacy
generate_legacy_template_version(6, ecs_version, mappings_section, out_dir, template_settings_file)
File "/Users/florent/Sources/ecs/scripts/generators/es_template.py", line 115, in generate_legacy_template_version
template = template_settings(es_version, ecs_version, mappings_section, template_settings_file)
File "/Users/florent/Sources/ecs/scripts/generators/es_template.py", line 202, in template_settings
error_stack_trace_mappings = mappings_section['properties']['error']['properties']['stack_trace']
KeyError: 'error'
Any additional context:
$ git rev-parse HEAD
83ced31c9da6b3e5599b01e319a827a7941e6439
$ python3 --version
Python 3.9.0
$ pip3 list | grep -i -E '(yaml|pep|mock|git|jinja)'
autopep8 1.4.4
gitdb 4.0.5
GitPython 3.1.2
Jinja2 2.11.2
mock 4.0.2
PyYAML 5.3b1
yamllint 1.19.0
lwillelwille and ebeahan
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working