Skip to content

Commit

Permalink
Add normalizer multi-field capability
Browse files Browse the repository at this point in the history
  • Loading branch information
madirey committed Sep 21, 2020
1 parent a4655d4 commit b8ad5ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/generators/beats.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def fieldset_field_array(source_fields, df_whitelist, fieldset_prefix):
'ignore_above', 'multi_fields', 'format', 'input_format',
'output_format', 'output_precision', 'description',
'example', 'enabled', 'index']
multi_fields_allowed_keys = ['name', 'type', 'norms', 'default_field']
multi_fields_allowed_keys = ['name', 'type', 'norms', 'default_field', 'normalizer']

fields = []
for nested_field_name in source_fields:
Expand Down
3 changes: 3 additions & 0 deletions scripts/generators/es_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ def entry_for(field):
field_entry['fields'] = {}
for mf in field['multi_fields']:
mf_entry = {'type': mf['type']}
mf_normalizer = mf.get('normalizer')
if mf_normalizer:
mf_entry['normalizer'] = mf_normalizer
if mf['type'] == 'text':
ecs_helpers.dict_copy_existing_keys(mf, mf_entry, ['norms'])
field_entry['fields'][mf['name']] = mf_entry
Expand Down

0 comments on commit b8ad5ec

Please sign in to comment.