All Apps and Add-ons

Splunk DB Connect Rising column not working

Navanitha
Explorer

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!

Platform Newsletter Highlights | March 2023

 March 2023 | Check out the latest and greatestIntroducing Splunk Edge Processor, simplified data ...

Enterprise Security Content Updates (ESCU) - New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 3 releases of new content via the Enterprise ...

Thought Leaders are Validating Your Hard Work and Training Rigor

As a Splunk enthusiast and member of the Splunk Community, you are one of thousands who recognize the value of ...