How can i setting that

How can i setting that
Server 1
Input milti files (differnt path)
Output logstash tcp

Server 2
Input logstash tcp
Output also multi files (diffrent path)

Only use logstash but in/out is diffrent server.

Also, Can i use the input filename as the oupt filename?

Pleash help me and thank you.

The file input adds a [path] field to events. You could use a sprintf reference to this in the file output.