Skip to content

Instantly share code, notes, and snippets.

@repeatedly
Last active November 15, 2016 00:31
Show Gist options
  • Save repeatedly/1c18ea2088d91605018b66f47b1748af to your computer and use it in GitHub Desktop.
Save repeatedly/1c18ea2088d91605018b66f47b1748af to your computer and use it in GitHub Desktop.
Sync like file transfer with v0.14
<source>
@type tail
path in/*.log
path_key tailed_path
read_from_head true
tag logs.tail
<parse>
@type none
</parse>
</source>
<filter logs.tail>
@type record_transformer
enable_ruby true
<record>
# overwrite full path to file name
tailed_path ${File.basename(record["tailed_path"])}
</record>
</filter>
<match logs.tail>
@type file
path out/${tailed_path}
append true
add_path_suffix false
<buffer time,tailed_path>
flush_at_shutdown true
</buffer>
<format>
@type single_value
</format>
</match>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment