Dashboards & Visualizations

Using dbquery in dashboard forms - help

ericrobinson
Path Finder

Hello, I am seeing an issue where I cannot see results when trying to use dbquery in a dashboard. It as pre-pending a "search" onto the search and its not finding any results.

My search normally is this and returns results..

| dbquery "Database - PROD" limit=1000 "SELECT A.ASET_AMT, A.ID_C FROM ASAP.test A WHERE a.aset_test_id_c = (SELECT A.ASET_test_ID_C FROM ASAP.ACCOUNT A WHERE A.TEST_INSTN_ID_N=$testid$)"<!-- AND a.test_dt_d="$end_date$" -->

The form is giving this..

search dbquery "Database - PROD" limit=1000 "SELECT A.ASET_AMT, A.ID_C FROM ASAP.test A WHERE a.aset_test_id_c = (SELECT A.ASET_test_ID_C FROM ASAP.ACCOUNT A WHERE A.TEST_INSTN_ID_N=$testid$)"<!-- AND a.test_dt_d="$end_date$" -->

and that is NOT returning results.

Is there a preferred way to use dbquery in these forms?

Tags (2)
0 Karma
1 Solution

ericrobinson
Path Finder

I think I figured this out.. problem was with not using the CDATA tags, and the leading space.

View solution in original post

0 Karma

ericrobinson
Path Finder

I think I figured this out.. problem was with not using the CDATA tags, and the leading space.

0 Karma

sowings
Splunk Employee
Splunk Employee

Can your provide a sample of what you were able to get working? I'm facing a similar issue using one of those "must be the first command after a pipe" search commands in a searchTemplate in a dashboard.

0 Karma

ericrobinson
Path Finder

It looks like its not because of the extra "search" search string.. Instead, it looks like it is missing the pipe in the searchtemplate in the form, and therefore the dbquery command is not working as its not recognized as a command

Any idea on how to make the | stick and continue to the underlying search being run?

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...