Need to access IIS stats via ajax
Can anyone recommend software that would allow me to query IIS logs for specific information via ajax? I have a site that allows members to create开发者_高级运维 pages, and I want to show them stats for each page they create. I thought about storing this info in a database, but that seems redundant since it's already being stored in my IIS log files.
I want to be able to make a query like this:
url: a regex specifying the requests I want to get info for
startdate: a start date
enddate: an end date
... and it returns XML or JSON with all the stats for my query.
I'd recommend that you write a tool to populate a database from the log files. Logging systems are normally optimised for write performance. As a result they may not write data immediately, and constant reads will affect performance. If your log files are big sequentially finding data between certain times will be slow, and you might have to search across multiple files in the event of IIS restarts etc.
It seems like you are looking to randomly query the logs so reading logs as text would be very awkward. Databases are optimised for this pattern of data access and will perform much better.
One other issue that you need to deal with would be access permissions for the log files. You are opening up access indirectly to the logs and if you have bugs an attacker could take advantage of those.
With IIS you could setup ODBC logging. This is not optimal for performance in a lot of cases but it might work out.
精彩评论