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!

Using Machine Learning for Hunting Security Threats

WATCH NOW Seeing the exponential hike in global cyber threat spectrum, organizations are now striving more for ...

Observability Newsletter Highlights | March 2023

 March 2023 | Check out the latest and greatestSplunk APM's New Tag Filter ExperienceSplunk APM has updated ...

Security Newsletter Updates | March 2023

 March 2023 | Check out the latest and greatestUnify Your Security Operations with Splunk Mission Control The ...