All Apps and Add-ons

Database Inputs - Importing Data from SQL to Splunk problem

Vijaikanth
Path Finder

I have three columns in my SQL table "tblAudit"

Id SQL query ExecutedTime
1 select * from xxx where x= y Jan 1, 2016
2 Insert table xxx (select ....) Jan 30, 2016
3 Delete table.. Create trigger Jan 31, 2016

Now i need to input these details to splunk. Now Database Inputs >> Dump >> Specify SQL query >> Select * from tblAudit >> Save

Instead of 3 events there are 10 events displaying in Splunk and the problem is due to the column "SQL Query". It split the events somehow not sure if it is due to sql keywords and make it as 10 events. If the column "SQL Query" was not included in dump, it return exact 3 events. What is the problem here?

Tat column "SQL Query" is nVarchar(4000) in sql server.

0 Karma
1 Solution

Vijaikanth
Path Finder

In my case, Splunk Split one event into multiple events because of the following parameter in props.conf

LINE_BREAKER = (\r\n)

So i removed the "\r\n" combination in the sql column by executing the below query in SQL table

/** Remove Carriage return and Line Feed **/
UPDATE ProblemTable
SET ProblemColumn = REPLACE(ProblemColumn, char(13), ' ' )

UPDATE ProblemTable
SET ProblemColumn = REPLACE(ProblemColumn, char(10), ' ' )

After corrected the SQL server column values, Splunk not created any multi level events and data loaded correctly.

View solution in original post

0 Karma

Vijaikanth
Path Finder

In my case, Splunk Split one event into multiple events because of the following parameter in props.conf

LINE_BREAKER = (\r\n)

So i removed the "\r\n" combination in the sql column by executing the below query in SQL table

/** Remove Carriage return and Line Feed **/
UPDATE ProblemTable
SET ProblemColumn = REPLACE(ProblemColumn, char(13), ' ' )

UPDATE ProblemTable
SET ProblemColumn = REPLACE(ProblemColumn, char(10), ' ' )

After corrected the SQL server column values, Splunk not created any multi level events and data loaded correctly.

0 Karma

Vijaikanth
Path Finder

Sample SQL Query Failing :
select * from xx s inner join xy d on s.id = d.id where s.code = 'Y' and s.desc = 'N' and s.total = 2 order by d.date desc

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Your Feedback. Our Roadmap. Visit the PX Feedback Booth at .conf26

You use Splunk every day, come and help shape what's next.  Save Your Seat: Product-Focused Sessions at ...

Agentic SOC Triage: Investigating Splunk ES Notables with MCP Server and a Local LLM

The Problem: Too Many Alerts, Too Little Context Security operations teams running Splunk Enterprise Security ...

Painting a Clearer Picture: Creating Cross-Domain Visibility with AI Canvas

Watch Now Painting a Clearer Picture: Creating Cross-Domain Visibility with AI Canvas     Do you ever feel ...