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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...