I am trying to get all logs under a single directory to write to separate
files. I've read over some previous emails but still have issues. When I
use the recommended syntax to parse out the name the files aren't being
written to the server. Here is the configuration I'm using:
<Input mfglog>
Module im_file
File "/path/to/logs/*.log"
InputType LineBased
SavePos TRUE
Exec if file_name() =~ /[\w-]+\.log/ $FileName = $1;
Exec $raw_event ="[" + hostname() + "]" + "[" + $FileName + "]"
+ $raw_event;
</Input>
When I attempt to use the file_name() the file name adds the path twice to
the folder structure.
Exec $raw_event ="[" + hostname() + "]" + "[" + file_name() +
"]" + $raw_event;
For example if the foo.log resides in /foo/bar/ the the folder structure on
the log server is as follows:
/foo/bar/foo.log/foo/bar/foo.log.log
Also, could I use file_basename to achieve the desired results?
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
nxlog-ce-users mailing list
nxlog-ce-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nxlog-ce-users