Getting Data In

Getting Data from Database's

harshavrath
Contributor

Hi
How to get data from database without using Splunk DBConnect.?

Any help is appreciated.

Cheers.

1 Solution

richgalloway
SplunkTrust
SplunkTrust

Before DB Connect existed, we wrote Java programs to read data from databases. Those programs are still used. The programs are launched by a shell script as a Splunk scripted input and anything the program writes to stdout is indexed by Splunk so there's no need for a text file. Of course, your program could be written in python or perl or anything you like.

Our Java programs seem to be able to handle more complex queries than DB Connect. The programs also transform some data before passing it to Splunk - something DB Connect cannot do.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Before DB Connect existed, we wrote Java programs to read data from databases. Those programs are still used. The programs are launched by a shell script as a Splunk scripted input and anything the program writes to stdout is indexed by Splunk so there's no need for a text file. Of course, your program could be written in python or perl or anything you like.

Our Java programs seem to be able to handle more complex queries than DB Connect. The programs also transform some data before passing it to Splunk - something DB Connect cannot do.

---
If this reply helps you, Karma would be appreciated.

richgalloway
SplunkTrust
SplunkTrust

Sorry, but I'm not allowed to share our code. It's pretty basic stuff, though, using standard Java SQL classes to send a query and retrieve the results.

---
If this reply helps you, Karma would be appreciated.

harshavrath
Contributor

Hi thanks for the info.
Is there any link where i can refer the java code that you are mentioning.

0 Karma

harshavrath
Contributor

You mean i need to write a script which queries the DB and saves the results into a text file which can be supplied to Splunk for indexing.

0 Karma

dart
Splunk Employee
Splunk Employee

If you don't want to use DB connect you will have to build your own scripted or modular input - essentially you would have to reimplement DB Connect.

harshavrath
Contributor

My company does not want any additional apps/software so exploring my options to access Database data in Splunk.

0 Karma

Ayn
Legend

DB Connect IS how you would get data from databases with Splunk. Can you tell us more about why you can't use it?

Get Updates on the Splunk Community!

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

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

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...

4 Ways the Splunk Community Helps You Prepare for .conf25

.conf25 is right around the corner, and whether you’re a first-time attendee or a seasoned Splunker, the ...