All Apps and Add-ons

Why is the Splunk DB connect app with SQLite not working?

edrivera3
Builder

I know there are multiple answers related to using DB Connector app with SQLite but none of them has provided me with a solution.
This is my configuration:

$JAVA_HOME is set to  /usr/java/jdk1.8.0_112/jre
On $SPLUNK_HOME/etc/apps/splunk_app_db_connect/bin/lib, I have the sqlite-jdbc-3.21.0.1.jar

On splunk_app_db_connect/local/db_connection_types.conf

[sqlite]
displayName = SQLite
serviceClass  = com.splunk.dbx2.DefaultDBX2JDBC
jdbcDriverClass = org.sqlite.JDBC
jdbcUrlFormat = jdbc:SQLite:<database>
ui_default_catalot = $database$

On splunk_app_db_connect/local/db_connections.conf:

[mydb]
connection_type = SQLite
database = /home/myUser/Data.db
host = localhost
identity = theBoss
jdbcUrlFormat = jdbc:SQLite:<database>
jdbcUseSSL = 0

My SQLite db file is Data.db and it's located at /home/myUser/.

So the first thing I got when I restarted the splunk app were some "Invalid key in stanza" errors.

1. Invalid key in stanza [mydb] in .... jdbcUrlFormat (value: jdbc:SQLite:<database>)
2. Invalid key in stanza [rpcstart://default]  in ... javahome (value: /user/java/jdk1.8.0_122/jre)
3. Invalid key in stanza [rpcstart:://default] in .. useSSL (value : 0)

Note that I didn't write those last two stanzas.

On the splunk server, there is no errors:
Splunk DB Connect->Configuration->Settings:

The JRE installation path is correct.
There is a JVM Option (-Ddw.server.applicationConnectors[0].port=9998)
Task server Port = 9998

Splunk DB Connect->Configuration->Drivers:

I can see the SQLite as a Driver Name, but on the Installed column shows as "NO".

On Configuration->Database:

I can see mydb as a connection which is good.

Data Lab -> SQL Explorer

If I try to select mydb as a connection, the field turns red with the "invalid database connection" message.

So this is the issue. How can I access my SQLite db from Splunk DB Connect?

Splunk DB Connect version = 3.1.1'
Linux Machine (RedHat)
java -version

Java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
0 Karma
1 Solution

edrivera3
Builder

I just found the solution. I was reading an old version of the documentaiton. 😐
The driver location was changed on the newest DB connect app to splunk_app_db_connect/drivers/.

I made a copy of the of the SQLite driver from $SPLUNK_HOME/etc/apps/splunk_app_db_connect/bin/lib to /splunk_app_db_connect/drivers/ and now it's working.

View solution in original post

0 Karma

edrivera3
Builder

I just found the solution. I was reading an old version of the documentaiton. 😐
The driver location was changed on the newest DB connect app to splunk_app_db_connect/drivers/.

I made a copy of the of the SQLite driver from $SPLUNK_HOME/etc/apps/splunk_app_db_connect/bin/lib to /splunk_app_db_connect/drivers/ and now it's working.
0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...