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

[Filebeat] adding base64encode func to value template #27681

Merged
merged 4 commits into from
Sep 3, 2021

Conversation

P1llus
Copy link
Member

@P1llus P1llus commented Sep 1, 2021

What does this PR do?

This adds base64encode functionality for value templates in httpjson input.

Why is it important?

Adds new functionality to httpjson input.
Adding possibility for .request and .header comes in a separate PR.

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.

Related issues

@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Sep 1, 2021
@elasticmachine
Copy link
Collaborator

elasticmachine commented Sep 1, 2021

💚 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: 2021-09-02T12:20:38.505+0000

  • Duration: 94 min 49 sec

  • Commit: f5be1a9

Test stats 🧪

Test Results
Failed 0
Passed 8160
Skipped 1201
Total 9361

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 8160
Skipped 1201
Total 9361

@adriansr
Copy link
Contributor

adriansr commented Sep 1, 2021

LGTM,

However, I think we should add the option to output non-padded base64 (RawStdEncoding), it may be necessary in some cases. Something like base64Encode and base64EncodeNoPad, or similar names.

There's also URLEncoding, don't know how frequent that is used.

Copy link
Contributor

@marc-gr marc-gr left a comment

Choose a reason for hiding this comment

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

LGTM aside of the minor comment

x-pack/filebeat/input/httpjson/internal/v2/value_tpl.go Outdated Show resolved Hide resolved
P1llus and others added 2 commits September 2, 2021 14:16
Co-authored-by: Marc Guasch <marc-gr@users.noreply.github.com>
@P1llus P1llus merged commit bf7103c into elastic:master Sep 3, 2021
@P1llus P1llus added the backport-v7.16.0 Automated backport with mergify label Sep 3, 2021
mergify bot pushed a commit that referenced this pull request Sep 3, 2021
* adding base64encode func to value template

* add docs and changelog

* Update x-pack/filebeat/input/httpjson/internal/v2/value_tpl.go

Co-authored-by: Marc Guasch <marc-gr@users.noreply.github.com>

* adding comments from PR

Co-authored-by: Marc Guasch <marc-gr@users.noreply.github.com>
(cherry picked from commit bf7103c)
P1llus added a commit that referenced this pull request Sep 3, 2021
* adding base64encode func to value template

* add docs and changelog

* Update x-pack/filebeat/input/httpjson/internal/v2/value_tpl.go

Co-authored-by: Marc Guasch <marc-gr@users.noreply.github.com>

* adding comments from PR

Co-authored-by: Marc Guasch <marc-gr@users.noreply.github.com>
(cherry picked from commit bf7103c)

Co-authored-by: Marius Iversen <marius.iversen@elastic.co>
Icedroid pushed a commit to Icedroid/beats that referenced this pull request Nov 1, 2021
* adding base64encode func to value template

* add docs and changelog

* Update x-pack/filebeat/input/httpjson/internal/v2/value_tpl.go

Co-authored-by: Marc Guasch <marc-gr@users.noreply.github.com>

* adding comments from PR

Co-authored-by: Marc Guasch <marc-gr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7.16 candidate backport-v7.16.0 Automated backport with mergify Filebeat Filebeat
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Filebeat] Add base64 function to template engine
4 participants