Splunk Enterprise

Get data from an MS SQL audit file using DB Connect or UF?

mikefg
Communicator

I have an MS SQL server writing audit data to a .sqlaudit file. I need to get this data into Splunk. I have DB Connect installed, but I'm not sure how to ingest the .sqlaudit file data. Do I use DB Connect or the UF?

Labels (1)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust
DB Connect is for extracting data directly from a database, much as you would use a SQL client to run queries. If you can write a query to read the .sqlfile then DBX should be able to read it, too.
As I understand it, .sqlaudit files are not text-based so they can't be onboarded as-is.
---
If this reply helps you, Karma would be appreciated.

mikefg
Communicator

Please see my reply above. The audit files are being created per Splunk instructions, but how do I get them into Splunk?

0 Karma

isoutamo
SplunkTrust
SplunkTrust

Those should be a “regular” text files, (I haven’t any MS SQL server on my hands) so just use UF as any other files.

ismo

mikefg
Communicator

Using the MS SQL addon I see this reference to audit logs 'uses the sys.fn_get_audit_file function via DB Connect.'
https://docs.splunk.com/Documentation/AddOns/released/MSSQLServer/Datatypes

SNAG-0000 6-25-2020.png

 

0 Karma

isoutamo
SplunkTrust
SplunkTrust
If I recall right there are two ways to get audit events from MS SQL. First way is that export to text file and second way is direct access / queries from DB.
R. Ismo
0 Karma

isoutamo
SplunkTrust
SplunkTrust
0 Karma

mikefg
Communicator

Thank you, I have been through this article and either I'm missing something or the article is missing something.

Following the steps to 'Create audit objects in Microsoft SQL Server for the Splunk Add-on for Microsoft SQL Server' I now have audit files being written to disk.

CREATE SERVER AUDIT MSSQL_Database_Audit TO FILE ( FILEPATH = 'C:\\SQLAudit' ) ;

 However, I do not see steps in the article for how to get the file data into Splunk.

Tags (1)
0 Karma

katrey
Engager

1. create an identity in splunk with an account that has access to SQL Server
- account will require server Control (USE master;  GRANT CONTROL SERVER TO SplunkUSER;)
2. Create a new connection using identity created in step1
3. Create a data lab and specify your Connection created in step 2.
     In the data lab you specify your query
     SELECT * FROM sys.fn_get_audit_file ('\\\<servername>\<sharename>\*.sqlaudit',null,null);

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...