November 27, 2013 at 3:32 pm
My questions on Audit Specifications are:
Can it be setup to exclude capturing specific logins? Example we have login SA1 setup as sa but is only used for specific tasks. Can Audit specification be setup to not capture any events by SA1?
#2 - I am seeing a lot of View Server State events in our logs, this is captured under the Server_Operation_Group. Is there a way to not capture VIEW_SERVER_STATE but capture the rest of the actions?
thanks
November 29, 2013 at 2:45 pm
The syntax for CREATE SERVER AUDIT is:
[sql]
CREATE SERVER AUDIT audit_name
{
TO { [ FILE (<file_options> [ , ...n ] ) ] | APPLICATION_LOG | SECURITY_LOG }
[ WITH ( <audit_options> [ , ...n ] ) ]
[ WHERE <predicate_expression> ]
}
[/sql]
Where <predicate_expression> is
<predicate_factor>::=
event_field_name { = | < > | ! = | > | > = | < | < = } { number | ' string ' }
[/sql]
And for event_field_name, Books Online says:
Is the name of the event field that identifies the predicate source. Audit fields are described in sys.fn_get_audit_file (Transact-SQL). All fields can be audited except file_name and audit_file_offset.
That is, you should be able to filter out sa with
sessoion_server_principal_name <> 'sa2'
I'm not sure what you see when you see VIEW SERVER STATE, but the same may be possible in this cas.
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
December 2, 2013 at 11:48 am
My error - I forgot to mention that this is on SQL 2008 R2 server. BOL does not mention the WHERE <predicate_expression> for 2008 R2. I did get it to work on SQL 2012 server, with help from
The action_id is varchar(4), but has to be queried using a integer value... :w00t:
It seem like there isn't a solution for SQL 2008 R2 other than eliminating on reporting side.
Thanks for your help.
December 3, 2013 at 1:50 pm
right.
Filtering Auditing was added in SQL 2012.
Andreas
---------------------------------------------------
MVP SQL Server
Microsoft Certified Master SQL Server 2008
Microsoft Certified Solutions Master Data Platform, SQL Server 2012
www.insidesql.org/blogs/andreaswolter
www.andreas-wolter.com
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply