splunk / docker-logging-plugin

Splunk Connect for Docker is a Docker logging plugin that allows docker containers to send their logs directly to Splunk Enterprise or a Splunk Cloud deployment.
Apache License 2.0
63 stars 25 forks source link

return sendMessage false when msg.length is zero #3

Closed anushjay closed 6 years ago

anushjay commented 6 years ago

This fix is to not send blank lines to Splunk (buffer length of zero).

luckyj5 commented 6 years ago

@anushjay Can we merge this PR first to develop? Develop branch now exist :)

sharonx commented 6 years ago

I wonder if the empty line is important for "docker logs "

With your change, the docker logs output will not have empty lines.

anushjay commented 6 years ago

@sharonx If we are worried about missing these messages then we will have to move this condition into the write function EG: postMessages() (or wherever event formation is going to happen based on the new architecture). This change does reduce some noise. EG: The Splunk startup logs have ~12 empty lines that get sent to Splunk and it does not look good :). It will be good to avoid those empty lines from showing up. @luckyj5 That's better, yes. I ll branch off of develop.

sharonx commented 6 years ago

I'm okay with doing the event filtering here. Can we log a message (eg: ignore empty line) when it is empty?

dtregonning commented 6 years ago

@sharonx good call @anushjay add a log when the if fails and its a empty line.

anushjay commented 6 years ago

Thanks, @dtregonning and @sharonx that sounds good. I'll reopen this from a branch off of develop.