Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Add custom event encoder for Elasticsearch output #277

Merged

Conversation

fearful-symmetry
Copy link
Contributor

@fearful-symmetry fearful-symmetry commented Mar 1, 2023

What does this PR do?

Fixes #256
Fixes #253

This adds a custom Event type along with the fastjson implementation in order to correctly add a @timestamp field to events. This is something the Beats elasticsearch output already does, and presumably went unnoticed as the logic is buried in a special little encoder callback.

Why is it important?

We need a @timestamp field.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.md or CHANGELOG-developer.md.

@fearful-symmetry fearful-symmetry added bug Something isn't working Team:Elastic-Agent Label for the Agent team labels Mar 1, 2023
@fearful-symmetry fearful-symmetry requested a review from a team as a code owner March 1, 2023 22:48
@fearful-symmetry fearful-symmetry self-assigned this Mar 1, 2023
@fearful-symmetry fearful-symmetry requested review from rdner and faec and removed request for a team March 1, 2023 22:48
@mergify
Copy link
Contributor

mergify bot commented Mar 1, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @fearful-symmetry? 🙏.
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

@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 1, 2023

💚 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: 2023-03-02T00:03:38.857+0000

  • Duration: 17 min 59 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

@fearful-symmetry
Copy link
Contributor Author

/test

1 similar comment
@fearful-symmetry
Copy link
Contributor Author

/test

@rdner rdner removed their request for review March 2, 2023 08:59
@fearful-symmetry fearful-symmetry merged commit 264394b into elastic:main Mar 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

include @timestamp in events sent via elasticsearch output Fix elasticsearch output adding bulk index item
4 participants