Freeware Custom LogParser Input - OLEDB (e.g. query Excel, Access, MS...
Last post May 17, 2010 08:56 AM by firstname.lastname@example.org
Apr 23, 2008 07:54 AM|gluegood|LINK
I've published a LogParser Custom COM plugin input format which allows you to query any OLEDB datasource and use the LogParser engine to run queries against it. Additionally allows you to query multiple datasources and I have implemented the native CheckPoint
EXE and VB.NET 2005 source from
e.g. Sample queries
REM *** Excel ***
LogParser.exe -i:COM "select * From 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\SOLVSAMP.XLS;Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1;\"'" -iProgId:Gluegood.LogParser.OLEDB -iCOMParams:iQuery="SELECT
* FROM [Quick Tour$]" -o:DataGrid
REM *** MS-SQL Multiple Connections ***
LogParser.exe -i:COM "select * From 'Provider=SQLOLEDB;Server=SQLSERVER1;Database=DB1;Trusted_Connection=yes;',
'Provider=SQLOLEDB;Server=SQLSERVER2;Database=DB2;Trusted_Connection=yes;'" -iProgId:Gluegood.LogParser.OLEDB -iCOMParams:iQuery="Select * From Table",iCheckPoint="C:\CheckPointTest2.chk" -o:DataGrid
Jul 30, 2008 09:07 AM|yellowdog.dave|LINK
Rock and roll!! Awesome plugin, thanks man. I was just playing with putting something like this together to address what I feel is one of the only shortcomings of LP when I came across your blog entry.
Jul 30, 2008 12:18 PM|joelangley|LINK
Yup, this is really sweet. What we should work on is a way fro logparser to unzip files in a log and then re-zip them after. I have a process that will zip log files from our servers and move to a central location and then I want to have logparser run through
reading and taking care of the zip part...I assume many people do this same thing and have to manually unzip!
Aug 12, 2008 09:45 AM|yellowdog.dave|LINK
Hi There GG,
I am trying to do a join between 2 tables in a datasource and I obviously need to have some comma characters in my iQuery parameter. However, logparser seems to parse these commas as additional properties to pass to your plugin.
Have you come across this and do you know of a way to work around it? Please let me know as I want to use the plugin extensively.
Thanks for a great plugin.
Sep 05, 2008 08:03 AM|gluegood|LINK
Seems like a limitation within the iQuery e.g.
LogParser.exe -i:COM "select * From 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\Northwind.mdb;'" -iProgId:Gluegood.LogParser.OLEDB -iCOMParams:iQuery="SELECT [EmployeeId],[LastName]
FROM [Employees]" -o:DataGrid
Doesn't seem to work. Putting in
[EmployeeId]\,[LastName] (LogParser thinks an additional parameter) or
[EmployeeId] \u002C [LastName] (Query isn't recognised) doesn't seem to work either.
Think I'll have to make an enhancement to the component to support replacing Unicode character (e.g. \U002C) so you
can put in commas. I'll get a compile out shortly.
Sep 05, 2008 01:38 PM|joelangley|LINK
Sep 06, 2008 03:36 AM|gluegood|LINK
New version uploaded to the original site to support unicode characters in the iQuery. Therefore can now execute in the iQuery with commas (replace
, with \u002c). e.g.
REM *** Access Single Connection with commas in iQuery ***
LogParser.exe -i:COM "select * From 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\Northwind.mdb;'" -iProgId:Gluegood.LogParser.OLEDB -iCOMParams:iQuery="SELECT [EmployeeId]\u002c[LastName]
FROM [Employees]" -o:DataGrid
Sep 06, 2008 04:31 AM|yellowdog.dave|LINK
Awesome, thanks GG. Cheers, Dave
Nov 04, 2008 12:51 PM|brinkcm|LINK
For the sake of clarity, are commas the only characters not supported? ie, if I'm parsing a log using functions to manipulate strings based on backslashes, can I use '\\' or will I need to use unicode?
May 17, 2010 08:56 AMemail@example.com|LINK
hi gluegood i have read your post.
i have an excel file with more than 5 sheets, now i want to read all those sheet data using Logparser by C# and assign the data into DataTable/Dataset, how to do that?
please guide me.