<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.iis.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:cs="http://blogs.iis.net/"><channel><title>Search results matching tag 'IISW3C input format'</title><link>http://forums.iis.net/search/SearchResults.aspx?o=DateDescending&amp;tag=IISW3C+input+format&amp;orTags=0</link><description>Search results matching tag 'IISW3C input format'</description><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Missing Date Field in IISW3C logfile</title><link>http://forums.iis.net/p/1147536/1861778.aspx#1861778</link><pubDate>Fri, 11 Jan 2008 15:21:22 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1861778</guid><dc:creator>dinder</dc:creator><cs:applicationKey>input_formats-51</cs:applicationKey><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I need to parse logfile from server, but notice that no Date Field are configure&lt;/p&gt;
&lt;p&gt;--------------&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;#Software: Microsoft Internet Information Services 6.0&lt;br /&gt;#Version: 1.0&lt;br /&gt;#Date: 2008-01-06 00:01:02&lt;br /&gt;#Fields: time cs-method cs-uri-stem cs-uri-query cs-username c-ip cs-version cs(User-Agent) cs(Cookie) cs(Referer) sc-status sc-substatus sc-bytes cs-bytes time-taken &lt;br /&gt;00:01:02 GET /i.php - - 90.24.187.16 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+1.1.4322;+InfoPath.2;+.NET+CLR+2.0.50727) - - 200 0 2587 427 62&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;--------------------------&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/u&gt;I would like to use Logparser to rewrite my log, is it possible to extract the line 3 (&lt;font color="#0000ff"&gt;#Date: 2008-01-06 00:01:02) to create and add the date field to my new file log ?&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;Thks&lt;/font&gt;&lt;/p&gt;</description></item><item><title>RE: Filtering IIS logs of bot entries and outputing to multiple files</title><link>http://forums.iis.net/p/1146058/1855277.aspx#1855277</link><pubDate>Wed, 27 Jun 2007 21:59:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1855277</guid><dc:creator>LogParser User : mila</dc:creator><cs:applicationKey>input_formats-51</cs:applicationKey><description>Well this query did not work:&lt;br&gt; &lt;br&gt;SELECT* FROM c:\logs\april2007\*.* WHERE cs(uri-agent) NOT IN(SELECT botname FROM badbots.csv)" i:IISW3C o:W3C&lt;br&gt;&lt;br&gt;The second select is being executed as having the input format specification IISW3C.</description></item><item><title>RE: Filtering IIS logs of bot entries and outputing to multiple files</title><link>http://forums.iis.net/p/1146058/1855276.aspx#1855276</link><pubDate>Wed, 27 Jun 2007 20:19:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1855276</guid><dc:creator>LogParser User : mila</dc:creator><cs:applicationKey>input_formats-51</cs:applicationKey><description>Hope this is useful to an apprentice like myself:&lt;br /&gt;&lt;br /&gt;After some trial and error I have a working version of the second query using multiplexing.&lt;br /&gt;&lt;br /&gt;The first query simply filters out rows containing a certain string from an aggregate of IISW3C input sources and outputs to a single w3c output format file named w3c_out.log.&lt;br /&gt;&lt;br /&gt;It contains rows whose first fields are the original IIS log source path (it took me a few tried to figures out that the field name is logfilename2, not logfilename1). I use this field to create an output structure origfoldername/filenames via multiplexing (put the rows in separate files depending on where they originally came from as follows):&lt;br /&gt;&lt;br /&gt;The query in run on w3c_out.log:&lt;br /&gt;&lt;br /&gt;logparser &amp;quot;SELECT EXTRACT_PATH(logfilename2), EXTRACT_FILENAME(logfilename2), date, time, c-ip, s-ip, cs-method, cs-uri-stem, cs-uri-query, sc-statu&lt;br /&gt;s, sc-bytes, cs-bytes, time-taken, cs-version, cs(User-Agent), cs(Cookie), cs(Referer) INTO *_Filt\FILT_* FROM w3c_out.log&amp;quot; -i:W3C -o:W3C -e:10&lt;br /&gt;&lt;br /&gt;The original folder and files were named:&lt;br /&gt;c:\logs\april2007\log1.log ....log5.log&lt;br /&gt;&lt;br /&gt;The first query produced c:\w3c_out.log&lt;br /&gt;&lt;br /&gt;The 2nd query used multiplexing to reorganize the output records as follows:&lt;br /&gt;c:\logs\april2007_filt\filt_log1.log ...filt_log5.log&lt;br /&gt;&lt;br /&gt;Now I need to figure out the syntax for running the first query against not a single search term but many terms in a txt file. Actually it seems this is possible by putting the filter terms in a csv and using a SELECT embedded in a NOT IN:&lt;br /&gt;&lt;br /&gt;SELECT* FROM c:\logs\april2007\*.* WHERE cs(uri-agent) NOT IN(SELECT botname FROM badbots.csv)&amp;quot; i:IISW3C o:W3C</description></item><item><title>Filtering IIS logs of bot entries and outputing to multiple files</title><link>http://forums.iis.net/p/1146058/1851270.aspx#1851270</link><pubDate>Tue, 26 Jun 2007 21:04:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1851270</guid><dc:creator>LogParser User : mila</dc:creator><cs:applicationKey>input_formats-51</cs:applicationKey><description>I raised the question below to google groups and received an answer (also below). I'm new to SQL, Logparser, scripting with autoit, and IIS so please excuse my ignorance. I'm having trouble with syntax despite having looked at the documentation. I need to figure our how to write the two queries suggested in the answer to my google groups question pasted further below.&lt;br&gt;&lt;br&gt;One thing I'm trying to figure out is whether there is an abbreviated way to refer to all fields in a WHERE clause. I want to remove all lines in the log file that contain "botname". Its easy enough to say:&lt;br&gt;&lt;br&gt;logparser "SELECT* INTO A1.log FROM A.log WHERE cs(User-Agent) NOT LIKE '%botname%' " -i:IISW3C -o:IIS&lt;br&gt;&lt;br&gt;But how do I tell logparser to query against not just the cs(User-Agent) field, but all fields? Or do I even need to be searching in the other fields for this particular task?&lt;br&gt;&lt;br&gt;Here, in a question posted to google, are more details on what I am trying to do (the query I will ultimately need will be more complicated than the above example, but it would be nice to get it working in the simplified form first):&lt;br&gt;&lt;br&gt;I just started reading about logparser and I would like to use it to&lt;br&gt;rid IIS logs of entries containing bot names listed in a text file.&lt;br&gt;I'll be using autoit and Logparser COM.&lt;br&gt;&lt;br&gt;I was wondering what the best way to go about this would be. From what&lt;br&gt;I have read in the logparser documentation, it seems that the&lt;br&gt;following would not be possible:&lt;br&gt;&lt;br&gt;1. Logparser query cannot be setup such that: it is passed a file (say&lt;br&gt;a list of bot names) and told to filter the inputfiles of all lines&lt;br&gt;containing any of the terms in said file.&lt;br&gt;&lt;br&gt;2. Logparser cannot produce output upon running a query on a set of&lt;br&gt;multiple files such that the output is organized into files that&lt;br&gt;correspond to the source filenames. (So if files A, B, C are to be&lt;br&gt;filtered, the output cannot automatically be placed in files A1, B1,&lt;br&gt;C1 such that the contents of A1 = filtered contents of A, and&lt;br&gt;similarly for B1 and C1).&lt;br&gt;&lt;br&gt;Given the above assumptions, I have concluded that If I want to filter&lt;br&gt;a large set of files and if the filtering involves a large set of&lt;br&gt;filter terms, the best way to utilize logparser would be to run a&lt;br&gt;query multiple times in nested loops (inner loop traverses the list of&lt;br&gt;bots, and outer loop traverses the list of files. [In effect: For each&lt;br&gt;file A, [for each filter term 'bot' run a query that retreives all&lt;br&gt;lines NOT containing "bot", placing the output in A1. Repeat query on&lt;br&gt;file A for all bots names] Repeat for all files].&lt;br&gt;&lt;br&gt;I'd like to confirm whether or not my assumptions 1 and 2 above are&lt;br&gt;mistaken, and if my suggested way of completing this task is over&lt;br&gt;complicating things. Also any further tips or tool /scripting&lt;br&gt;recommendations are most welcome. Thanks. &lt;br&gt;&lt;br&gt;&lt;br&gt;ANSWER: &lt;br&gt;I think your approach is a bit complicated&lt;br&gt;&lt;br&gt;You overlook the fact that LogParser allows you to make a SQL query&lt;br&gt;against an aggregation of log sources while retaining knowledge of&lt;br&gt;which log source a particular log entry came from. This means that&lt;br&gt;what you want to do can be done with two commands which pass over the&lt;br&gt;logged data only twice.&lt;br&gt;&lt;br&gt;The first command is a LogParser query over the aggregate of the log&lt;br&gt;sources with a SQL WHERE clause constructed from the bot names in the&lt;br&gt;text file. This simultaneously walks both your nested loops with a&lt;br&gt;single SQL query. This allows File:A,File:B,File:C --(SQL-based-&lt;br&gt;Filter)-&gt; File:A1B1C1&lt;br&gt;&lt;br&gt;The second command chops up the output of the first command based on&lt;br&gt;the Filename field which indicates the original log source that the&lt;br&gt;data came from. This allows you to reconstruct File:A1, File:B1,&lt;br&gt;File:C1 given a file whose contents is A1B1C1 concatenated&lt;br&gt;&lt;br&gt;Of course, it is possible that aggregating everything into memory all&lt;br&gt;at once is too much, in which case your incremental approach would be&lt;br&gt;necessary.&lt;br&gt;&lt;br&gt;//David </description></item><item><title>RE: Need to group fields...</title><link>http://forums.iis.net/p/1145750/1855269.aspx#1855269</link><pubDate>Mon, 18 Jun 2007 10:30:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1855269</guid><dc:creator>LogParser User : DEinspanjer</dc:creator><cs:applicationKey>input_formats-51</cs:applicationKey><description>Write out the outputs of the first query to a text file using executeBatch then run the second query against that one.</description></item><item><title>RE: Custom field to IIS input</title><link>http://forums.iis.net/p/1145996/1855268.aspx#1855268</link><pubDate>Mon, 18 Jun 2007 07:03:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1855268</guid><dc:creator>LogParser User : past777</dc:creator><cs:applicationKey>input_formats-51</cs:applicationKey><description>&lt;P&gt;in qwery-&lt;BR&gt;&lt;STRONG&gt;select 1 as id, ... from iisw3c_file&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and set id in your real sql table as int, identity - yes&lt;/P&gt;&lt;P&gt;id's in your real sql table will be 1,2,3,4,5,6,...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>RE: Need to group fields...</title><link>http://forums.iis.net/p/1145750/1855284.aspx#1855284</link><pubDate>Sat, 16 Jun 2007 05:32:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1855284</guid><dc:creator>LogParser User : e.Brito</dc:creator><cs:applicationKey>input_formats-51</cs:applicationKey><description>&lt;P&gt;hi,&lt;BR&gt;can i do this using the LP COM API let's say, in VB.NET?&lt;BR&gt;thanks&lt;/P&gt;</description></item><item><title>Syntax Help</title><link>http://forums.iis.net/p/1146048/1851260.aspx#1851260</link><pubDate>Fri, 08 Jun 2007 14:07:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1851260</guid><dc:creator>LogParser User : erikkl2000</dc:creator><cs:applicationKey>input_formats-51</cs:applicationKey><description>Hi,&lt;br&gt;&lt;br&gt;Am i glad to find this forum...&lt;br&gt;&lt;br&gt;I trying to get this syntax correct and when ever i try to access the source file from a \\Share or a c:\ paths i keep getting an error of:&lt;br&gt;                  The system cannot find the path specified.&lt;br&gt;&lt;br&gt;***Here is my query******&lt;br&gt;&lt;br&gt;"SELECT DISTINCT cs(Cookie) FROM C:\Documents and Settings\Erik\Desktop\W3SVC1452108243\*.log"&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------&lt;br&gt;&lt;br&gt;Can someone give me some pointers here to what may be wrong?&lt;br&gt;&lt;br&gt;&lt;br&gt;erik</description></item><item><title>RE: Input Format FROM bug?</title><link>http://forums.iis.net/p/1146027/1855257.aspx#1855257</link><pubDate>Sun, 27 May 2007 20:41:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1855257</guid><dc:creator>LogParser User : Former_BigIronGuy</dc:creator><cs:applicationKey>input_formats-51</cs:applicationKey><description>Phil,&lt;br&gt;   It has been since v2.0 that I did a lot with LogParser.  I *do* remember that there were some logfiles on our intra-net server that for whatever reason, were completely munged.  At that time, the fix I resorted to was to list the IN_ROW_NUMBER of the output and then built a two part query to take every thing up to the bad record and one to pick up everything after.&lt;br&gt;   Howsoever, it appears to me that 2.2 has lots more robustness than what I remember, and appears to be able to successfully handle the exception rows...&lt;br&gt;&lt;br&gt;   FBIG</description></item><item><title>Trying to capture logins and URL's within a site visited by each user</title><link>http://forums.iis.net/p/1146029/1851241.aspx#1851241</link><pubDate>Sat, 19 May 2007 06:08:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1851241</guid><dc:creator>LogParser User : GKerr</dc:creator><cs:applicationKey>input_formats-51</cs:applicationKey><description>&lt;P&gt;I'm a rookie (obviously) with LogParser but was hoping to use this tool to capture a when users have logged in (date and time) to a specific site grouped by user name.&amp;nbsp; &lt;/P&gt;&lt;P&gt;The site is a Sharepoint site so there is&amp;nbsp;domain\username information available but I'm hoping to be able to capture when users visit specific URL's.&amp;nbsp;&amp;nbsp;I'm&amp;nbsp;guessing there will need to be&amp;nbsp;WHERE clauses&amp;nbsp;to locate the&amp;nbsp;URL in that I'm trying to count the number of visits to.&amp;nbsp; &lt;/P&gt;&lt;P&gt;For example I'd like to see something like this:&lt;/P&gt;&lt;P&gt;Domain\gkerr&amp;nbsp;&amp;nbsp;&amp;nbsp; "http:\\Sharepoint\Site1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/01/2007 10:00am&lt;/P&gt;&lt;P&gt;Domain\gkerr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http:\\sharepoint\site2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/01/2007 10:10am&lt;/P&gt;&lt;P&gt;Domain\nsmith&amp;nbsp;&amp;nbsp; http:\\sharepoint\site2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/01/2007 10:12am&lt;/P&gt;&lt;P&gt;I've spent a few hours experimenting with examples I've found online but&amp;nbsp;I haven't found exactly what I'm looking for.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Guy&lt;/P&gt;</description></item></channel></rss>