I think encoding the name in the record and decoding on the receiver is the 
most elegant solution to your problem. It allows you to add as many clients as 
you want without having to create new inputs. You can also use the 
$MessageSourceAddress field to create an automatic directory structure.

On the receiver side: (this assumes you encode the filename into a field called 
$SourceFile)

<Output file>
                Module                om_file
                Exec                       if $SourceFile =~ /([^\/]*)$/ 
$_fileName = $1; \
$_filePath = "/path/to/log/files/" + "$MessageSourceAddress + "/" + $_fileName;
                File                         $_filePath
                CreateDir             TRUE
</Output>

This should create a directory structure on the central storage server that 
looks like:

/path/to/log/files
                /10.0.0.1/Disk_1.log
                                /Disk_2.log
                /10.0.0.2/Disk_b_1.log
                                /Disk_b_2.log

This is just an example. It doesn't do file rotation or anything fancy.

P.S. I wouldn't cut and paste my code. I am a horrible typist.

Justin

From: Ciummo, Lawrence [mailto:lawrence.ciu...@emc.com]
Sent: Friday, December 06, 2013 1:51 PM
To: nxlog-ce-users@lists.sourceforge.net
Subject: [nxlog-ce-users] formwarding multiple log files from many clients to a 
single host

I have a a system with several client nodes that need to send files to a single 
sever.  I need to maintain the file name from each client and send each to the 
server with the same name (the client file log names are unique).

The number of client log files is arbitrary and not none in advance, so I can 
send each file over a separate port to the server to process back into a file.  
I could encode the name into each record in the client side log and send them 
all to the server on the same port and sort them out, but I'd like to avoid 
this approach.

Any idea.

Example

Client 1 has:

Disk_1.log
Disk_2.log
...
Disk_9999.log


Client 2 has

Disk_b_1.log
Disk_b_2.log
....
Disk_b_500.log

I need to get these files to a common server with the same names.

Thanks
Larry

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
nxlog-ce-users mailing list
nxlog-ce-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nxlog-ce-users

Reply via email to