We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
`doc_values` parameter not set in Beats artifact 
Certain fields have `index: false` and `doc_values: false` in their ECS definition, like `event.original`:

https://github.com/elastic/ecs/blob/master/schemas/event.yml#L577-L599

When `doc_values: false` is defined in the field definition, it's not being added to the maintained Beats fields YAML artifact:

https://github.com/elastic/ecs/blob/master/generated/beats/fields.ecs.yml#L1737-L1750

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `scripts/generators/beats.py`
Content:
```
1 from os.path import join
2 from collections import OrderedDict
3 from generators import ecs_helpers
4 
5 
6 def generate(ecs_nested, ecs_version, out_dir):
7     # Load temporary allowlist for default_fields workaround.
8     df_allowlist = ecs_helpers.yaml_load('scripts/generators/beats_default_fields_allowlist.yml')
9 
10     # base first
11     beats_fields = fieldset_field_array(ecs_nested['base']['fields'], df_allowlist, ecs_nested['base']['prefix'])
12 
13     allowed_fieldset_keys = ['name', 'title', 'group', 'description', 'footnote', 'type']
14     # other fieldsets
15     for fieldset_name in sorted(ecs_nested):
16         if 'base' == fieldset_name:
17             continue
18         fieldset = ecs_nested[fieldset_name]
19 
20         # Handle when `root:true`
21         if fieldset.get('root', False):
22             beats_fields.extend(fieldset_field_array(fieldset['fields'], df_allowlist, fieldset['prefix']))
23             continue
24 
25         beats_field = ecs_helpers.dict_copy_keys_ordered(fieldset, allowed_fieldset_keys)
26         beats_field['fields'] = fieldset_field_array(fieldset['fields'], df_allowlist, fieldset['prefix'])
27         beats_fields.append(beats_field)
28 
29     beats_file = OrderedDict()
30     beats_file['key'] = 'ecs'
31     beats_file['title'] = 'ECS'
32     beats_file['description'] = 'ECS Fields.'
33     beats_file['fields'] = beats_fields
34 
35     write_beats_yaml(beats_file, ecs_version, out_dir)
36 
37 
38 def fieldset_field_array(source_fields, df_allowlist, fieldset_prefix):
39     allowed_keys = ['name', 'level', 'required', 'type', 'object_type',
40                     'ignore_above', 'multi_fields', 'format', 'input_format',
41                     'output_format', 'output_precision', 'description',
42                     'example', 'enabled', 'index', 'path', 'scaling_factor']
43     multi_fields_allowed_keys = ['name', 'type', 'norms', 'default_field', 'normalizer', 'ignore_above']
44 
45     fields = []
46     for nested_field_name in source_fields:
47         ecs_field = source_fields[nested_field_name]
48         beats_field = ecs_helpers.dict_copy_keys_ordered(ecs_field, allowed_keys)
49         if '' == fieldset_prefix:
50             contextual_name = nested_field_name
51         else:
52             contextual_name = '.'.join(nested_field_name.split('.')[1:])
53 
54         cleaned_multi_fields = []
55         if 'multi_fields' in ecs_field:
56             for mf in ecs_field['multi_fields']:
57                 # Set default_field if necessary. Avoid adding the key if the parent
58                 # field already is marked with default_field: false.
59                 if not mf['flat_name'] in df_allowlist and ecs_field['flat_name'] in df_allowlist:
60                     mf['default_field'] = False
61                 cleaned_multi_fields.append(
62                     ecs_helpers.dict_copy_keys_ordered(mf, multi_fields_allowed_keys))
63             beats_field['multi_fields'] = cleaned_multi_fields
64 
65         beats_field['name'] = contextual_name
66 
67         if not ecs_field['flat_name'] in df_allowlist:
68             beats_field['default_field'] = False
69 
70         fields.append(beats_field)
71     return sorted(fields, key=lambda x: x['name'])
72 
73 # Helpers
74 
75 
76 def write_beats_yaml(beats_file, ecs_version, out_dir):
77     ecs_helpers.make_dirs(join(out_dir, 'beats'))
78     warning = file_header().format(version=ecs_version)
79     ecs_helpers.yaml_dump(join(out_dir, 'beats/fields.ecs.yml'), [beats_file], preamble=warning)
80 
81 
82 # Templates
83 
84 
85 def file_header():
86     return """
87 # WARNING! Do not edit this file directly, it was generated by the ECS project,
88 # based on ECS version {version}.
89 # Please visit https://github.com/elastic/ecs to suggest changes to ECS fields.
90 
91 """.lstrip()
92
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/scripts/generators/beats.py b/scripts/generators/beats.py
--- a/scripts/generators/beats.py
+++ b/scripts/generators/beats.py
@@ -39,7 +39,8 @@
     allowed_keys = ['name', 'level', 'required', 'type', 'object_type',
                     'ignore_above', 'multi_fields', 'format', 'input_format',
                     'output_format', 'output_precision', 'description',
-                    'example', 'enabled', 'index', 'path', 'scaling_factor']
+                    'example', 'enabled', 'index', 'doc_values', 'path',
+                    'scaling_factor']
     multi_fields_allowed_keys = ['name', 'type', 'norms', 'default_field', 'normalizer', 'ignore_above']
 
     fields = []

{"golden_diff": "diff --git a/scripts/generators/beats.py b/scripts/generators/beats.py\n--- a/scripts/generators/beats.py\n+++ b/scripts/generators/beats.py\n@@ -39,7 +39,8 @@\n     allowed_keys = ['name', 'level', 'required', 'type', 'object_type',\n                     'ignore_above', 'multi_fields', 'format', 'input_format',\n                     'output_format', 'output_precision', 'description',\n-                    'example', 'enabled', 'index', 'path', 'scaling_factor']\n+                    'example', 'enabled', 'index', 'doc_values', 'path',\n+                    'scaling_factor']\n     multi_fields_allowed_keys = ['name', 'type', 'norms', 'default_field', 'normalizer', 'ignore_above']\n \n     fields = []\n", "issue": "`doc_values` parameter not set in Beats artifact \nCertain fields have `index: false` and `doc_values: false` in their ECS definition, like `event.original`:\r\n\r\nhttps://github.com/elastic/ecs/blob/master/schemas/event.yml#L577-L599\r\n\r\nWhen `doc_values: false` is defined in the field definition, it's not being added to the maintained Beats fields YAML artifact:\r\n\r\nhttps://github.com/elastic/ecs/blob/master/generated/beats/fields.ecs.yml#L1737-L1750\n", "before_files": [{"content": "from os.path import join\nfrom collections import OrderedDict\nfrom generators import ecs_helpers\n\n\ndef generate(ecs_nested, ecs_version, out_dir):\n    # Load temporary allowlist for default_fields workaround.\n    df_allowlist = ecs_helpers.yaml_load('scripts/generators/beats_default_fields_allowlist.yml')\n\n    # base first\n    beats_fields = fieldset_field_array(ecs_nested['base']['fields'], df_allowlist, ecs_nested['base']['prefix'])\n\n    allowed_fieldset_keys = ['name', 'title', 'group', 'description', 'footnote', 'type']\n    # other fieldsets\n    for fieldset_name in sorted(ecs_nested):\n        if 'base' == fieldset_name:\n            continue\n        fieldset = ecs_nested[fieldset_name]\n\n        # Handle when `root:true`\n        if fieldset.get('root', False):\n            beats_fields.extend(fieldset_field_array(fieldset['fields'], df_allowlist, fieldset['prefix']))\n            continue\n\n        beats_field = ecs_helpers.dict_copy_keys_ordered(fieldset, allowed_fieldset_keys)\n        beats_field['fields'] = fieldset_field_array(fieldset['fields'], df_allowlist, fieldset['prefix'])\n        beats_fields.append(beats_field)\n\n    beats_file = OrderedDict()\n    beats_file['key'] = 'ecs'\n    beats_file['title'] = 'ECS'\n    beats_file['description'] = 'ECS Fields.'\n    beats_file['fields'] = beats_fields\n\n    write_beats_yaml(beats_file, ecs_version, out_dir)\n\n\ndef fieldset_field_array(source_fields, df_allowlist, fieldset_prefix):\n    allowed_keys = ['name', 'level', 'required', 'type', 'object_type',\n                    'ignore_above', 'multi_fields', 'format', 'input_format',\n                    'output_format', 'output_precision', 'description',\n                    'example', 'enabled', 'index', 'path', 'scaling_factor']\n    multi_fields_allowed_keys = ['name', 'type', 'norms', 'default_field', 'normalizer', 'ignore_above']\n\n    fields = []\n    for nested_field_name in source_fields:\n        ecs_field = source_fields[nested_field_name]\n        beats_field = ecs_helpers.dict_copy_keys_ordered(ecs_field, allowed_keys)\n        if '' == fieldset_prefix:\n            contextual_name = nested_field_name\n        else:\n            contextual_name = '.'.join(nested_field_name.split('.')[1:])\n\n        cleaned_multi_fields = []\n        if 'multi_fields' in ecs_field:\n            for mf in ecs_field['multi_fields']:\n                # Set default_field if necessary. Avoid adding the key if the parent\n                # field already is marked with default_field: false.\n                if not mf['flat_name'] in df_allowlist and ecs_field['flat_name'] in df_allowlist:\n                    mf['default_field'] = False\n                cleaned_multi_fields.append(\n                    ecs_helpers.dict_copy_keys_ordered(mf, multi_fields_allowed_keys))\n            beats_field['multi_fields'] = cleaned_multi_fields\n\n        beats_field['name'] = contextual_name\n\n        if not ecs_field['flat_name'] in df_allowlist:\n            beats_field['default_field'] = False\n\n        fields.append(beats_field)\n    return sorted(fields, key=lambda x: x['name'])\n\n# Helpers\n\n\ndef write_beats_yaml(beats_file, ecs_version, out_dir):\n    ecs_helpers.make_dirs(join(out_dir, 'beats'))\n    warning = file_header().format(version=ecs_version)\n    ecs_helpers.yaml_dump(join(out_dir, 'beats/fields.ecs.yml'), [beats_file], preamble=warning)\n\n\n# Templates\n\n\ndef file_header():\n    return \"\"\"\n# WARNING! Do not edit this file directly, it was generated by the ECS project,\n# based on ECS version {version}.\n# Please visit https://github.com/elastic/ecs to suggest changes to ECS fields.\n\n\"\"\".lstrip()\n", "path": "scripts/generators/beats.py"}], "after_files": [{"content": "from os.path import join\nfrom collections import OrderedDict\nfrom generators import ecs_helpers\n\n\ndef generate(ecs_nested, ecs_version, out_dir):\n    # Load temporary allowlist for default_fields workaround.\n    df_allowlist = ecs_helpers.yaml_load('scripts/generators/beats_default_fields_allowlist.yml')\n\n    # base first\n    beats_fields = fieldset_field_array(ecs_nested['base']['fields'], df_allowlist, ecs_nested['base']['prefix'])\n\n    allowed_fieldset_keys = ['name', 'title', 'group', 'description', 'footnote', 'type']\n    # other fieldsets\n    for fieldset_name in sorted(ecs_nested):\n        if 'base' == fieldset_name:\n            continue\n        fieldset = ecs_nested[fieldset_name]\n\n        # Handle when `root:true`\n        if fieldset.get('root', False):\n            beats_fields.extend(fieldset_field_array(fieldset['fields'], df_allowlist, fieldset['prefix']))\n            continue\n\n        beats_field = ecs_helpers.dict_copy_keys_ordered(fieldset, allowed_fieldset_keys)\n        beats_field['fields'] = fieldset_field_array(fieldset['fields'], df_allowlist, fieldset['prefix'])\n        beats_fields.append(beats_field)\n\n    beats_file = OrderedDict()\n    beats_file['key'] = 'ecs'\n    beats_file['title'] = 'ECS'\n    beats_file['description'] = 'ECS Fields.'\n    beats_file['fields'] = beats_fields\n\n    write_beats_yaml(beats_file, ecs_version, out_dir)\n\n\ndef fieldset_field_array(source_fields, df_allowlist, fieldset_prefix):\n    allowed_keys = ['name', 'level', 'required', 'type', 'object_type',\n                    'ignore_above', 'multi_fields', 'format', 'input_format',\n                    'output_format', 'output_precision', 'description',\n                    'example', 'enabled', 'index', 'doc_values', 'path',\n                    'scaling_factor']\n    multi_fields_allowed_keys = ['name', 'type', 'norms', 'default_field', 'normalizer', 'ignore_above']\n\n    fields = []\n    for nested_field_name in source_fields:\n        ecs_field = source_fields[nested_field_name]\n        beats_field = ecs_helpers.dict_copy_keys_ordered(ecs_field, allowed_keys)\n        if '' == fieldset_prefix:\n            contextual_name = nested_field_name\n        else:\n            contextual_name = '.'.join(nested_field_name.split('.')[1:])\n\n        cleaned_multi_fields = []\n        if 'multi_fields' in ecs_field:\n            for mf in ecs_field['multi_fields']:\n                # Set default_field if necessary. Avoid adding the key if the parent\n                # field already is marked with default_field: false.\n                if not mf['flat_name'] in df_allowlist and ecs_field['flat_name'] in df_allowlist:\n                    mf['default_field'] = False\n                cleaned_multi_fields.append(\n                    ecs_helpers.dict_copy_keys_ordered(mf, multi_fields_allowed_keys))\n            beats_field['multi_fields'] = cleaned_multi_fields\n\n        beats_field['name'] = contextual_name\n\n        if not ecs_field['flat_name'] in df_allowlist:\n            beats_field['default_field'] = False\n\n        fields.append(beats_field)\n    return sorted(fields, key=lambda x: x['name'])\n\n# Helpers\n\n\ndef write_beats_yaml(beats_file, ecs_version, out_dir):\n    ecs_helpers.make_dirs(join(out_dir, 'beats'))\n    warning = file_header().format(version=ecs_version)\n    ecs_helpers.yaml_dump(join(out_dir, 'beats/fields.ecs.yml'), [beats_file], preamble=warning)\n\n\n# Templates\n\n\ndef file_header():\n    return \"\"\"\n# WARNING! Do not edit this file directly, it was generated by the ECS project,\n# based on ECS version {version}.\n# Please visit https://github.com/elastic/ecs to suggest changes to ECS fields.\n\n\"\"\".lstrip()\n", "path": "scripts/generators/beats.py"}]}