Skip to content

Instantly share code, notes, and snippets.

@dejanstojanovic
Forked from GuyHarwood/parse-IIS-Log.cmd
Last active June 2, 2023 22:07
Show Gist options
  • Save dejanstojanovic/30c757f0b093a9e24314e82a8abe98d2 to your computer and use it in GitHub Desktop.
Save dejanstojanovic/30c757f0b093a9e24314e82a8abe98d2 to your computer and use it in GitHub Desktop.
parse raw IIS logs using MS Log Parser into csv file
logparser -i:W3C -o:csv "SELECT * INTO c:\temp\results.csv FROM c:\temp\myLogFile.log"
logparser.exe "SELECT * FROM u_ex17020200.log WHERE cs-uri-query LIKE '%updvmsisdn.aspx%'" -o:CSV -q:ON -stats:OFF >> C:\Log1\output.csv
logparser.exe "SELECT * FROM u_ex*.log WHERE cs-uri-stem LIKE '%updvmsisdn.aspx%' AND cs-uri-query LIKE '%countryId=31%'" -o:CSV -q:ON -stats:OFF >> C:\Users\Administrator\Desktop\temp\output.csv
logparser.exe "SELECT * FROM u_ex17022402.log WHERE cs-uri-stem LIKE '%updvmsisdn.aspx%' AND cs-uri-query LIKE '%countryId=31%'" -o:CSV -q:ON -stats:OFF >> C:\Users\Administrator\Desktop\temp\TEMP.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment