Dynamically Generated Directory Names
Hello. I was wondering if when given this file structure on a source server: /var/log/sudo-io/xx/yy/zz/ where xx, yy and zz are dynamically strings that run from 00 to FF inclusive e.g. /var/log/sudo-io/00/00/00/ /var/log/sudo-io/07/FE/90/ /var/log/sudo-io/0A/BF/D4/ /var/log/sudo-io/FF/FF/FF/ and the files that are located under each instance of /var/log/sudo-io/xx/yy/zz/ are: log stderr stdin stdout timing ttyin ttyout Is syslog-ng PE capable of recreating that exact same directory structure (including the original filenames) on the target (remote) host or should I perhaps just opt for rdiff or rsync instead? Thanks, Mike
Mike <asurfer@iinet.net.au> writes:
Hello.
I was wondering if when given this file structure on a source server:
/var/log/sudo-io/xx/yy/zz/
where xx, yy and zz are dynamically strings that run from 00 to FF inclusive e.g.
/var/log/sudo-io/00/00/00/
/var/log/sudo-io/07/FE/90/
/var/log/sudo-io/0A/BF/D4/
/var/log/sudo-io/FF/FF/FF/
and the files that are located under each instance of /var/log/sudo-io/xx/yy/zz/ are:
log stderr stdin stdout timing ttyin ttyout
Is syslog-ng PE capable of recreating that exact same directory structure (including the original filenames) on the target (remote) host or should I perhaps just opt for rdiff or rsync instead?
Well, if I understood you correctly, then yes, it is possible. But it's not going to be pretty. The easiest would be to add the path to the SDATA around the source side, so /var/log/sudo-io/xx/yy/zz/file would have an "SDATA filename=xx/yy/zz/file" and then on the destination side, you could do something like this: destination d_blah { file("/var/log/sudo-io/${.SDATA.filename}"); }; But it's probably a lot easier to rdiff or rsync, unless I missed something. -- |8]
Gergely Nagy <algernon@balabit.hu> writes:
Is syslog-ng PE capable of recreating that exact same directory structure (including the original filenames) on the target (remote) host or should I perhaps just opt for rdiff or rsync instead?
Well, if I understood you correctly, then yes, it is possible. But it's not going to be pretty.
The easiest would be to add the path to the SDATA around the source side, so /var/log/sudo-io/xx/yy/zz/file would have an "SDATA filename=xx/yy/zz/file" and then on the destination side, you could do something like this:
destination d_blah { file("/var/log/sudo-io/${.SDATA.filename}"); };
But it's probably a lot easier to rdiff or rsync, unless I missed something.
Come to think of it... you could write a program() source that reads the appropriate files, puts their path into sdata, and voila! Then it's fairly easy and painless to achieve what you want. But even then, rdiff/rsync is probably a better option. -- |8]
On 10/06/11 19:46, Gergely Nagy wrote:
Gergely Nagy<algernon@balabit.hu> writes:
Is syslog-ng PE capable of recreating that exact same directory structure (including the original filenames) on the target (remote) host or should I perhaps just opt for rdiff or rsync instead? Well, if I understood you correctly, then yes, it is possible. But it's not going to be pretty.
The easiest would be to add the path to the SDATA around the source side, so /var/log/sudo-io/xx/yy/zz/file would have an "SDATA filename=xx/yy/zz/file" and then on the destination side, you could do something like this:
destination d_blah { file("/var/log/sudo-io/${.SDATA.filename}"); };
But it's probably a lot easier to rdiff or rsync, unless I missed something. Come to think of it... you could write a program() source that reads the appropriate files, puts their path into sdata, and voila! Then it's fairly easy and painless to achieve what you want.
But even then, rdiff/rsync is probably a better option.
Hi Gergely. Thankyou for your speedy reply. Yes, rdiff/rsync is probably the more suitable choice for what I need to do and so I will go with that then. Best Regards, Mike
participants (2)
-
Gergely Nagy
-
Mike