On Fri, 2005-01-28 at 01:04 -0500, Ed Ravin wrote:
On Tue, Jan 18, 2005 at 11:29:07AM -0500, Ed Ravin wrote:
I've written a perl script that takes as input a file with syslog I use this for test environments, especially when I'm testing things results when parsed by logsurfer.
My tool does two things logger doesn't - (1) it trims off the existing timestamps from the input before logging it, and more interestingly, (2) can parse those timestamps and replay the log messages at the same rate that they were originally logged. Or you can tell it to "time warp" and play the messages back 2x 3x, 1/5x as fast, etc. This is why it's good for testing logsurfer files, since you can test whether your timeouts work.
I have to spruce it up slightly (get rid of the XXX comments :-) before I release it, will do so Real Soon.
OK, here it is, as an attachment. With perldoc documentation, too. One possible bug not mentioned in the doc is that sleeping between messages to simulate the original delivery times seems to be getting rounded to the nearest second, a problem I thought using Time::HiRes would fix, but could conceivably be limited to my local environment.
If anyone uses this, please let me know what you think. It's still in the beta stage, but since it's only a tool for testing rather than production, that should be sufficient for most purposes :-)
I'd like to include this script in the syslog-ng tarball within the contrib directory if you don't mind, though you should add a copyright and license header to the beginning of the file. (I know it is at the end of the documentation but that's not visible enough) -- Bazsi