Hi splunkers! I have a query which is just under 10k characters long that cannot be run through DB Connect's dbquery command. Has anybody had any similar issues? Do you have any workarounds?
-More info-
Thanks, Paolo
HI Paolo, I am having a very similar situation over here, any work around for this issue ?
The limit is highly dependent on the operating system type and version. As currently the query is passed as an argument, it is governed by the OS limitations of the particular platform, for example:
http://linux.die.net/man/2/execve
http://support.microsoft.com/kb/830473
Do you think it's an issue with the length of the query string? Or could it be the query just takes too long to run? How long does it take to run when executed directly against the Oracle DB, i.e. taking Splunk and DB Connect out of the equation?
If you think it's an issue with the length of the search string and your DBAs will allow you to create a view in the database, then I believe you could move most, if not all, of the static portion of your query into the view and reduce the length of the query your passing via DB Connect. However without any understanding of your actual query I may be totally wrong
For example if you're current query is
SELECT t1.col1,
t1.col1...,
t2.col1,
...,
tn.coln
FROM tab1 t1
INNER JOIN
tab2 t2 ON t1.col1 = t2.col1
LEFT OUTER JOIN
...
tabn tn ON t1.coln = tn.col1
WHERE t1.col1 = tn.col5
AND t1.col4 = $dropdown1$
AND tn.coln = $dropdown2$
You could create a view in Oracle using something like
CREATE VIEW paolo_view AS
SELECT t1.col1,
t1.col1...,
t2.col1,
...,
tn.coln
FROM tab1 t1
INNER JOIN
tab2 t2 ON t1.col1 = t2.col1
LEFT OUTER JOIN
...
tabn tn ON t1.coln = tn.col1
WHERE t1.col1 = tn.col5;
and your query string from DB Connect would become something like
SELECT *
FROM paolo_view
WHERE t1.col4 = $dropdown1$
AND tn.coln = $dropdown2$
Hi Paolo, In which of the SQL clauses do you pass in parameters using the Splunk $field$ syntax?
Hi Dave, I believe it is an issue of query length (in characters): when run on a regular SQL client it executes in less than 1 second. I have thought to create a view but the approach is not possible as the query is actually a lookup (I pass in parameters using Splunk's $field$ synstax). Other, shorter, queries run just fine on the same DB. Thanks