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

Add a max-line-bytes flag which can be used to truncate messages before forwarding. #451

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aaw
Copy link

@aaw aaw commented May 1, 2015

We're using logstash-forwarders to forward logs from applications that we don't control. Some times, these applications may log really large lines, in which case we'd like to both keep these from being transmitted to logstash and keep the logstash-forwarder from even materializing the really long string.

This patch adds a max-line-bytes flag. max-line-bytes defaults to 0, which preserves the current behavior of logstash-forwarders: no truncation of log lines at all. When set to something greater than 0, any line containing more than max-line-bytes bytes will be truncated to max-line-bytes before being forwarded to logstash and no more than max-line-bytes is held in the harvester's buffer when reading the line.

I ran go test and rpsec with the changes after running go build. All tests passed except for the "packaging make rpm should build an rpm" spec, which failed with or without this patch. I've signed a elastic contributor license agreement.

…re forwarding.

The max-line-bytes flag defaults to 0, which does no truncation of log lines.
When set to something greater than 0, any line containing more than
max-line-bytes bytes will be truncated to max-line-bytes before being forwarded
to logstash.
@aaw aaw closed this Jun 1, 2015
@aaw aaw reopened this Jun 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants