[Ingest Pipelines] Processor forms for processors E-J#75054
[Ingest Pipelines] Processor forms for processors E-J#75054jloleysens merged 26 commits intoelastic:masterfrom
Conversation
…ce processor form
- Also factored out target_field field to common field (still have to update the all instances) - Built out special logic for handling add_to_root and target_field combo on JSON processor form - Created another serializer, for default boolean -> undefined.
|
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
alisonelizabeth
left a comment
There was a problem hiding this comment.
Great job @jloleysens!
I left a few nits and copy suggestions in the code. I think it'd be helpful for the docs team to take a look at the copy as well.
I came across one bug - somewhat accidentally 😄 - when switching from the foreach processor, to a different processor, and then back again.
Also, as a future enhancement, I think it would be great if we could fetch a user's existing enrich policies for the enrich processor, and maybe point them to the enrich policy API docs if they don't have any.
|
|
||
| export const Fail: FunctionComponent = () => { | ||
| return ( | ||
| <> |
There was a problem hiding this comment.
nit: is this fragment needed here?
| defaultMessage="Contains the inference type and its options. There are two types: {regression} and {classification}." | ||
| values={{ | ||
| regression: ( | ||
| <EuiLink |
There was a problem hiding this comment.
nit: there's an external prop that adds the external icon to the link
There was a problem hiding this comment.
nice! did not know about this one.
| 'xpack.ingestPipelines.pipelineEditor.enrichForm.overrideFieldHelpText', | ||
| { | ||
| defaultMessage: | ||
| 'Whether this processor will update fields with pre-existing non-null-valued field. When set to false, such fields will not be overridden.', |
There was a problem hiding this comment.
Should this be "Whether this processor will update fields with a pre-existing non-null-valued field..."?
| 'xpack.ingestPipelines.pipelineEditor.enrichForm.maxMatchesFieldHelpText', | ||
| { | ||
| defaultMessage: | ||
| 'The maximum number of matched documents to include under the configured target field. The target_field will be turned into a json array if max_matches is higher than 1, otherwise target_field will become a json object', |
There was a problem hiding this comment.
I think it would be helpful to include the maximum allowed value in the help text.
| 'xpack.ingestPipelines.pipelineEditor.enrichForm.fieldNameHelpText', | ||
| { | ||
| defaultMessage: | ||
| 'The field in the input document that matches the policies match_field used to retrieve the enrichment data', |
There was a problem hiding this comment.
| 'The field in the input document that matches the policies match_field used to retrieve the enrichment data', | |
| 'The field in the input document that matches the policies match_field used to retrieve the enrichment data.', |
| defaultMessage: 'Message', | ||
| }), | ||
| helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.failForm.messageHelpText', { | ||
| defaultMessage: 'The error message thrown by the processor', |
There was a problem hiding this comment.
| defaultMessage: 'The error message thrown by the processor', | |
| defaultMessage: 'The error message thrown by the processor.', |
| helpText={ | ||
| <FormattedMessage | ||
| id="xpack.ingestPipelines.pipelineEditor.inferenceForm.targetFieldHelpText" | ||
| defaultMessage="Field added to incoming documents to contain results objects. Default value is {targetField}." |
There was a problem hiding this comment.
Is "results objects" correct here? I'm not sure I follow.
There was a problem hiding this comment.
Yeah, some of these are a bit sketchy. I took most of these directly from the docs site, only lightly massaging to fit into context occasionally. These will definitely benefit from copy review.
| helpText: i18n.translate( | ||
| 'xpack.ingestPipelines.pipelineEditor.joinForm.separatorFieldHelpText', | ||
| { | ||
| defaultMessage: 'The separator character', |
There was a problem hiding this comment.
| defaultMessage: 'The separator character', | |
| defaultMessage: 'The separator character.', |
| 'xpack.ingestPipelines.pipelineEditor.htmlStripForm.targetFieldHelpText', | ||
| { | ||
| defaultMessage: | ||
| 'The field to assign the stripped value to. If blank the field will be updated in-place.', |
There was a problem hiding this comment.
| 'The field to assign the stripped value to. If blank the field will be updated in-place.', | |
| 'The field to assign the stripped value to. If blank, the field will be updated in-place.', |
|
@elasticmachine merge upstream |
|
Thanks for the review @alisonelizabeth ! I addressed your feedback. Do you think you could take another look? I was not able to reproduce the foreach editor bug, but I think it may have been fixed in this PR #75160. Would you mind testing again now that I merged master? If the issue resurfaces I will take another look! |
There was a problem hiding this comment.
Phew! Thanks for putting this together @jloleysens.
Most of these look okay, but there are a few instances where the processor contains the wrong fields.
Not sure if it's related, but I had issues building this locally. nvm. I just needed to clean my build.
I'd love to take another look once the missing/wrong fields are fixed. Thanks!
| defaultMessage: 'Policy name', | ||
| }), | ||
| helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.enrichForm.policyNameHelpText', { | ||
| defaultMessage: 'The name of the enrich policy to use.', |
There was a problem hiding this comment.
| defaultMessage: 'The name of the enrich policy to use.', | |
| defaultMessage: 'Name of the enrich policy', |
Can we add a link to https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest-enriching-data.html here?
Unlike most of our other processors, enrich processors aren't really self-contained and require some setup before they can be used. I wouldn't assume a user is familiar with enrich policies and I don't think we can concisely explain it here.
There was a problem hiding this comment.
Great point, will do!
| 'xpack.ingestPipelines.pipelineEditor.enrichForm.shapeRelationFieldHelpText', | ||
| { | ||
| defaultMessage: | ||
| 'A spatial relation operator used to match the geo_shape of incoming documents to documents in the enrich index. This option is only used for geo_match enrich policy types.', |
There was a problem hiding this comment.
| 'A spatial relation operator used to match the geo_shape of incoming documents to documents in the enrich index. This option is only used for geo_match enrich policy types.', | |
| 'Operator used to match the geo-shape of incoming documents to enrich documents. Only used for geo-match enrich policies.', |
If possible, I'd love to link to https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-policy-definition.html
geo-match policies are another complex topics users will likely need docs-context for.
| 'xpack.ingestPipelines.pipelineEditor.enrichForm.maxMatchesFieldHelpText', | ||
| { | ||
| defaultMessage: | ||
| 'The maximum number of matched documents to include under the configured target field. The target_field will be turned into a json array if max_matches is higher than 1, otherwise target_field will become a json object. Accepts numbers are 1 up to 128.', |
There was a problem hiding this comment.
| 'The maximum number of matched documents to include under the configured target field. The target_field will be turned into a json array if max_matches is higher than 1, otherwise target_field will become a json object. Accepts numbers are 1 up to 128.', | |
| 'Number of matching enrich documents to include in the target field. Accepts 1–128.', |
| 'xpack.ingestPipelines.pipelineEditor.enrichForm.overrideFieldHelpText', | ||
| { | ||
| defaultMessage: | ||
| 'Whether this processor will update fields with a pre-existing non-null-valued field. When set to false, such fields will not be overridden.', |
There was a problem hiding this comment.
| 'Whether this processor will update fields with a pre-existing non-null-valued field. When set to false, such fields will not be overridden.', | |
| 'If true, the processor can overwrite pre-existing field values.', |
| 'xpack.ingestPipelines.pipelineEditor.enrichForm.fieldNameHelpText', | ||
| { | ||
| defaultMessage: | ||
| 'The field in the input document that matches the policy field used to retrieve the enrichment data.', |
There was a problem hiding this comment.
| 'The field in the input document that matches the policy field used to retrieve the enrichment data.', | |
| 'Field used to match incoming documents to enrich documents. Field values are compared to the match field set in the enrich policy. |
| helpText: i18n.translate( | ||
| 'xpack.ingestPipelines.pipelineEditor.joinForm.separatorFieldHelpText', | ||
| { | ||
| defaultMessage: 'The separator character.', |
There was a problem hiding this comment.
| defaultMessage: 'The separator character.', | |
| defaultMessage: 'Separator character', |
| <FieldNameField | ||
| helpText={i18n.translate( | ||
| 'xpack.ingestPipelines.pipelineEditor.joinForm.fieldNameHelpText', | ||
| { defaultMessage: 'The field to be separated.' } |
There was a problem hiding this comment.
| { defaultMessage: 'The field to be separated.' } | |
| { defaultMessage: 'Field containing array values to join' } |
| 'xpack.ingestPipelines.pipelineEditor.joinForm.targetFieldHelpText', | ||
| { | ||
| defaultMessage: | ||
| 'The field to assign the joined value to. If empty, the field is updated in-place.', |
There was a problem hiding this comment.
| 'The field to assign the joined value to. If empty, the field is updated in-place.', | |
| 'Field used to contain the joined value. Defaults to {{original field}}.', |
| 'xpack.ingestPipelines.pipelineEditor.jsonForm.addToRootFieldHelpText', | ||
| { | ||
| defaultMessage: | ||
| 'Inject the serialized JSON to the top level of the JSON document. A target field cannot be combined with this option.', |
There was a problem hiding this comment.
| 'Inject the serialized JSON to the top level of the JSON document. A target field cannot be combined with this option.', | |
| 'If true, add the JSON object to the top level of the document. Cannot be combined with a target field.', |
| <FieldNameField | ||
| helpText={i18n.translate( | ||
| 'xpack.ingestPipelines.pipelineEditor.joinForm.fieldNameHelpText', | ||
| { defaultMessage: 'The field to be separated.' } | ||
| )} | ||
| /> | ||
|
|
||
| <TargetField /> |
There was a problem hiding this comment.
This looks like a copy/paste error.
| <> | ||
| <FieldNameField | ||
| helpText={i18n.translate( | ||
| 'xpack.ingestPipelines.pipelineEditor.grokForm.fieldNameHelpText', |
| enrich: { | ||
| FieldsComponent: undefined, // TODO: Implement | ||
| FieldsComponent: Enrich, | ||
| docLinkPath: '/enrich-processor.html', |
There was a problem hiding this comment.
Forgot to add this in my original review:
Unlike the other processors, the enrich processor is a bit complicated. I'd link to these docs rather than the processor docs:
| docLinkPath: '/enrich-processor.html', | |
| docLinkPath: '/ingest-enriching-data.html', |
|
@elasticmachine merge upstream |
|
@jrodewig Thanks for the review!! I've addressed your feedback, would you mind taking another look? |
|
@elasticmachine merge upstream |
jrodewig
left a comment
There was a problem hiding this comment.
I left a few bits of additional feedback for your review. Some of them are fixes to my earlier suggestions. 😬
Other notes:
-
The Grok and JSON processors have the wrong help text in them. Looks like a minor copy/paste error.
-
Where possible, I removed periods based on the EUI guidelines. My general heuristic is to not punctuate the text unless it A) is a full sentence or 2) contains two or more phrases. Let me know if that's not the norm for these.
I also think we need some help text for the commonly used Ignore missing field. I suggest:
Ignore documents with a missing field`.
Otherwise, this looks great! Thanks for putting this together!
| 'xpack.ingestPipelines.pipelineEditor.geoIPForm.firstOnlyFieldHelpText', | ||
| { | ||
| defaultMessage: | ||
| 'If true, the first matching geo data is used, even if the field contains an array.', |
There was a problem hiding this comment.
Another fix to one of my earlier suggestions.
| 'If true, the first matching geo data is used, even if the field contains an array.', | |
| 'Use the first matching geo data, even if the field contains an array.', |
| helpText: i18n.translate( | ||
| 'xpack.ingestPipelines.pipelineEditor.enrichForm.overrideFieldHelpText', | ||
| { | ||
| defaultMessage: 'If true, the processor can overwrite pre-existing field values.', |
There was a problem hiding this comment.
This was my original suggestion, but true doesn't feel right here.
| defaultMessage: 'If true, the processor can overwrite pre-existing field values.', | |
| defaultMessage: 'If enabled, the processor can overwrite pre-existing field values.', |
| helpText: i18n.translate( | ||
| 'xpack.ingestPipelines.pipelineEditor.grokForm.traceMatchFieldHelpText', | ||
| { | ||
| defaultMessage: 'If true, include metadata about the matching expression in the document.', |
There was a problem hiding this comment.
A fix to one of my earlier suggestions.
| defaultMessage: 'If true, include metadata about the matching expression in the document.', | |
| defaultMessage: 'Add metadata about the matching expression to the document', |
| defaultMessage: 'Message', | ||
| }), | ||
| helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.failForm.messageHelpText', { | ||
| defaultMessage: 'Error message returned by the processor.', |
There was a problem hiding this comment.
Period isn't needed.
| defaultMessage: 'Error message returned by the processor.', | |
| defaultMessage: 'Error message returned by the processor', |
| defaultMessage: 'Processor', | ||
| }), | ||
| helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.foreachForm.processorHelpText', { | ||
| defaultMessage: 'Ingest processor to run on each array value.', |
There was a problem hiding this comment.
Period isn't needed.
| defaultMessage: 'Ingest processor to run on each array value.', | |
| defaultMessage: 'Ingest processor to run on each array value', |
| <FieldNameField | ||
| helpText={i18n.translate( | ||
| 'xpack.ingestPipelines.pipelineEditor.jsonForm.fieldNameHelpText', | ||
| { defaultMessage: 'Field to be parsed.' } |
There was a problem hiding this comment.
| { defaultMessage: 'Field to be parsed.' } | |
| { defaultMessage: 'Field to be parsed' } |
| 'xpack.ingestPipelines.pipelineEditor.jsonForm.addToRootFieldHelpText', | ||
| { | ||
| defaultMessage: | ||
| 'If true, add the JSON object to the top level of the document. Cannot be combined with a target field.', |
There was a problem hiding this comment.
| 'If true, add the JSON object to the top level of the document. Cannot be combined with a target field.', | |
| 'Add the JSON object to the top level of the document. Cannot be combined with a target field.', |
| )} | ||
| /> | ||
|
|
||
| <TargetField /> |
| helpText={i18n.translate( | ||
| 'xpack.ingestPipelines.pipelineEditor.enrichForm.targetFieldHelpText', | ||
| { | ||
| defaultMessage: 'Field used to contain enrich data.', |
There was a problem hiding this comment.
Period isn't needed.
| defaultMessage: 'Field used to contain enrich data.', | |
| defaultMessage: 'Field used to contain enrich data', |
| helpText: ( | ||
| <FormattedMessage | ||
| id="xpack.ingestPipelines.pipelineEditor.enrichForm.policyNameHelpText" | ||
| defaultMessage="Name of the {enrichPolicyLink}." |
There was a problem hiding this comment.
Period isn't needed.
| defaultMessage="Name of the {enrichPolicyLink}." | |
| defaultMessage="Name of the {enrichPolicyLink}" |
|
@jrodewig Thanks for the review! I assumed the period was needed, but happy to follow your/EUIs recommendation as that is what I thought I was doing 😅 - thanks for explaining, TIL! I'll implement your copy recommendations and merge. |
💚 Build SucceededBuild metrics@kbn/optimizer bundle module count
async chunks size
History
To update your PR or re-run it, just comment with: |
* Added the enrich processor form (big one) * added fail processor form * Added foreach processor form * Added geoip processor form and refactored some deserialization * added grok processor form and updated comments and some i18n ids * updated existing gsub processor form to be in line with other forms * added html_strip processor form * refactored some serialize and deserialize functions and added inference processor form * fix copy-pasta mistake in inference form and add join processor form * Added JSON processor field - Also factored out target_field field to common field (still have to update the all instances) - Built out special logic for handling add_to_root and target_field combo on JSON processor form - Created another serializer, for default boolean -> undefined. * remove unused variable * Refactor to use new shared target_field component, and fix JSON serializer bug * fix i18n * address pr feedback * Fix enrich max fields help text copy * add link to enrich policy docs in help text * fix error validation message in enrich policy form and replace space with horizontal rule * address copy feedback * fix i18n id typo * fix i18n * address additional round of feedback and fix json form help text Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Added the enrich processor form (big one) * added fail processor form * Added foreach processor form * Added geoip processor form and refactored some deserialization * added grok processor form and updated comments and some i18n ids * updated existing gsub processor form to be in line with other forms * added html_strip processor form * refactored some serialize and deserialize functions and added inference processor form * fix copy-pasta mistake in inference form and add join processor form * Added JSON processor field - Also factored out target_field field to common field (still have to update the all instances) - Built out special logic for handling add_to_root and target_field combo on JSON processor form - Created another serializer, for default boolean -> undefined. * remove unused variable * Refactor to use new shared target_field component, and fix JSON serializer bug * fix i18n * address pr feedback * Fix enrich max fields help text copy * add link to enrich policy docs in help text * fix error validation message in enrich policy form and replace space with horizontal rule * address copy feedback * fix i18n id typo * fix i18n * address additional round of feedback and fix json form help text Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Hey @jloleysens --- Just a follow-up: you were right! @gchaps graciously reached out and corrected me here. We do end any field help text with periods. FWIW I think's that a good move for simplicity and consistency. I'll open up a follow-up PR (#75695) to re-add periods here. I'll also update the EUI guidelines so that rules are clear. I just wanted to let you know for future PRs. Thanks for your patience as I learn the EUI ropes! |
* Added the enrich processor form (big one) * added fail processor form * Added foreach processor form * Added geoip processor form and refactored some deserialization * added grok processor form and updated comments and some i18n ids * updated existing gsub processor form to be in line with other forms * added html_strip processor form * refactored some serialize and deserialize functions and added inference processor form * fix copy-pasta mistake in inference form and add join processor form * Added JSON processor field - Also factored out target_field field to common field (still have to update the all instances) - Built out special logic for handling add_to_root and target_field combo on JSON processor form - Created another serializer, for default boolean -> undefined. * remove unused variable * Refactor to use new shared target_field component, and fix JSON serializer bug * fix i18n * address pr feedback * Fix enrich max fields help text copy * add link to enrich policy docs in help text * fix error validation message in enrich policy form and replace space with horizontal rule * address copy feedback * fix i18n id typo * fix i18n * address additional round of feedback and fix json form help text Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
|
@jrodewig No problem and thanks for getting back with this info! |

Summary
This contribution adds forms for the following processors:
How to test
Additional Context
Continuation of #72849
Checklist
Delete any items that are not applicable to this PR.