SQL Server 2014 Extended Events – Filtering with Configuration Table

extended-eventssql server 2014

I've created E.E. session to audit logins, but there are many logins that I need to filter out.
I'm wondering, if there is a better option(like creating conf. table with unwanted logins and filter sqlserver.username using those values) than just adding them one by one via gui\script.

Best Answer

Filters along the lines of sqlserver.username IN (SELECT name FROM sometable) are not allowed.

You can use dynamic SQL to build the filter string and concatenate it to your CREATE SESSION statement. Take into account that there's a limit to the length of the list of values. I remember that because I tried the same thing some time ago, but I don't remember what the limit is.