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);

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...