-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Honor default_pipeline on scripted _index rewrites #42019
Comments
Consider the following example: Events are ingested to the index No need to update the central ingest pipeline and put a long list of conditional But as already mentioned - It will be the responsibility of the user to prevent any circular loops in such a setup. |
That should really be |
Pinging @elastic/es-core-features |
@peterpramb - I believe that this #39607 (as of 6.7) addresses your request. Can you try your test case out on 6.7+ and if it still doesn't work can you provide a reproduction scenario ? |
Unfortunately I'm at 6.7.1. Here is a simple test case:
PUT /_ingest/pipeline/testing-ingest-pipeline
{
"description": "Chained pipelines via index templates (#42019)",
"processors": [
{
"append": {
"field": "pipeline_set",
"value": "ingest"
}
},
{
"script": {
"lang": "painless",
"source": "ctx._index = 'testing-index-chained';"
}
}
],
"version": 20190512
}
PUT /_template/testing-ingest-template
{
"index_patterns": [
"testing-index-ingest"
],
"version": 20190512,
"order": 0,
"settings": {
"index": {
"default_pipeline": "testing-ingest-pipeline"
}
}
}
PUT /_ingest/pipeline/testing-chained-pipeline
{
"description": "Chained pipelines via index templates (#42019)",
"processors": [
{
"append": {
"field": "pipeline_set",
"value": "chained"
}
},
{
"script": {
"lang": "painless",
"source": "ctx._index = 'testing-index-final';"
}
}
],
"version": 20190512
}
PUT /_template/testing-chained-template
{
"index_patterns": [
"testing-index-chained"
],
"version": 20190512,
"order": 0,
"settings": {
"index": {
"default_pipeline": "testing-chained-pipeline"
}
}
}
POST /testing-index-ingest/_doc/
{
"field": "value"
}
{
"_id": "GWvEq2oBkBB05GCNyfzM",
"_index": "testing-index-chained",
"_primary_term": 1,
"_seq_no": 0,
"_shards": {
"failed": 0,
"successful": 2,
"total": 2
},
"_type": "_doc",
"_version": 1,
"result": "created"
}
GET /testing-index-chained/_doc/GWvEq2oBkBB05GCNyfzM
{
"_id": "GWvEq2oBkBB05GCNyfzM",
"_index": "testing-index-chained",
"_primary_term": 1,
"_seq_no": 0,
"_source": {
"field": "value",
"pipeline_set": [
"ingest"
]
},
"_type": "_doc",
"_version": 1,
"found": true
} |
And this is the resulting index:
What should be |
The Elasticsearch version:
|
Still not working in |
Pinging @elastic/es-data-management (Team:Data Management) |
Describe the feature:
Ingest pipelines allow for rewriting _index using the
script
processor (and possibly others), dynamically dispatching documents to different indices. Unfortunately, while index templates are considered for the new target index, a defined default_pipeline is not executed.It would allow for more flexible pipeline chaining just to add new index templates when needed instead of updating the central ingest pipeline every time with new target pipelines. Another use case would be to specify only an additional pipeline for some indices and none for others.
It will be the responsibility of the user to prevent any circular loops, though.
The text was updated successfully, but these errors were encountered: