Search code examples
parsinglogginglogparser

logparser extra argument when selecting from file


I have the following query which i try to run into CMD :

logparser "\"select URLUNESCAPE(EXTRACT_VALUE(SUBSTR(SUBSTR(Request, 0, INDEX_OF(Request, ' HTTP/')), ADD( INDEX_OF(Request, '?'),1) ), 'name')) as name into stagingtable from D:\\work\\FilesForLoading\\logfile.log"\" -i:ncsa -o:SQL
-server:exampleServerName -database:exampleDbName -driver:\"SQL Server\" -e:100

But I am getting the bellow error

Error: detected extra argument "Server"" after query

What am I doing wrong here?

I also tryied like this:

logparser "select URLUNESCAPE(EXTRACT_VALUE(SUBSTR(SUBSTR(Request, 0, INDEX_OF(Request, ' HTTP/')), ADD( INDEX_OF(Request, '?'),1) ), 'name')) as name into stagingtable from D:\\work\\FilesForLoading\\logfile.log" -i:ncsa -o:SQL
-server:exampleServerName -database:exampleDbName -driver:\"SQL Server\" -e:100

I get the same error.


Solution

  • It is fixed. The correct way is to use -driver:"SQL Server". Basically it is not escaped by the \ character