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

[Ingest Pipelines] Add descriptions for ingest processors E-J #76113

Merged
merged 9 commits into from
Sep 8, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

import React, { FunctionComponent } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { EuiCode } from '@elastic/eui';

import { FIELD_TYPES, fieldValidators, UseField, Field } from '../../../../../../shared_imports';

Expand Down Expand Up @@ -87,17 +85,7 @@ export const Gsub: FunctionComponent = () => {

<UseField config={fieldsConfig.replacement} component={Field} path="fields.replacement" />

<TargetField
helpText={
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.gsubForm.targetFieldHelpText"
defaultMessage="Field used to contain updated text. Defaults to {field}."
values={{
field: <EuiCode>{'field'}</EuiCode>,
}}
/>
}
/>
<TargetField />

<IgnoreMissingField />
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

import React, { FunctionComponent } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { EuiCode } from '@elastic/eui';

import { FieldNameField } from './common_fields/field_name_field';
import { IgnoreMissingField } from './common_fields/ignore_missing_field';
Expand All @@ -23,15 +21,7 @@ export const HtmlStrip: FunctionComponent = () => {
)}
/>

<TargetField
helpText={
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.htmlStripForm.targetFieldHelpText"
defaultMessage="Field used to contain stripped text. Defaults to {field}."
values={{ field: <EuiCode>{'field'}</EuiCode> }}
/>
}
/>
<TargetField />

<IgnoreMissingField />
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

import React, { FunctionComponent } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { EuiCode } from '@elastic/eui';

import { FIELD_TYPES, fieldValidators, UseField, Field } from '../../../../../../shared_imports';

Expand Down Expand Up @@ -55,17 +53,7 @@ export const Join: FunctionComponent = () => {

<UseField config={fieldsConfig.separator} component={Field} path="fields.separator" />

<TargetField
helpText={
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.joinForm.targetFieldHelpText"
defaultMessage="Field used to contain the joined value. Defaults to {field}."
values={{
field: <EuiCode>{'field'}</EuiCode>,
}}
/>
}
/>
<TargetField />
</>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ export const Json: FunctionComponent = () => {
)}
/>

<TargetField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.jsonForm.targetFieldHelpText',
{ defaultMessage: 'Field used to contain the JSON object.' }
)}
/>
<TargetField />

<UseField
config={fieldsConfig.add_to_root}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import { i18n } from '@kbn/i18n';
import React, { ReactNode } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { EuiCode } from '@elastic/eui';
import { EuiCode, EuiLink } from '@elastic/eui';
jrodewig marked this conversation as resolved.
Show resolved Hide resolved
import { useKibana } from '../../../../../shared_imports';

import {
Append,
Expand Down Expand Up @@ -171,69 +172,135 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = {
label: i18n.translate('xpack.ingestPipelines.processors.label.enrich', {
defaultMessage: 'Enrich',
}),
description: function Description() {
const {
services: { documentation },
} = useKibana();
const esDocUrl = documentation.getEsDocsBasePath();
return (
<FormattedMessage
id="xpack.ingestPipelines.processors.description.enrich"
defaultMessage="Adds enrich data to incoming documents based on an {enrichPolicyLink}."
values={{
enrichPolicyLink: (
<EuiLink external target="_blank" href={esDocUrl + '/ingest-enriching-data.html'}>
{'enrich policy'}
</EuiLink>
),
}}
/>
);
},
},
fail: {
FieldsComponent: Fail,
docLinkPath: '/fail-processor.html',
label: i18n.translate('xpack.ingestPipelines.processors.label.fail', {
defaultMessage: 'Fail',
}),
description: i18n.translate('xpack.ingestPipelines.processors.description.fail', {
defaultMessage:
'Returns a custom error message on failure. Often used to notify requesters of required conditions.',
}),
},
foreach: {
FieldsComponent: Foreach,
docLinkPath: '/foreach-processor.html',
label: i18n.translate('xpack.ingestPipelines.processors.label.foreach', {
defaultMessage: 'Foreach',
}),
description: i18n.translate('xpack.ingestPipelines.processors.description.foreach', {
defaultMessage: 'Applies an ingest processor to each value in an array.',
}),
},
geoip: {
FieldsComponent: GeoIP,
docLinkPath: '/geoip-processor.html',
label: i18n.translate('xpack.ingestPipelines.processors.label.geoip', {
defaultMessage: 'GeoIP',
}),
description: i18n.translate('xpack.ingestPipelines.processors.description.geoip', {
defaultMessage:
'Adds geo data based on an IP address. Uses geo data from a Maxmind database file.',
}),
},
grok: {
FieldsComponent: Grok,
docLinkPath: '/grok-processor.html',
label: i18n.translate('xpack.ingestPipelines.processors.label.grok', {
defaultMessage: 'Grok',
}),
description: function Description() {
const {
services: { documentation },
} = useKibana();
const esDocUrl = documentation.getEsDocsBasePath();
return (
<FormattedMessage
id="xpack.ingestPipelines.processors.description.grok"
defaultMessage="Uses {grokLink} expressions to extract matches from a field."
values={{
grokLink: (
<EuiLink external target="_blank" href={esDocUrl + '/grok-processor.html'}>
{'grok'}
</EuiLink>
),
}}
/>
);
},
},
gsub: {
FieldsComponent: Gsub,
docLinkPath: '/gsub-processor.html',
label: i18n.translate('xpack.ingestPipelines.processors.label.gsub', {
defaultMessage: 'Gsub',
}),
description: i18n.translate('xpack.ingestPipelines.processors.description.gsub', {
defaultMessage: 'Uses a regular expression to replace field substrings.',
}),
},
html_strip: {
FieldsComponent: HtmlStrip,
docLinkPath: '/htmlstrip-processor.html',
label: i18n.translate('xpack.ingestPipelines.processors.label.htmlStrip', {
defaultMessage: 'HTML strip',
}),
description: i18n.translate('xpack.ingestPipelines.processors.description.htmlStrip', {
defaultMessage: 'Removes HTML tags from a field.',
}),
},
inference: {
FieldsComponent: Inference,
docLinkPath: '/inference-processor.html',
label: i18n.translate('xpack.ingestPipelines.processors.label.inference', {
defaultMessage: 'Inference',
}),
description: i18n.translate('xpack.ingestPipelines.processors.description.inference', {
defaultMessage:
'Uses a pre-trained data frame analytics model to infer against incoming data.',
}),
},
join: {
FieldsComponent: Join,
docLinkPath: '/join-processor.html',
label: i18n.translate('xpack.ingestPipelines.processors.label.join', {
defaultMessage: 'Join',
}),
description: i18n.translate('xpack.ingestPipelines.processors.description.join', {
defaultMessage:
'Joins array elements into a string. Inserts a separator between each element.',
}),
},
json: {
FieldsComponent: Json,
docLinkPath: '/json-processor.html',
label: i18n.translate('xpack.ingestPipelines.processors.label.json', {
defaultMessage: 'JSON',
}),
description: i18n.translate('xpack.ingestPipelines.processors.description.json', {
defaultMessage: 'Creates a JSON object from a compatible string.',
}),
},
kv: {
FieldsComponent: Kv,
Expand Down