I'm not a newbie to Linux in general, but I have had little to no experience writing programs or scripts. I was hoping that somebody may be able to give me a heads-up on how to accomplish this.
I am running a game server on my Xandros box as a test server for my clan. I want to be able to easily see how much, if any, traffic I am getting on the server. The game creates a log file with entries that are easily identifiable each time someone joins the server. However, since I have the server running all the time I have to wade through a lot of other stuff to see these login messages.
The log looks like this:
Quote:
1606:18 InitGame: \.Admin\=DREAD= Croaker\.Email\xxxxxxx\.Location\So. Cal\.Website\xxxxxxxx\g_gametype\bel\g_timeoutsallowed\0\gamename\CoD:United Offensive\mapname\mp_uo_dawnville\protocol\22\scr_allow_jeeps\1\scr_allow_tanks\1\shortversion\1.51\ sv_allowAnonymous\0\sv_floodProtect\1\sv_hostname\Croaker's STOCK Practice Server\sv_maxclients\14\sv_maxPing\200\sv_maxRate\5000\sv_minPing\0\sv_privateClients\4\sv_punkbuste r\1\sv_pure\1
1606:35 J;0;5;[TBC] Raven
1606:49 ShutdownGame:
|
The entry that I am looking to extract is the:
Quote:
1606:35 J;0;5;[TBC] Raven
|
So, what I need is a text file parser that will allow me to find the line that includes the
characters as they are unique, and then extract that entire line and place it into the output file. The output file does not need to be formatted for the web, nor is it being saved to a database, just a regular text file would be fine.
I did a number of searches through Google, but most of what I found created either the web-format or database-format output files. Or else they were specific to certain types of log files or configuration files for input.
Can anyone point me to a decent parser program or script that is flexible enough to do what I want?
Any help would be appreciated.
Thanks.