Skip to content

File output on Windows missing CRLF #3151

@johnkeates

Description

@johnkeates

Describe the bug
File outputs only have Unix line endings (LF), and some tools are having trouble reading files without CRLF on Windows.

To Reproduce

  1. Read any input
  2. Write to a file
  3. File will always have a LF as a line ending

Expected behavior
at 3: use system-native line endings or at least make it configurable

Your Environment
In windows, I'm transferring logs and splitting them off between a couple of servers.

  • td-agent fluentd 1.11.2
  • Windows Server 2016

Your Configuration

<label @iis_text_logs>
  <match **>
    @type file
    path D:\Logs\IIS\W3SVC1\iis.%Y%m%dT%H%M%S%z
	append true
	<format>
	  @type single_value
	</format>
    <buffer>
      timekey 5s
      timekey_use_utc true
      timekey_wait 10s
	  path "D:\\Logs\\IIS\\W3SVC1\\buffer"
    </buffer>
   </match>
 </label>

Your Error Log
No errors.

Additional context
The reason for this curious configuration and the reason I'm hitting this is probably because I'm (ab)using fluentd to stream text logs from one server to another (as close to realtime as it will go - but buffer won't let me without writing billions of files...). The input is CRLF-terminated and the output needs to be CRLF-terminated as well for the follow-up tool that will then read the files. (and no, that tool cannot run on the source server, hence the setup)

Metadata

Metadata

Assignees

Labels

enhancementFeature request or improve operations

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions