It is hard with fluentd v0.12.
In v0.14 master, master means not relased yet, it can with following configuration.
<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 # for test
</buffer>
<format>
@type single_value
</format>
</match>
$ ls in/
test.log
% ls out
${tailed_path}/ test.log.20161114
timestamp is added to seperate files.
Masahiro