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

[libbeat] : add processors "decode_duration", "move_fields" #31301

Merged
merged 4 commits into from
Nov 16, 2022

Conversation

kunsonx
Copy link
Contributor

@kunsonx kunsonx commented Apr 14, 2022

What does this PR do?

Ability to manipulate log fields.

  1. Give a prefix for all log fields
  2. Decode go style duration string then custom format
  3. Move fields from map into another map
  4. Move fields into a parent field map.

Why is it important?

Give users ability custom log field operations.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@kunsonx kunsonx requested a review from a team as a code owner April 14, 2022 10:05
@kunsonx kunsonx requested review from belimawr and fearful-symmetry and removed request for a team April 14, 2022 10:05
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Apr 14, 2022
@cla-checker-service
Copy link

cla-checker-service bot commented Apr 14, 2022

💚 CLA has been signed

@kunsonx kunsonx changed the title feat : add libbeat processors "add_prefix", "decode_duration", "move_fields", "objectize". [libbeat] : add processors "add_prefix", "decode_duration", "move_fields", "objectize". Apr 14, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented Apr 14, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-11-15T14:35:14.716+0000

  • Duration: 67 min 46 sec

Test stats 🧪

Test Results
Failed 0
Passed 23951
Skipped 1951
Total 25902

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@belimawr belimawr added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Apr 14, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Apr 14, 2022
Copy link
Contributor

@belimawr belimawr left a comment

Choose a reason for hiding this comment

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

@kunsonx Are you still working on this PR? On a quick glance it looks fine, but it's missing tests and documentation.

Could you request a re-review once you're done with coding?

@kunsonx
Copy link
Contributor Author

kunsonx commented Apr 22, 2022

@kunsonx Are you still working on this PR? On a quick glance it looks fine, but it's missing tests and documentation.

Could you request a re-review once you're done with coding?

OK. I will finish this works. Should I close this MR and open again when it's done?

@belimawr

BTW Where is the guideline for write tests and documentation?

I am beginner for this project contribute.

@belimawr
Copy link
Contributor

@kunsonx Are you still working on this PR? On a quick glance it looks fine, but it's missing tests and documentation.
Could you request a re-review once you're done with coding?

OK. I will finish this works. Should I close this MR and open again when it's done?

@belimawr

BTW Where is the guideline for write tests and documentation?

I am beginner for this project contribute.

No need to close/open another PR, just make sure to use the re-review request button once you're done so I get notified and can start reviewing.

You can check the contributing docs here: https://www.elastic.co/guide/en/beats/devguide/current/beats-contributing.html, there you will also find information regarding tests and documentation.

If you still need something more specific, then try looking how the other processors implement their tests and documentation.

@kunsonx kunsonx requested a review from belimawr May 11, 2022 09:28
@kunsonx
Copy link
Contributor Author

kunsonx commented May 11, 2022

@belimawr Hi. I finished the add_prefix processor tests and documentation. Could you take a look it is satisfaction? if you feel it is ok then will finish these other processors.

Thanks for your time.

@belimawr
Copy link
Contributor

@belimawr Hi. I finished the add_prefix processor tests and documentation. Could you take a look it is satisfaction? if you feel it is ok then will finish these other processors.

Thanks for your time.

Hey @kunsonx I can already see some linters are failing, could you take a look at them? They're quite strict, so don't be dismayed by it. Usually it takes some iterations until all linter passes.

To run it locally, go the root of the repo and run

mage linter:lastChange

You will have to fix all lint issues in the files you changed (not only the lines you added).

Because we added this linter recently, sometimes we have to ask the linter to ignore some lines/functions with a //nolint directive.

@belimawr
Copy link
Contributor

I'm closing it because there hasn't been any updated in a while.

@kunsonx, if you still want to work on this, just re-open the PR and push the new commits ;)

@belimawr belimawr closed this Jun 28, 2022
@kunsonx kunsonx changed the title [libbeat] : add processors "add_prefix", "decode_duration", "move_fields", "objectize". [libbeat] : add processors "decode_duration", "move_fields" Sep 19, 2022
@kunsonx
Copy link
Contributor Author

kunsonx commented Sep 19, 2022

@belimawr Hi belimawr.

Just busy for while and rework of these processors.

Just take a look it is satisfy?

#33119

Thanks.

@belimawr belimawr reopened this Sep 19, 2022
@mergify
Copy link
Contributor

mergify bot commented Sep 19, 2022

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @kunsonx? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@kunsonx
Copy link
Contributor Author

kunsonx commented Sep 25, 2022

Features sync from #33119. please take a look.

Thanks. @belimawr

Copy link
Contributor

@belimawr belimawr left a comment

Choose a reason for hiding this comment

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

Great Job!

I added some comments regarding the implementation and some documentation copy. I'll also try to get another reviewer at least for the docs.

libbeat/processors/decode_duration/decode_duration.go Outdated Show resolved Hide resolved
libbeat/processors/decode_duration/decode_duration.go Outdated Show resolved Hide resolved
libbeat/processors/decode_duration/decode_duration.go Outdated Show resolved Hide resolved
libbeat/processors/move_fields/move_fields.go Outdated Show resolved Hide resolved
libbeat/processors/move_fields/move_fields.go Outdated Show resolved Hide resolved
libbeat/processors/move_fields/move_fields_test.go Outdated Show resolved Hide resolved
libbeat/processors/decode_duration/decode_duration_test.go Outdated Show resolved Hide resolved
@kunsonx kunsonx removed the request for review from fearful-symmetry October 10, 2022 18:07
@kunsonx
Copy link
Contributor Author

kunsonx commented Oct 19, 2022

@dedemorton Thanks for your suggestions it make the docs better. Still has two suggestion here need more helps. 😀

@kunsonx kunsonx requested review from dedemorton and removed request for belimawr and dedemorton October 19, 2022 08:36
@belimawr
Copy link
Contributor

belimawr commented Nov 1, 2022

@dedemorton could you take another look/help out here?

@kunsonx
Copy link
Contributor Author

kunsonx commented Nov 14, 2022

@dedemorton Have any idea about the pull request?

Copy link
Contributor

@dedemorton dedemorton left a comment

Choose a reason for hiding this comment

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

The changes LGTM!

@kunsonx kunsonx requested a review from belimawr November 15, 2022 03:16
@belimawr
Copy link
Contributor

@kunsonx could you update the PR with main? You can use the Update branch button here or do it manually.

There were some big changes in the codebase recently, but they should not affect this PR.

@kunsonx
Copy link
Contributor Author

kunsonx commented Nov 15, 2022

@kunsonx could you update the PR with main? You can use the Update branch button here or do it manually.

There were some big changes in the codebase recently, but they should not affect this PR.

Done.

@kunsonx
Copy link
Contributor Author

kunsonx commented Nov 16, 2022

@belimawr Seems had two reviewers approved this pull request. so what is next?

@dedemorton dedemorton added the backport-v8.6.0 Automated backport with mergify label Nov 16, 2022
@dedemorton
Copy link
Contributor

I've added the backport label to make sure this gets into the next release. It sounds like this is ready to merge!

@belimawr belimawr merged commit dc1a0ca into elastic:main Nov 16, 2022
mergify bot pushed a commit that referenced this pull request Nov 16, 2022
Co-authored-by: hxms <[email protected]>
Co-authored-by: DeDe Morton <[email protected]>
(cherry picked from commit dc1a0ca)
@belimawr
Copy link
Contributor

@belimawr Seems had two reviewers approved this pull request. so what is next?

Merge and wait for it to land in the next release ;)

Thanks a lot for the contribution!

@belimawr
Copy link
Contributor

I was reviewing the backport and realised we missed the changelog entry 🤦‍♂️

@kunsonx would you mind creating a new PR adding the changelog entry? You can tag me to review it.

@kunsonx
Copy link
Contributor Author

kunsonx commented Nov 21, 2022

The changelog update at pull request: #33714
@belimawr

rdner added a commit that referenced this pull request Nov 30, 2022
…3700)

Co-authored-by: hxms <[email protected]>
Co-authored-by: DeDe Morton <[email protected]>
(cherry picked from commit dc1a0ca)

Co-authored-by: 冰天雪地 <[email protected]>
Co-authored-by: Denis <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
chrisberkhout pushed a commit that referenced this pull request Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.6.0 Automated backport with mergify Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants