-
Notifications
You must be signed in to change notification settings - Fork 1.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
Remove ingest processor supports excluding fields #10967
Conversation
Signed-off-by: Gao Binlong <[email protected]>
768f629
to
bd1b7d9
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Compatibility status:Checks if related components are compatible with change bc79b5d Incompatible componentsIncompatible components: [https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/performance-analyzer-rca.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/k-nn.git] |
Signed-off-by: Gao Binlong <[email protected]>
❌ Gradle check result for 5fdc552: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for a729d27: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Hi @reta , can this PR be merged now? |
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-10967-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 5dd4b61e83d9bbbdfd7fd490de4e8336bcc8e4f8
# Push it to GitHub
git push --set-upstream origin backport/backport-10967-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x Then, create a pull request where the |
@gaobinlong expected backport failure, could you please send a manual one? Thank you. |
…#10967) * Remove ingest processor supports field patterns and excluding fields Signed-off-by: Gao Binlong <[email protected]> * Format some code Signed-off-by: Gao Binlong <[email protected]> * Fix test failure Signed-off-by: Gao Binlong <[email protected]> * Remove the code of field pattern Signed-off-by: Gao Binlong <[email protected]> * Add skip version in rest test yml Signed-off-by: Gao Binlong <[email protected]> * Make fields and exclude_fields mutually exclusive when constructing RemoveProcessor Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]> (cherry picked from commit 5dd4b61)
…#10967) * Remove ingest processor supports field patterns and excluding fields Signed-off-by: Gao Binlong <[email protected]> * Format some code Signed-off-by: Gao Binlong <[email protected]> * Fix test failure Signed-off-by: Gao Binlong <[email protected]> * Remove the code of field pattern Signed-off-by: Gao Binlong <[email protected]> * Add skip version in rest test yml Signed-off-by: Gao Binlong <[email protected]> * Make fields and exclude_fields mutually exclusive when constructing RemoveProcessor Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]> (cherry picked from commit 5dd4b61)
* Remove ingest processor supports field patterns and excluding fields Signed-off-by: Gao Binlong <[email protected]> * Format some code Signed-off-by: Gao Binlong <[email protected]> * Fix test failure Signed-off-by: Gao Binlong <[email protected]> * Remove the code of field pattern Signed-off-by: Gao Binlong <[email protected]> * Add skip version in rest test yml Signed-off-by: Gao Binlong <[email protected]> * Make fields and exclude_fields mutually exclusive when constructing RemoveProcessor Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]> (cherry picked from commit 5dd4b61)
…#10967) * Remove ingest processor supports field patterns and excluding fields Signed-off-by: Gao Binlong <[email protected]> * Format some code Signed-off-by: Gao Binlong <[email protected]> * Fix test failure Signed-off-by: Gao Binlong <[email protected]> * Remove the code of field pattern Signed-off-by: Gao Binlong <[email protected]> * Add skip version in rest test yml Signed-off-by: Gao Binlong <[email protected]> * Make fields and exclude_fields mutually exclusive when constructing RemoveProcessor Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]>
…#10967) * Remove ingest processor supports field patterns and excluding fields Signed-off-by: Gao Binlong <[email protected]> * Format some code Signed-off-by: Gao Binlong <[email protected]> * Fix test failure Signed-off-by: Gao Binlong <[email protected]> * Remove the code of field pattern Signed-off-by: Gao Binlong <[email protected]> * Add skip version in rest test yml Signed-off-by: Gao Binlong <[email protected]> * Make fields and exclude_fields mutually exclusive when constructing RemoveProcessor Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]>
…#10967) * Remove ingest processor supports field patterns and excluding fields Signed-off-by: Gao Binlong <[email protected]> * Format some code Signed-off-by: Gao Binlong <[email protected]> * Fix test failure Signed-off-by: Gao Binlong <[email protected]> * Remove the code of field pattern Signed-off-by: Gao Binlong <[email protected]> * Add skip version in rest test yml Signed-off-by: Gao Binlong <[email protected]> * Make fields and exclude_fields mutually exclusive when constructing RemoveProcessor Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]> Signed-off-by: Shivansh Arora <[email protected]>
Description
Enhance remove ingest processor to support
field patternsand excluding fields, the following parameters will be added to the processor:1.field_pattern
: optional, single value or array, support wildcard pattern likea*
,*b
, ora*b
, fields match the pattern will be removed2.
exclude_filed
: optional, single value or array, fields not in this list will be removed3.exclude_filed_pattern
: optional, single value or array, fields do not match the pattern will be removedHere are some examples:
1. Remove the fields which start with `a`: ``` POST _ingest/pipeline/_simulate { "pipeline": { "processors": [ { "remove": { "field_pattern": "a*" } } ] }, "docs": [ { "_source": { "foo.bar": "1" } } ] } ```Some explanation about the implementation: 1. Why not make the existing parameter `field` to support wildcard? That's because field name can contain `*`, so if `field` supports wildcard, we don't know it's a concrete filed or a field pattern.-
-
-
-
Note that the existing parameter
field
is changed to be optional, it can be used withfield_pattern
at the same time, then all the fields specified in thefield
parameter and the fields match thefield_pattern
will be removed. However, (field, field_pattern) and (exclude_field, exclude_field_pattern) cannot be set at the same time, users have to choose one type of removal, obverse or reverse.For the parameter
ignore_missing
, it will only work withfield
parameter, not others, that means if the filed pattern specified infield_pattern
parameter doesn't hit any field in the documents, then nothing will happen, no exception likefiled doesn't exist
will be thrown.Some metadata fields like
_index
,_id
will be ignored when removing fields by specifyingfield_pattern
,exclude_field
, orexclude_field_pattern
, removing these metadata fields are meaningless and dangerous.How is the field pattern like? It supports wildcard pattern like
a*
,b*
,a*b
, and cannot contain some special character like#
,_
, this behavior is same with the index pattern in templates.Related Issues
#1578
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.