As far back as 2001 I had been bothered by this issue and have been mulling over practical solutions but kept putting the problem back on the shelf as other projects took priority. Finally, a year or so ago I had to address this specific issue again while providing consulting to a startup here in Chicago. Due to the nature of the business, it was imperative that they have the ability to meet every possibly auditing and search need with the minimum cost. The solution had to be universal to every line of business application we employed, and work across database and server platforms. It also had to have a structure that was flexible enough to survive unaltered into the foreseeable future.
While the startup never launched, and we never got any farther than basic workflows for the applications, I finally found a solution to this conundrum when I started writing a ITILv3 support package last year.
To make it work required:
- Implementation in a relational database environment.
- No routine customization (common code for the every use for the entire implementation).
- Searchable variable metadata content.
- Needed to work seamlessly for complex transactions.
- Needed to integrate with the RAD tools I was using.
I started by determining the audit log structure. This is short synopsis of what I came up with as the base requirements:
- User Identification
- User ID
- User SID
- User Name
- Workstation ID
- HostName
- IP
- Server Information
- IP
- HostName
- Time/Date of Transaction
- Package Name
- Originating Program
- Name
- Version
- Last Update Date
- Database Platform
- Database Name
- Transaction Information
- Table Name
- Transaction Type
- Key Field Names
- Key Field Data
- Changed Field Names
- Changed Field Data
On the programming side there were several challenges:
- Writing the necessary code only once (all transactions employ the same code).
- Integrating it into the support libraries for IronSpeed
- Ensuring that proper error processing was not compromised (critical!).Writing the code in VB (IronSpeed source code libraries were provided in VB only).
Integrating this custom module was very straight forward once I waded through the reference material on how to do this with IronSpeed.
Ensuring that the proper error processing was not compromised was simply a matter of ensuring that all possible errors were addressed, even if it was with an unknown error code. No direct exits to the debugger permitted.
The most challenging aspect turned out writing the new support library in VB which is a language that I despise.
By assigning relational table fields to the relevant search fields (database ,table name, user, date/time, server, package, IP, etc), one can now do a fast search across entire platforms. This search capability could even be extended to the XML datagram for an appropriate string search (say a person's name). Once the desired dataset has been selected, a reporting program can decode the XML to display the relevant fields in a single comprehensive multi-tiered report/spreadsheet or dataset as appropriate.
One element my specific implementation lacked was recording the key element data for new records. As I was doing this in VB as opposed to TSQL, there would have been significant overhead in moving the data between the database server, webserver and back again to accomplish this. If it were done in the core stored procedures for the tables, than it would be practical to add those fields to the audit log.
If you are interested in researching this further, you can find the relevant libraries and support documentation on the IronSpeed site at:
http://sjc.ironspeed.com/search?searchid=33017161&showas=post
No comments:
Post a Comment