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

HTTP appender batch: true #278

Open
intermittentnrg opened this issue May 28, 2024 · 1 comment
Open

HTTP appender batch: true #278

intermittentnrg opened this issue May 28, 2024 · 1 comment

Comments

@intermittentnrg
Copy link

intermittentnrg commented May 28, 2024

The http appender could support batch to send multiple log entries to filebeat http endpoint.

The body must be either an object or an array of objects. Any other data types will result in an HTTP 400 (Bad Request) response. For arrays, one document is created for each object in the array.

Seems simple enough? Should probably be off by default and enabled with batch: true.

Would be nice to have.

@reidmorrison
Copy link
Owner

Should not be too difficult to implement, the steps for someone that wants to submit a PR would be as follows:

  1. Add batch method to HTTP Appender that like log takes an array of messages. For an example, see
  2. Add batch method to JSON Formatter to output the array of log entries as a single JSON entry. Similar to the call method, except it takes an array of log entries. For an example, see:

As mentioned above, all that should be needed next is to set batch: true when creating the appender instance, which should automatically create an appender thread and send the log messages in batches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants