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

Add normalizer multi-field capability #971

Merged
merged 6 commits into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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']
madirey marked this conversation as resolved.
Show resolved Hide resolved

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
webmat marked this conversation as resolved.
Show resolved Hide resolved
if mf['type'] == 'text':
ecs_helpers.dict_copy_existing_keys(mf, mf_entry, ['norms'])
field_entry['fields'][mf['name']] = mf_entry
Expand Down