DATA Step, Macro, Functions and more

how do I analyze web access logs

Reply
Occasional Contributor
Posts: 10

how do I analyze web access logs

We have some web logs that we need to analyze for site traffic. I know I could write some DATA step code to parse through these logs and pick out relevant data, but I'm sure there must be some code or macros that can do this already. An example of the raw log data is below:

127.0.0.1 - - [13/Dec/2017:12:40:19 +0000] "GET /index.action HTTP/1.1" 401 58
127.0.0.1 - - [13/Dec/2017:12:40:24 +0000] "GET /login.action HTTP/1.1" 401 58
127.0.0.1 - - [13/Dec/2017:12:40:30 +0000] "GET /struts2-showcase/person/editPerson.action HTTP/1.1" 404 1033
127.0.0.1 - - [13/Dec/2017:12:40:36 +0000] "GET /struts2-showcase/showcase.action HTTP/1.1" 404 1015
127.0.0.1 - - [13/Dec/2017:12:40:41 +0000] "GET /struts-cookbook/processSimple.do HTTP/1.1" 404 1015
127.0.0.1 - - [13/Dec/2017:12:40:47 +0000] "GET /portal/client/cms/viewcmspage.action HTTP/1.1" 404 1023
127.0.0.1 - - [13/Dec/2017:12:40:53 +0000] "GET /admin/agent/default.action HTTP/1.1" 404 1003
127.0.0.1 - - [13/Dec/2017:12:40:58 +0000] "GET /index.do HTTP/1.1" 401 58
127.0.0.1 - - [13/Dec/2017:12:41:04 +0000] "GET /Dashboard.action HTTP/1.1" 401 58

Respected Advisor
Posts: 4,741

Re: how do I analyze web access logs

[ Edited ]

If it's SAS Logs then the SAS Environment Manager provides quite a bit for such tasks.

 

For other logs: I agree with you that this is a problem which people must have solved already but whenever I actually need something specific I end up not finding anything pre-fabricated where amending the code for my specific use case wouldn't take me as long as writing new (and much simpler) code from scratch.

 

Looking at the log layout you've posted: That's so nicely structured that it shouldn't be too hard to parse out what you need.

Ask a Question
Discussion stats
  • 1 reply
  • 55 views
  • 0 likes
  • 2 in conversation