All Apps and Add-ons

Splunk DB Connect Rising column not working

Navanitha
Path Finder

Hi,

I am trying to execute below sql in DB connect execute mode with collection_timestamp as my rising column but keep getting below error. This query works fine on the DB and returns some values.

SQL query
SELECT d.target_name,
collection_timestamp,
metric_label,
column_label,
key_value,
value
FROM sysman.mgmt$metric_details d,
sysman.mgmt$target t
WHERE t.timezone_region IN ('America/Chicago')
AND t.target_name = d.target_name
AND metric_name in ('tbspAllocation','memory_usage')
AND collection_timestamp >=?
ORDER BY 2,1,3,4,5

Error
Invalid Query
External search command 'dbxquery' returned error code 1. Script output = "RuntimeError: Failed to run query: "SELECT * FROM (SELECT d.target_name, collection_timestamp, metric_label, column_label, key_value, value FROM sysman.mgmt$metric_details d, sysman.mgmt$target t WHERE t.timezone_region IN ('America/Chicago') AND t.target_name = d.target_name AND metric_name in ('tbspAllocation','memory_usage') AND collection_timestamp >=? ORDER BY 2,1,3,4,5) t", params: "None", caused by: Exception(' java.sql.SQLException: Missing IN or OUT parameter at index:: 1.',). "

0 Karma

choronz
New Member

try to add ORDER BY collection_timestamp ASC

for some unknown reason, a standard structure is required for the where clause for rising column

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...