View Single Post
  #1  
Old 12-15-2009, 08:15 PM
cubber
Discordant
 
Join Date: Apr 2006
Posts: 374
Default Bash script to filter logins from log files

I created this simple script so that I could parse the log files to see login activity on the server from the command line on the server.

The script parses the eqemu_debug_world.log file and returns a list of account names as well as date and time that they logged in.

Change the logfile="" line to point to your log file location.


Code:
#!/bin/bash

logfile="/opt/eqemu/logs/eqemu_debug_world.log";

grep Logged $logfile | awk {'print $6, $2, $3, $4'}

exit

The output of the script looks like so:

Code:
accountname: [12.04. - 12:52:58]
accountname2: [12.06. - 16:35:49]
accountname: [12.07. - 20:45:52]
anotheraccountname: [12.07. - 20:47:54]
Enjoy!
Reply With Quote