Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

Using LogParser from C# - Extract_Path errors

$
0
0

Hi,

I am trying to use LogParser from a C# .NET 4 console application and have it working for nearly all of what I wanted but I now need to get just a list of URLs back with a count of hits for each of them.

When I run my query through LogParser in the native command-line way then it works and I get my results, when running the SQL query through my C# app however, I get an error back as below:

Error: CLogQueryClass: Error 80f20650: Execute: error parsing query: SELECT clause: Syntax Error: unknown field 'EXTRACT_PATH(To_Lowercase(cs-uri-stem))' [ Record field does not exist. ]

My query is as below (yes, I know it is a long query)

Select STRCAT(EXTRACT_PATH(To_Lowercase(cs-uri-stem)), '/'), Count(*) From E:\IISLogs\ex121004.log where cs-uri-stem not like '%.gif' and cs-uri-stem not like '%.jpg' and cs-uri-stem not like '%.jpeg' and cs-uri-stem not like '%.class' and cs-uri-stem not like '%.css' and cs-uri-stem not like '%.inc' and cs-uri-stem not like '%.shtm' and cs-uri-stem not like '%.shtml' and cs-uri-stem not like '%.js' and cs-uri-stem not like '%css.asp' and cs-uri-stem not like '%toolbar.asp' and cs-uri-stem not like '%/!G/%' and cs-uri-stem not like '%/!G_%' and cs-uri-stem not like '%!WIP%' and cs-uri-stem not like '%default.asp' and cs-uri-stem not like '%default.htm' and cs-uri-stem not like '%.gif' and cs-uri-stem not like '%robot%' and cs-uri-stem not like '%cgi-bin%' and sc-status < 400 Group By STRCAT(EXTRACT_PATH(To_Lowercase(cs-uri-stem)), '/')


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>