<?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 SQL query with variables in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-SQL-query-with-variables/m-p/329205#M97992</link>
    <description>&lt;P&gt;DBX3 currently does not support using variables within a DB input statement. You can use parameters for things such as rising columns. &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/DBX/3.1.3/DeployDBX/Createandmanagedatabaseinputs"&gt;http://docs.splunk.com/Documentation/DBX/3.1.3/DeployDBX/Createandmanagedatabaseinputs&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Basically, you would likely need to create a view if it is possible for the query you are attempting. &lt;/P&gt;</description>
    <pubDate>Thu, 12 Apr 2018 15:41:36 GMT</pubDate>
    <dc:creator>amahoski</dc:creator>
    <dc:date>2018-04-12T15:41:36Z</dc:date>
    <item>
      <title>Splunk DB Connect SQL query with variables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-SQL-query-with-variables/m-p/329204#M97991</link>
      <description>&lt;P&gt;Hi, I am trying to make a Data Lab Input for Splunk DB Connect using the followng query:&lt;/P&gt;

&lt;P&gt;declare @cntr_value_1 numeric(20,3)&lt;BR /&gt;
declare @cntr_value_2 numeric(20,3)&lt;BR /&gt;
declare @delay_time varchar(12)&lt;BR /&gt;
set @delay_time = right(convert(varchar(30),dateadd(second,1,0),121),12)&lt;BR /&gt;
select @cntr_value_1 = cntr_value&lt;BR /&gt;
from [master].[dbo].[sysperfinfo]&lt;BR /&gt;
where counter_name = 'Page reads/sec'&lt;BR /&gt;
waitfor delay @delay_time&lt;BR /&gt;
select @cntr_value_2 = cntr_value&lt;BR /&gt;
from [master].[dbo].[sysperfinfo]&lt;BR /&gt;
where counter_name = 'Page reads/sec'&lt;BR /&gt;
SELECT convert(numeric(20,1),round((@cntr_value_2-@cntr_value_1)/1,3)) AS DB_VALUE&lt;/P&gt;

&lt;P&gt;The query executes fine, but when I want to save the Input, the following message appears:&lt;BR /&gt;
There was an error processing your request. It has been logged (ID 13fb315b3ef49ffd).&lt;/P&gt;

&lt;P&gt;I wonder if the problem are the variables.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:59:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-SQL-query-with-variables/m-p/329204#M97991</guid>
      <dc:creator>efn</dc:creator>
      <dc:date>2020-09-29T18:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect SQL query with variables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-SQL-query-with-variables/m-p/329205#M97992</link>
      <description>&lt;P&gt;DBX3 currently does not support using variables within a DB input statement. You can use parameters for things such as rising columns. &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/DBX/3.1.3/DeployDBX/Createandmanagedatabaseinputs"&gt;http://docs.splunk.com/Documentation/DBX/3.1.3/DeployDBX/Createandmanagedatabaseinputs&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Basically, you would likely need to create a view if it is possible for the query you are attempting. &lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 15:41:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-SQL-query-with-variables/m-p/329205#M97992</guid>
      <dc:creator>amahoski</dc:creator>
      <dc:date>2018-04-12T15:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect SQL query with variables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-SQL-query-with-variables/m-p/329206#M97993</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Why it does not support? How can i use db lookup query with variables? Need install oldest db connect (v1) or maybe have workaround?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 08:14:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-SQL-query-with-variables/m-p/329206#M97993</guid>
      <dc:creator>dgelo</dc:creator>
      <dc:date>2018-12-20T08:14:46Z</dc:date>
    </item>
  </channel>
</rss>

