Created
March 29, 2018 22:18
-
-
Save tostka/c04641027baef9c65e1d6e0180be472e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# comma-delimited server name array, | |
# foreach into logparser command | |
# Note: edit/update the logname string, to specify variant dates | |
# one-line follows (manually wrapped for clarity) | |
$CASs="US-HUBCAS1","US-HUBCAS2","US-HUBCAS3" ; | |
foreach ($CAS in $CASs){ | |
write-host ("`n" + $CAS) ; | |
.\logparser.exe "SELECT cs(User-Agent) as Client, count(*) as Hits INTO $CAS-EWS-ALLClients.csv FROM '\\$CAS\e$\Weblogs\W3SVC1\ex130919*.log' WHERE cs-uri-stem LIKE '%/EWS/%' GROUP BY Client ORDER BY Hits DESC" -o:csv ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment