Hi there, I tried to parse the info in "cs-uri-stem",
In "cs-uri-stem" it contain a string like " /Demodir/_233_demo.gif"
I just want to parsed the "233" . So I used CharIndex.
I tested in CharIndex on SQL and it worked, but once I run it in LogParser it failed. The error message is as following:
Error: Syntax Error: <field-expr>: cannot find a vaild <field-expre>:'CHARINDEX('_',')
This is my query:
LOGPARSER -i:IISW3C "Select LogRow, time, c-ip, cs-method,cs-uri-stem,SUBSTR(cs-uri-stem, CHARINDEX('_', cs-uri-stem) + 1, (CHARINDEX('_', cs-uri-stem,CHARINDEX('_', cs-uri-stem) + 1) - CHARINDEX('_', cs-uri-stem) - 1)) as ContentId
from C:\WINDOWS\system32\Logfiles\W3SVC1\ex080725.log where cs-uri-stem Like '/DemoWeb/Images/Up/EML/%'" -o:datagrid
any suggestion is welcome.
Thanks in advanced,
---Joe