<?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 DBQUERY correlation -- How to join results from DB in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/DBQUERY-correlation-How-to-join-results-from-DB/m-p/158658#M185875</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
   I get the user_id info from web log and would like to enrich data from the connected DB in Splunk. I tried the search query below but it didn't work. Can anyone provide the right syntax?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=web_access_log | table user_id | RENAME user_id AS web_user_id [ search dbquery USER_SQL_DB "select web_user_id, user_type, user_email, user_phone from user_profile_view_all where web_user_id=$web_user_id$ "]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 25 Jul 2014 19:16:18 GMT</pubDate>
    <dc:creator>shangshin</dc:creator>
    <dc:date>2014-07-25T19:16:18Z</dc:date>
    <item>
      <title>DBQUERY correlation -- How to join results from DB</title>
      <link>https://community.splunk.com/t5/Splunk-Search/DBQUERY-correlation-How-to-join-results-from-DB/m-p/158658#M185875</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
   I get the user_id info from web log and would like to enrich data from the connected DB in Splunk. I tried the search query below but it didn't work. Can anyone provide the right syntax?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=web_access_log | table user_id | RENAME user_id AS web_user_id [ search dbquery USER_SQL_DB "select web_user_id, user_type, user_email, user_phone from user_profile_view_all where web_user_id=$web_user_id$ "]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Jul 2014 19:16:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/DBQUERY-correlation-How-to-join-results-from-DB/m-p/158658#M185875</guid>
      <dc:creator>shangshin</dc:creator>
      <dc:date>2014-07-25T19:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: DBQUERY correlation -- How to join results from DB</title>
      <link>https://community.splunk.com/t5/Splunk-Search/DBQUERY-correlation-How-to-join-results-from-DB/m-p/158659#M185876</link>
      <description>&lt;P&gt;Try this (using map command)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=web_access_log | table user_id | map maxsearches=100 search="| dbquery USER_SQL_DB \"select web_user_id, user_type, user_email, user_phone from user_profile_view_all where web_user_id=$user_id$ \""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Jul 2014 20:52:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/DBQUERY-correlation-How-to-join-results-from-DB/m-p/158659#M185876</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-25T20:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: DBQUERY correlation -- How to join results from DB</title>
      <link>https://community.splunk.com/t5/Splunk-Search/DBQUERY-correlation-How-to-join-results-from-DB/m-p/158660#M185877</link>
      <description>&lt;P&gt;Thanks for the response. I gave it a try and I can see s few events returned from the first query but no result is returned in the end. &lt;BR /&gt;
I suspect the syntax needs to be polished up.....&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jul 2014 21:10:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/DBQUERY-correlation-How-to-join-results-from-DB/m-p/158660#M185877</guid>
      <dc:creator>shangshin</dc:creator>
      <dc:date>2014-07-25T21:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: DBQUERY correlation -- How to join results from DB</title>
      <link>https://community.splunk.com/t5/Splunk-Search/DBQUERY-correlation-How-to-join-results-from-DB/m-p/158661#M185878</link>
      <description>&lt;P&gt;Define a database lookup: &lt;A href="http://docs.splunk.com/Documentation/DBX/1.1.4/DeployDBX/Setupadatabaselookuptable"&gt;http://docs.splunk.com/Documentation/DBX/1.1.4/DeployDBX/Setupadatabaselookuptable&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jul 2014 21:35:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/DBQUERY-correlation-How-to-join-results-from-DB/m-p/158661#M185878</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-25T21:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: DBQUERY correlation -- How to join results from DB</title>
      <link>https://community.splunk.com/t5/Splunk-Search/DBQUERY-correlation-How-to-join-results-from-DB/m-p/158662#M185879</link>
      <description>&lt;P&gt;It's working after adding the single quote for the variable.  Is it possible to get more than one field value from the first query in the final result e.g. url?&lt;/P&gt;

&lt;P&gt;e.g.&lt;/P&gt;

&lt;P&gt;index=web_access_log | table user_id, url | map maxsearches=100 search="| dbquery USER_SQL_DB \"select web_user_id, user_type, user_email, user_phone from user_profile_view_all where web_user_id='$user_id$' \""&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:11:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/DBQUERY-correlation-How-to-join-results-from-DB/m-p/158662#M185879</guid>
      <dc:creator>shangshin</dc:creator>
      <dc:date>2020-09-28T17:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: DBQUERY correlation -- How to join results from DB</title>
      <link>https://community.splunk.com/t5/Splunk-Search/DBQUERY-correlation-How-to-join-results-from-DB/m-p/158663#M185880</link>
      <description>&lt;P&gt;You can use any number of field names you like.&lt;/P&gt;

&lt;P&gt;Did you look at database lookups? It seems to me as if you're reimplementing those.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2014 17:22:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/DBQUERY-correlation-How-to-join-results-from-DB/m-p/158663#M185880</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-28T17:22:35Z</dc:date>
    </item>
  </channel>
</rss>

