<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Splunk DB Connect: extremely long SQL query doesn't get run in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-extremely-long-SQL-query-doesn-t-get-run/m-p/92855#M182390</link>
    <description>&lt;P&gt;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:&lt;BR /&gt;
&lt;A href="http://linux.die.net/man/2/execve"&gt;http://linux.die.net/man/2/execve&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.microsoft.com/kb/830473"&gt;http://support.microsoft.com/kb/830473&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jul 2013 21:39:21 GMT</pubDate>
    <dc:creator>rroussev</dc:creator>
    <dc:date>2013-07-22T21:39:21Z</dc:date>
    <item>
      <title>Splunk DB Connect: extremely long SQL query doesn't get run</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-extremely-long-SQL-query-doesn-t-get-run/m-p/92851#M182386</link>
      <description>&lt;P&gt;Hi splunkers! I have a query which is just under 10k characters long that cannot be run through DB Connect's &lt;EM&gt;dbquery&lt;/EM&gt; command. Has anybody had any similar issues? Do you have any workarounds?&lt;/P&gt;

&lt;P&gt;-More info-&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;The DB is Oracle. When run from SQLDeveloper, the query completes in less than 1s with one or two results at most.&lt;/LI&gt;
&lt;LI&gt;The &lt;EM&gt;dbquery&lt;/EM&gt; command resides in a simpleXML form panel and it takes some parameters from the form itself. The splunk interface reports an error "PARSER: Applying intentions failed Splunkd daemon is not responding: ('The read operation timed out',)". The other panels (regular splunk searches and charts) load just fine.&lt;/LI&gt;
&lt;LI&gt;If I run the same query in the DB Connect's dbquery dashboard, it doesn't work either. &lt;/LI&gt;
&lt;LI&gt;DB Connect logs show no information about that particular query.&lt;/LI&gt;
&lt;LI&gt;DB Connect version 1.09&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Thanks, Paolo&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2013 17:17:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-extremely-long-SQL-query-doesn-t-get-run/m-p/92851#M182386</guid>
      <dc:creator>Paolo_Prigione</dc:creator>
      <dc:date>2013-07-11T17:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect: extremely long SQL query doesn't get run</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-extremely-long-SQL-query-doesn-t-get-run/m-p/92852#M182387</link>
      <description>&lt;P&gt;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?&lt;/P&gt;

&lt;P&gt;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&lt;/P&gt;

&lt;P&gt;For example if you're current query is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;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$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You could create a view in Oracle using something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;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; 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and your query string from DB Connect would become something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SELECT *
FROM   paolo_view
WHERE  t1.col4 = $dropdown1$
AND    tn.coln = $dropdown2$
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Jul 2013 14:13:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-extremely-long-SQL-query-doesn-t-get-run/m-p/92852#M182387</guid>
      <dc:creator>davebrooking</dc:creator>
      <dc:date>2013-07-17T14:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect: extremely long SQL query doesn't get run</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-extremely-long-SQL-query-doesn-t-get-run/m-p/92853#M182388</link>
      <description>&lt;P&gt;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&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2013 16:34:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-extremely-long-SQL-query-doesn-t-get-run/m-p/92853#M182388</guid>
      <dc:creator>Paolo_Prigione</dc:creator>
      <dc:date>2013-07-17T16:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect: extremely long SQL query doesn't get run</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-extremely-long-SQL-query-doesn-t-get-run/m-p/92854#M182389</link>
      <description>&lt;P&gt;Hi Paolo, In which of the SQL clauses do you pass in parameters using the Splunk $field$ syntax?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 08:11:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-extremely-long-SQL-query-doesn-t-get-run/m-p/92854#M182389</guid>
      <dc:creator>JovanMilosevic</dc:creator>
      <dc:date>2013-07-18T08:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect: extremely long SQL query doesn't get run</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-extremely-long-SQL-query-doesn-t-get-run/m-p/92855#M182390</link>
      <description>&lt;P&gt;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:&lt;BR /&gt;
&lt;A href="http://linux.die.net/man/2/execve"&gt;http://linux.die.net/man/2/execve&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.microsoft.com/kb/830473"&gt;http://support.microsoft.com/kb/830473&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2013 21:39:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-extremely-long-SQL-query-doesn-t-get-run/m-p/92855#M182390</guid>
      <dc:creator>rroussev</dc:creator>
      <dc:date>2013-07-22T21:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect: extremely long SQL query doesn't get run</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-extremely-long-SQL-query-doesn-t-get-run/m-p/92856#M182391</link>
      <description>&lt;P&gt;HI Paolo, I am having a very similar situation over here, any work around for this issue ? &lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 02:41:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-extremely-long-SQL-query-doesn-t-get-run/m-p/92856#M182391</guid>
      <dc:creator>ryantzj</dc:creator>
      <dc:date>2015-06-23T02:41:03Z</dc:date>
    </item>
  </channel>
</rss>

