<?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: How to create a Splunk DB Connect 2 lookup with query parameters? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-create-a-Splunk-DB-Connect-2-lookup-with-query-parameters/m-p/207348#M22093</link>
    <description>&lt;P&gt;Hello woodcock,&lt;BR /&gt;
How to use stasts instead of join pls &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 10 Aug 2017 03:04:23 GMT</pubDate>
    <dc:creator>raghu0463</dc:creator>
    <dc:date>2017-08-10T03:04:23Z</dc:date>
    <item>
      <title>How to create a Splunk DB Connect 2 lookup with query parameters?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-create-a-Splunk-DB-Connect-2-lookup-with-query-parameters/m-p/207342#M22087</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have a table in my database that records changes to a record in my people table. I have a trigger that inserts the new data into the historical table when the record changes and timestamps it. I need to do a lookup on that table based on username and the date on the event in Splunk.&lt;/P&gt;

&lt;P&gt;I am trying to create a dblookup using DB Connect that will run a query like the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SELECT TOP 1 Meta_LogDate, FirstName, LastName, Region
FROM People_Historical
WHERE UserName = $UserName$
AND Meta_LogDate &amp;lt;= $LogDate$
ORDER BY Meta_LogDate DESC
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How can I do this with Splunk DB Connect 2? The interface does not allow me to create/add parameters to the advanced query when creating the lookup.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 20:15:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-create-a-Splunk-DB-Connect-2-lookup-with-query-parameters/m-p/207342#M22087</guid>
      <dc:creator>cmccormick</dc:creator>
      <dc:date>2015-12-22T20:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Splunk DB Connect 2 lookup with query parameters?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-create-a-Splunk-DB-Connect-2-lookup-with-query-parameters/m-p/207343#M22088</link>
      <description>&lt;P&gt;Do not use the interface; just go to &lt;CODE&gt;Settings&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;Data inputs&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;Splunk DB Connect Input Service&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;Add New&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 23:40:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-create-a-Splunk-DB-Connect-2-lookup-with-query-parameters/m-p/207343#M22088</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-12-22T23:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Splunk DB Connect 2 lookup with query parameters?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-create-a-Splunk-DB-Connect-2-lookup-with-query-parameters/m-p/207344#M22089</link>
      <description>&lt;P&gt;This does not really answer my question...&lt;/P&gt;

&lt;P&gt;I am wanting to create a DB lookup that allows me to pass in to input values to an advanced query, but I am not able to figure out how I need to format my query in Splunk. I have tried the format like I originally included and also this format.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; SELECT TOP 1 Meta_LogDate, FirstName, LastName, Region
 FROM People_Historical
 WHERE UserName = {{UserName}}
 AND Meta_LogDate &amp;lt;= {{LogDate}}
 ORDER BY Meta_LogDate DESC
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then tried to use the following search, without success.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=actionlog | lookup db_connect_HistoricalPeople UserName, LogDate OUTPUT FirstName, LastName, Region
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How would I format the query to allow me to pass the inputs from the search?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2015 21:37:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-create-a-Splunk-DB-Connect-2-lookup-with-query-parameters/m-p/207344#M22089</guid>
      <dc:creator>cmccormick</dc:creator>
      <dc:date>2015-12-23T21:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Splunk DB Connect 2 lookup with query parameters?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-create-a-Splunk-DB-Connect-2-lookup-with-query-parameters/m-p/207345#M22090</link>
      <description>&lt;P&gt;I have not used &lt;CODE&gt;dblookup&lt;/CODE&gt; but I know that &lt;CODE&gt;dbxquery&lt;/CODE&gt; (V2) is different from &lt;CODE&gt;dbquery&lt;/CODE&gt; (V1) in that you have to encode your SLQ statement ("SELECT string") so perhaps this is required for &lt;CODE&gt;dblokup&lt;/CODE&gt;, too.  Try that; I use this web tool:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://meyerweb.com/eric/tools/dencoder/"&gt;http://meyerweb.com/eric/tools/dencoder/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2016 02:19:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-create-a-Splunk-DB-Connect-2-lookup-with-query-parameters/m-p/207345#M22090</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-02-16T02:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Splunk DB Connect 2 lookup with query parameters?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-create-a-Splunk-DB-Connect-2-lookup-with-query-parameters/m-p/207346#M22091</link>
      <description>&lt;P&gt;Unfortunately, that did not work. However, I have switched to indexing the data and just using a join.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 21:40:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-create-a-Splunk-DB-Connect-2-lookup-with-query-parameters/m-p/207346#M22091</guid>
      <dc:creator>cmccormick</dc:creator>
      <dc:date>2016-04-14T21:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Splunk DB Connect 2 lookup with query parameters?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-create-a-Splunk-DB-Connect-2-lookup-with-query-parameters/m-p/207347#M22092</link>
      <description>&lt;P&gt;Always avoid using &lt;CODE&gt;join&lt;/CODE&gt; and try to use &lt;CODE&gt;stats&lt;/CODE&gt; instead.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2016 13:49:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-create-a-Splunk-DB-Connect-2-lookup-with-query-parameters/m-p/207347#M22092</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-04-26T13:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Splunk DB Connect 2 lookup with query parameters?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-create-a-Splunk-DB-Connect-2-lookup-with-query-parameters/m-p/207348#M22093</link>
      <description>&lt;P&gt;Hello woodcock,&lt;BR /&gt;
How to use stasts instead of join pls &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 03:04:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-create-a-Splunk-DB-Connect-2-lookup-with-query-parameters/m-p/207348#M22093</guid>
      <dc:creator>raghu0463</dc:creator>
      <dc:date>2017-08-10T03:04:23Z</dc:date>
    </item>
  </channel>
</rss>

