Dashboards & Visualizations

Can I build a dashboard using data pulled from DB2 using DB Connect?

ScottMacD82
Engager

I am potentially working on building on a Splunk dashboard. It is meant to take data every day that is in a DB2 database, and put it into a dashboard. I've watched some DB Connect videos but it just shows the data as a report. If I need the data to show as data from today, yesterday, and possibly going back for a data range, would I be able to do that with Splunk/DB Connect pulling that information from DB2?

0 Karma
1 Solution

DalJeanis
Legend

Yes.

Basically, DBConnect gives you access to a data generating command called dbxquery, which can pull data from the database.

You do that with a search, that produces the data for a report.

That same search can be used to power a dashboard.

Literally any dashboard you use is running searches under the covers, sometimes many different searches. There might be a search just to populate a dropdown, another (called a base search) that sits behind the dash and provides pre-chewed data, and then little filtering searches that takes the base search and filters or aggregates it different ways for presentation.

So, first

1) Get DBConnect working to pull a small amount of data data using a fixed, simple, standard SQL query in the connect string.

2) Get it working to send that same fixed query from a dash and show the results.

3) Create a fixed token in the dash using the <set> command, add the token to the query and get the query working.

Once you've done all the above, using a simple no-nonsense query that has very little in the way of moving parts, such as...

`SELECT UserID, UserName from MyDatabase.User WHERE Userid='ABC123'`

...then you should be able to go from there to develop any dash you'd like by progressively adding features.

If you need help working it through, then get onto the Splunk Slack channel, in either the #dbconnect or #dashboard subchannel, depending on the question, and we will help you get through it.

View solution in original post

DalJeanis
Legend

Yes.

Basically, DBConnect gives you access to a data generating command called dbxquery, which can pull data from the database.

You do that with a search, that produces the data for a report.

That same search can be used to power a dashboard.

Literally any dashboard you use is running searches under the covers, sometimes many different searches. There might be a search just to populate a dropdown, another (called a base search) that sits behind the dash and provides pre-chewed data, and then little filtering searches that takes the base search and filters or aggregates it different ways for presentation.

So, first

1) Get DBConnect working to pull a small amount of data data using a fixed, simple, standard SQL query in the connect string.

2) Get it working to send that same fixed query from a dash and show the results.

3) Create a fixed token in the dash using the <set> command, add the token to the query and get the query working.

Once you've done all the above, using a simple no-nonsense query that has very little in the way of moving parts, such as...

`SELECT UserID, UserName from MyDatabase.User WHERE Userid='ABC123'`

...then you should be able to go from there to develop any dash you'd like by progressively adding features.

If you need help working it through, then get onto the Splunk Slack channel, in either the #dbconnect or #dashboard subchannel, depending on the question, and we will help you get through it.

DalJeanis
Legend

@ScottMacD82 - if your question has been answered, please click the "accept" button so that folks will know it is resolved.

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!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...