[kwlug-disc] Scripting in Linux and unit.d

Paul Nijjar paul_nijjar at yahoo.ca
Tue Jan 10 22:00:57 EST 2012


On Tue, Jan 10, 2012 at 11:54:42AM -0500, Colin K wrote:
> Thanks john i was thinking of some kind of ugly grep thing that would pull
> out the lines that start with

> [SEVERE] and dump them into a file worst case but this could certainly do
> me a solid favor.  I would like to be able to seperate the server stuff
> from the user related things too but that might be a bit more complex
> filtration.
> The directory structure goes something like this
> /ServerRoot/Server.log
> Than
> /ServerRoot/Plugins/PluginConfigurationDir/pluginspecifics.yml
> If i could split the server.log to dump
> [SEVERS] into a /ServerRoot/Important.log
> the player stuff into /ServerRoot/Users.log
> the users stuff would have to probably detect a username and add it to a
> filter dynamically to automatically filter usernames and dump anything
> containing that kind of string into Users.log
> and finally possibly.
> /ServerRoot/plugins/PluginFolder/Plugin.log
> 
> This would be quite an elegant solution if at all possible but I will look
> into seeing how much of this i can do myself once i get home.  But i like
> good logs and i cannot lie. :D

John makes another good point. If you can configure rsyslog on this
server then splitting up entries using regular expressions is pretty
straightforward. I think the Users.log is going to be the hardest
unless there is a fixed string you can match against. 

A million years ago I did a presentation on rsyslog which shows some
of these techniques: 

http://kwlug.org/node/653

- Paul

-- 
http://pnijjar.freeshell.org 



More information about the kwlug-disc mailing list