Package and deploy a JDBC driver as an App in Splunk Cloud

It is possible to add a custom JDBC driver for a database which is not supported by DB Connect. Such a driver (bare .jar file) has to be packaged and added to Splunk as a new app. From this point on, it will become possible to create connections with the desired database and ingest data through the DB Connect app.

App structure

Once you have a custom .jar file with a driver for a specified database, create a package so it matches the following structure:

Splunk_JDBC_<driver-name>
├── default
│   └── app.conf
│   └── db_connection_types.conf
├── lib
│   └── dbxdrivers
│       └── <driver-name>.jar
│       └── <driver-name>-libs

Package must contain the following components:

  • default/app.conf: mandatory app configuration file
  • default/db_connection_types.conf: optional, contains the new connection type definition
  • lib/dbxdrivers/<driver-name>.jar: jar file with the driver
  • lib/dbxdrivers/<driver-name>-libs: to include driver dependencies, if required

App configuration

Create app.conf file with the following pattern:

[install]
state = enabled
build = 1.0.0

[launcher]
author = <string>
description = Add-on for <driver-name>
version = 1.0.0

[ui]
is_visible = false
label = Add-on for <driver-name>

[package]
id = Splunk_JDBC_<driver-name>
check_for_updates = false

[id]
name = Splunk_JDBC_<driver-name>
version = 1.0.0

[triggers]
reload.db_connection_types = simple

Note: To find out more about app.conf files and their configuration, reach relevant Splunk docs.

Defining a new connection type

In order to create a new connection type which will be visible in DB Connect UI when creating a connection, you must create db_connection_types.conf file with the following pattern:

[<connection-name>]
displayName = <display-name>
serviceClass = <string>
jdbcUrlFormat = <string>
database_engine = <db-engine>

Note: To find out more about db_connection_types.conf files, reach Splunk docs.

Further steps

Extract tar file (.tgz) from your package:

tar -czf Splunk_JDBC_<driver-name>.tgz Splunk_JDBC_<driver-name>

Install your custom App (JDBC driver) to Splunk using the Self-Service Application Install (SSAI).