I want following output from log files,
# Report Output Like that
Total No of Mobile Device Used=?????? (Samsung, Lg, Nokia,Htc, etc )
No. of Mobile UserName= (Example user1, user2, usre3, )
Types of SMART PHONE used= (Example : Android, window 7, iso4, )
DeviceType=????
Here is what I would suggest for you to try out:
Look into using tr (man tr) to convert "?" into "&". Now you can use cut
-d "&" to extract each field. You might want to use grep (with -A and
-B) to identify certain types of responses (extracting "HTTP/1.1 200 OK"
type of messages or "Response size" type of messages). Once you have
extracted, say, all the user names, to get the correct count, pipe it
through sort and then through uniq. Use wc -l to get the number of entries.
Regarding details on extracting individual fields if they don't appear
at the same location, you can use sed or write a simple perl script
which would result in a simple final usage like:
$ cat log | extractfield.pl User | sort | uniq | wc -l
Use the same (above stated) tools to generate other fields.
Sharad
--
Mailing list guidelines and other related articles: http://lug-iitd.org/Footer