1

Anyone know how to obtain the SessionID/ASPNET_SESSIONID using a LogParser query? FYI, the site I'm querying uses SSL. Currently, my query is

SELECT * FROM 'C:\inetpub\logs\LogFiles\W3SVC6\*.log'
where cs-uri-stem like '%.doc' OR cs-uri-stem like '%.docx' AND date >= '2012-07-01'

1 Answer 1

1

How about this:

SELECT 
 EXTRACT_VALUE(REPLACE_str(cs(Cookie),';+','&'), 'ASP.NET_SessionId', '&') AS Cky,
 <other_column_names> 
FROM 'C:\inetpub\logs\LogFiles\W3SVC6\*.log'
WHERE cs-uri-stem like '%.doc' OR cs-uri-stem LIKE'%.docx' AND date >= '2012-07-01'

Unlike SQL, You have to specify the columns you're interested in explicitly instead of adding a * column wildcard (i.e. the <other_column_names> placeholder in the query above).

You also need to make sure that IIS is configured to log cookies as well in your logging settings (assuming you're using the W3C logging format):

enter image description here

1
  • Thanks @kev! My issue is that I didn't have Cookie as a selected field. Jul 27, 2012 at 2:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .