Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 0 down vote accepted

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

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
add comment

Your Answer

 
discard

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.