Skip to content

added delete_source functionality to the dissect processor#5662

Merged
kkondaka merged 2 commits into
opensearch-project:mainfrom
fidelity-contributions:enhancement-5345
Jul 11, 2025
Merged

added delete_source functionality to the dissect processor#5662
kkondaka merged 2 commits into
opensearch-project:mainfrom
fidelity-contributions:enhancement-5345

Conversation

@alamzeeshan
Copy link
Copy Markdown
Contributor

Description

This change will add a new functionality to the dissect processor. Now users can choose a new option delete_source: true which will delete the source field if dissect processor was successful in extracting the fields.

Example config:

  processor:
    - dissect:
        map:
          message: "%{Date} %{Time} %{Log_Type}: %{Message}"
        delete_source: true

Issues Resolved

Resolves #5345

Check List

  • [x ] New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • [ x] New functionality has javadoc added
  • [ x] Commits are signed with a real name per the DCO

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.

Signed-off-by: Zeeshan Alam <Zeeshan.Alam+fidelity@fmr.com>
dlvenable
dlvenable previously approved these changes May 6, 2025
Copy link
Copy Markdown
Member

@dlvenable dlvenable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @alamzeeshan !

san81
san81 previously approved these changes May 6, 2025
Copy link
Copy Markdown
Collaborator

@san81 san81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Thanks for the contribution.

@dlvenable
Copy link
Copy Markdown
Member

@alamzeeshan , Can you create a GitHub issue against the documentation-website with information for this?

@alamzeeshan
Copy link
Copy Markdown
Contributor Author

@alamzeeshan , Can you create a GitHub issue against the documentation-website with information for this?

@dlvenable Created opensearch-project/documentation-website#9951

@dlvenable
Copy link
Copy Markdown
Member

@alamzeeshan ,

I see this failure:

> Task :data-prepper-plugins:dissect-processor:checkstyleMain
/home/runner/work/data-prepper/data-prepper/data-prepper-plugins/dissect-processor/src/test/java/org/opensearch/dataprepper/plugins/processor/dissect/DissectProcessorTest.java:288: error: cannot find symbol
        assertFalse(dissectedRecords.get(0).getData().containsKey("test"));
        ^
  symbol:   method assertFalse(boolean)
  location: class DissectProcessorTest
1 error

> Task :data-prepper-plugins:dissect-processor:compileTestJava FAILED

You can run the unit tests for this project to fast check on your side:

./gradlew -p data-prepper-plugins/dissect-processor clean build

Signed-off-by: Zeeshan Alam <Zeeshan.Alam+fidelity@fmr.com>
@kayhern kayhern dismissed stale reviews from san81 and dlvenable via 7240a2c June 24, 2025 14:50
@alamzeeshan
Copy link
Copy Markdown
Contributor Author

@alamzeeshan ,

I see this failure:

> Task :data-prepper-plugins:dissect-processor:checkstyleMain
/home/runner/work/data-prepper/data-prepper/data-prepper-plugins/dissect-processor/src/test/java/org/opensearch/dataprepper/plugins/processor/dissect/DissectProcessorTest.java:288: error: cannot find symbol
        assertFalse(dissectedRecords.get(0).getData().containsKey("test"));
        ^
  symbol:   method assertFalse(boolean)
  location: class DissectProcessorTest
1 error

> Task :data-prepper-plugins:dissect-processor:compileTestJava FAILED

You can run the unit tests for this project to fast check on your side:

./gradlew -p data-prepper-plugins/dissect-processor clean build

Hi @dlvenable ,

I missed one import statement. I have update the code and verified the build using ./gradlew -p data-prepper-plugins/dissect-processor clean build. BUILD WAS SUCCESSFUL. Please take a look

@alamzeeshan
Copy link
Copy Markdown
Contributor Author

Nice. Thanks for the contribution.

Hi @san81 , Can you please re-approve this PR. I added a missing import statement.

@alamzeeshan
Copy link
Copy Markdown
Contributor Author

Hi @san81 @kkondaka Can you please review this PR?

Copy link
Copy Markdown
Collaborator

@san81 san81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this nice contribution

@kkondaka kkondaka merged commit b08a3a1 into opensearch-project:main Jul 11, 2025
44 of 47 checks passed
JonahCalvo pushed a commit to JonahCalvo/os-data-prepper that referenced this pull request Jul 17, 2025
…h-project#5662)

* completed feature request

Signed-off-by: Zeeshan Alam <Zeeshan.Alam+fidelity@fmr.com>

* added missing import statement

Signed-off-by: Zeeshan Alam <Zeeshan.Alam+fidelity@fmr.com>

---------

Signed-off-by: Zeeshan Alam <Zeeshan.Alam+fidelity@fmr.com>
Co-authored-by: Zeeshan Alam <Zeeshan.Alam+fidelity@fmr.com>
Signed-off-by: Jonah Calvo <caljonah@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow source field to be deleted if dissect processor was successful

4 participants