We are currently trying to configure Awstats to compile all of our SP internet traffic statistics, and because we are behind an F5 load balancer we had to enable Advanced IIS logging so we could get source IP address, (otherwise Awstats says we only have 1 visitor, and that's the F5). The problem is that with multiple WFE's we need to use the logresolvemerge command to merge the various WFE's log files into one.
This was relatively easy with normal IIS logs. We just had the following script figure out yesterday's date and merge the logs:
# get yesterday's datemy ($sec, $min, $hour, $mday, $mon, $year) = localtime();
my $yesterday_midday=timelocal(0,0,12,$mday,$mon,$year) - 24*60*60;
($sec, $min, $hour, $mday, $mon, $year) = localtime($yesterday_midday);
my @abbr = qw(01 02 03 04 05 06 07 08 09 10 11 12);
my $yesterday = sprintf"%2d%s%02d", $year= sprintf("%02d", $year % 100),$abbr[$mon],$mday;
# save the date with the required log file convention
my $yest = "u_ex${yesterday}.log";
#system($yest);
# use $yest as filename for logs from different servers. "\" has been used to escape characters
system("perl C:\\inetpub\\awstats\\cgi-bin\\logresolvemerge.pl \\\\123ms538\\Logs\\123.com\\W3SVC593474230\\$yest \\\\123ms539\\Logs\\123.com\\W3SVC593474230\\$yest > D:\\Logs\\MergedLogs\\$yest");
The problem is that with Advanced IIS logging our log files are named this: 123MS538-Server-123.com_D20140107-211054005.log
(and yes, I'm substituting 123 for some things)
I can't figure out how to either get rid of the stuff after the - behind the date, or come up with some way to have the script just ignore all of that and treat it like one big wild card. Something long the lines of -????????.log.
Any help or suggestions is appreciated.
Ted