generated from amazon-archives/__template_Apache-2.0
-
Couldn't load subscription status.
- Fork 621
[DOC] Add pipeline processor documentation #5986
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
062869f
Add pipeline processor documentation
vagimeli 3a59588
Add pipeline examples and text
vagimeli 7e4c0ec
Merge remote-tracking branch 'origin/main' into pipeline-processor
vagimeli f96d237
Merge branch 'main' into pipeline-processor
vagimeli b429ef9
add text and examples
vagimeli c2ec520
Update pipeline.md
vagimeli 0fe9f26
Update pipeline.md
vagimeli 5391e62
Update _ingest-pipelines/processors/pipeline.md
vagimeli 7612a73
Update _ingest-pipelines/processors/pipeline.md
vagimeli 0febf31
Update _ingest-pipelines/processors/pipeline.md
vagimeli 3a10857
Update _ingest-pipelines/processors/pipeline.md
vagimeli 2eda920
Update _ingest-pipelines/processors/pipeline.md
vagimeli b083331
Merge branch 'main' into pipeline-processor
vagimeli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,183 @@ | ||
| --- | ||
| layout: default | ||
| title: Pipeline | ||
| parent: Ingest processors | ||
| nav_order: 200 | ||
| --- | ||
|
|
||
| # Pipeline processor | ||
|
|
||
| The `pipeline` processor allows a pipeline to reference and include another predefined pipeline. This can be useful when you have a set of common processors that need to be shared across multiple pipelines. Instead of redefining those common processors in each pipeline, you can create a separate base pipeline containing the shared processors and then reference that base pipeline from other pipelines using the pipeline processor. | ||
|
|
||
| The following is the syntax for the `pipeline` processor: | ||
|
|
||
| ```json | ||
| { | ||
| "pipeline": { | ||
| "name": "general-pipeline" | ||
| } | ||
| } | ||
| ``` | ||
| {% include copy-curl.html %} | ||
|
|
||
| ## Configuration parameters | ||
|
|
||
| The following table lists the required and optional parameters for the `pipeline` processor. | ||
|
|
||
| Parameter | Required/Optional | Description | | ||
| |-----------|-----------|-----------| | ||
| `name` | Required | The name of the pipeline to execute. | ||
| `description` | Optional | A description of the processor's purpose or configuration. | ||
| `if` | Optional | Specifies to conditionally execute the processor. | ||
| `ignore_failure` | Optional | Specifies to ignore processor failures. See [Handling pipeline failures]({{site.url}}{{site.baseurl}}/ingest-pipelines/pipeline-failures/). | ||
| `on_failure` | Optional | Specifies to handle processor failures. See [Handling pipeline failures]({{site.url}}{{site.baseurl}}/ingest-pipelines/pipeline-failures/). | ||
| `tag` | Optional | An identifier for the processor. Useful for debugging and metrics. | ||
|
|
||
| ## Using the processor | ||
|
|
||
| Follow these steps to use the processor in a pipeline. | ||
|
|
||
| ### Step 1: Create a pipeline | ||
|
|
||
| The following query creates a general pipeline named `general-pipeline` and then creates a new pipeline named `outer-pipeline`, which references the `general-pipeline`: | ||
|
|
||
| ```json | ||
| PUT _ingest/pipeline/general_pipeline | ||
| { | ||
| "description": "a general pipeline", | ||
| "processors": [ | ||
| { | ||
| "uppercase": { | ||
| "field": "protocol" | ||
| }, | ||
| "remove": { | ||
| "field": "name" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
| {% include copy-curl.html %} | ||
|
|
||
| ```json | ||
| PUT _ingest/pipeline/outer-pipeline | ||
| { | ||
| "description": "an outer pipeline referencing the general pipeline", | ||
| "processors": [ | ||
| { | ||
| "pipeline": { | ||
| "name": "general-pipeline" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
| {% include copy-curl.html %} | ||
|
|
||
| ### Step 2 (Optional): Test the pipeline | ||
|
|
||
| It is recommended that you test your pipeline before you ingest documents. | ||
| {: .tip} | ||
|
|
||
| To test the pipeline, run the following query: | ||
|
|
||
| ```json | ||
| POST _ingest/pipeline/outer-pipeline/_simulate | ||
| { | ||
| "docs": [ | ||
| { | ||
| "_source": { | ||
| "protocol": "https", | ||
| "name":"test" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
| {% include copy-curl.html %} | ||
|
|
||
| #### Response | ||
|
|
||
| The following example response confirms that the pipeline is working as expected: | ||
|
|
||
| ```json | ||
vagimeli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| "docs": [ | ||
| { | ||
| "doc": { | ||
| "_index": "_index", | ||
| "_id": "_id", | ||
| "_source": { | ||
| "protocol": "HTTPS" | ||
| }, | ||
| "_ingest": { | ||
| "timestamp": "2024-05-24T02:43:43.700735801Z" | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
| {% include copy-curl.html %} | ||
|
|
||
| ### Step 3: Ingest a document | ||
|
|
||
| The following query ingests a document into an index named `testindex1`: | ||
|
|
||
| ```json | ||
| POST testindex1/_doc/1?pipeline=outer-pipeline | ||
| { | ||
| "protocol": "https", | ||
| "name": "test" | ||
| } | ||
| ``` | ||
| {% include copy-curl.html %} | ||
|
|
||
| #### Response | ||
|
|
||
| The request indexes the document with the `protocol` field converted to uppercase and the field name removed from the index `testindex1`, as shown in the following response: | ||
|
|
||
| ```json | ||
| { | ||
| "_index": "testindex1", | ||
| "_id": "1", | ||
| "_version": 2, | ||
| "result": "created", | ||
| "_shards": { | ||
| "total": 2, | ||
| "successful": 2, | ||
| "failed": 0 | ||
| }, | ||
| "_seq_no": 1, | ||
| "_primary_term": 1 | ||
| } | ||
| ``` | ||
| {% include copy-curl.html %} | ||
|
|
||
| ### Step 4 (Optional): Retrieve the document | ||
|
|
||
| To retrieve the document, run the following query: | ||
|
|
||
| ```json | ||
| GET testindex1/_doc/1 | ||
| ``` | ||
| {% include copy-curl.html %} | ||
|
|
||
| #### Response | ||
|
|
||
| The response shows the document with the `protocol` field converted to uppercase and the field name removed: | ||
|
|
||
| ```json | ||
vagimeli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| "_index": "testindex1", | ||
| "_id": "1", | ||
| "_version": 2, | ||
| "_seq_no": 1, | ||
| "_primary_term": 1, | ||
| "found": true, | ||
| "_source": { | ||
| "protocol": "HTTPS" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.