0

I have faced with some challenge regarding my audit. I need to save my audit events on a file, but file should be in a readable format ( like txt) which will allow to analyze it out of SSMS. XXXXX.sqlaudit format does not allow this. Maybe you know options that will help to export audit events` file to readable format ? Thanks in advance.

1

SQL Server Audit logs to either a binary file or Windows Application log or Windows Security log. There are different options for reading the output depending on where you have logged to. If you are logging to a binary file you could create a simple process that reads it with sys.fn_get_audit_file and outputs to a readable textfile, eg using SSIS, use an 'Execute SQL' task to run the following SQL and pipe the output to a text file:

SELECT *
FROM sys.fn_get_audit_file ( 'X:\SQLAudit\yourAuditName_*.sqlaudit', DEFAULT, DEFAULT );

You will need some way of tracking the files you have imported/exported so a simple table would help there.

A quick google shows someone else has done something similar with Powershell here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.