Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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'
share|improve this question
up vote 0 down vote accepted

How about this:

 EXTRACT_VALUE(REPLACE_str(cs(Cookie),';+','&'), 'ASP.NET_SessionId', '&') AS Cky,
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

share|improve this answer
Thanks @kev! My issue is that I didn't have Cookie as a selected field. – chuckdfoster Jul 27 '12 at 2:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.