tags:

views:

987

answers:

1

I'm trying to find LONG UserAgent strings with LogParser.exe in my IIS logs. This example searches for entries with the string 'poo' in them.

LogParser.exe -i:IISW3C 
"SELECT COUNT(cs(User-Agent)) AS Client 
FROM *.log WHERE cs(User-Agent) LIKE '%poo%'"

I'm trying to say "How many entries have a User-Agent that is longer than 'x'".

+33  A: 

Well, looks like I answered my own question.

LogParser.exe -i:IISW3C 
"SELECT COUNT(cs(User-Agent)) AS Client 
FROM *.log WHERE STRLEN(cs(User-Agent)) > 100"
Scott Hanselman
Can't vote for me! EPIC FAIL! ;)
Scott Hanselman
LOL! I'll vote for you Scott! :D
Rob Cooper
Thanks! Now the REAL question is, WHO accepts MY answer?
Scott Hanselman
No one can, you just get the +points for the upvotes, you can close the question (not allowing more answers), but that freezes voting..
Rob Cooper
That's lame. It'll never turn green.Hey, how did you know I added comment? Is CTRL-F5 the way "notifications" work in this world?
Scott Hanselman
Yup, refresh is the key :) I don't know if we will ever get a good "subscribe" feature :( This post has inspired me for more content for my next SO post though. Thanks :)
Rob Cooper
Heh. I think I'm just going to hang out inside this tiny comment box. This is my new HanselIRC.
Scott Hanselman
LOL! Do you not find it annoying having to keep clicking "show" though? Although it is pretty cool seeing your votes go up..
Rob Cooper
I dunno...the REAL test for SO will be if and when they start dominating all Google results. I also am concerned about their database fragmentation, and I predict we'll see REAL problems with that and SQL Page size soon.
Scott Hanselman
Agreed, only time will tell I guess. IMO there is still also tons of work to be done on fundamental parts of the site.. Especially with regards to moderation.. But, I am just a humble user :)
Rob Cooper
hehe... this is another way to use SO... Public IM! ;)
Adhip Gupta
Yes! Although, this refresh this is troublesome. ;) Also, the font is VERY small on Google Crome.
Scott Hanselman
Oh you need to change your default font, its under the spanner somewhere :D SO, you think with the chat we can make Mr Hanselman's first question on SO a "Hot" topic? :D Hell if we talk long enough you will get a nice badge :)
Rob Cooper
http://stackoverflow.com/badges/28/famous-question - There it is people, thats what we want to win for Scott :D
Rob Cooper
Apparently I'd just got a COMMENTATOR badge for talking to myself.
Scott Hanselman
Oh crap yeah, I dont think you would get the famous question goldie (currently awarded to someone IMO should not have it) because you made the question "community editable".. Silly Scott! Still, talking to yourself has never been so rewarding right? :D
Rob Cooper
Scott, this is a cheap shot to get rep ;-) As if you don't have enough rep as is? :P
Jonas Follesø
What are you talking about Jonas?! I never even knew who Scott was until I saw this question! :p :D
Rob Cooper
This comment section could end up being a good stress-test. How many comments before the "Show Comments" call dies?
Mark Biek
Do I want REP? What can I buy with REP? ;)
Scott Hanselman