<?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: Use subsearch results for dbquery in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135769#M184727</link>
    <description>&lt;P&gt;Martins Answer below is the better long term answer.  setting up a lookup will allow me to use the lookup over and over again.&lt;/P&gt;

&lt;P&gt;I chose this answer because it was easy to setup rather than modifying and implementing a database lookup.&lt;/P&gt;

&lt;P&gt;I will use the answer below just not right now.&lt;/P&gt;</description>
    <pubDate>Fri, 18 Apr 2014 16:54:08 GMT</pubDate>
    <dc:creator>hartfoml</dc:creator>
    <dc:date>2014-04-18T16:54:08Z</dc:date>
    <item>
      <title>Use subsearch results for dbquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135761#M184719</link>
      <description>&lt;P&gt;I have a subsearch that finds destination IP's like this&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[search sourcetype=ids sid=xxxx | dedup dst | table dst]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I want to use my local vulnerability scanner database to id the system using the query with the "dst" as the "IPAddressStr"&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| dbquery "SQL" "SELECT IPAddressStr, NBName FROM Assets where ipAddressStr LIKE '$dst$'"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2014 21:07:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135761#M184719</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2014-04-17T21:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Use subsearch results for dbquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135762#M184720</link>
      <description>&lt;P&gt;| dbquery "SQL" "SELECT IPAddressStr, NBName FROM Assets"|where [search sourcetype=ids sid=xxxx | dedup dst | table dst|rename dst as IPAddressStr]&lt;/P&gt;

&lt;P&gt;this will work&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2014 21:44:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135762#M184720</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-04-17T21:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Use subsearch results for dbquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135763#M184721</link>
      <description>&lt;P&gt;Depending on the size of the Assets table that'll be catastrophically slow.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2014 12:50:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135763#M184721</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-04-18T12:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Use subsearch results for dbquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135764#M184722</link>
      <description>&lt;P&gt;Have you considered switching to a database-backed lookup? Then you'd run your ids search and the lookup would add the additional fields to that search automagically.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2014 12:51:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135764#M184722</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-04-18T12:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Use subsearch results for dbquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135765#M184723</link>
      <description>&lt;P&gt;The table is not that big and there is a join as well.  the search only takes about 10 seconds Thanks Linu and Martin can you offer an example of the lookup suggestion above&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2014 13:56:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135765#M184723</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2014-04-18T13:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Use subsearch results for dbquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135766#M184724</link>
      <description>&lt;P&gt;Martin,&lt;/P&gt;

&lt;P&gt;This is a great suggestion and while the answer below works, (thank you very much Linu it works great), it may not be as flexible as your suggestion.&lt;/P&gt;

&lt;P&gt;Can you maybe give an example of the syntax as an answer rather than a comment so I can try it, and if it works better, then I can use it as the answer for this question?&lt;/P&gt;

&lt;P&gt;Thanks Mike H.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2014 13:56:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135766#M184724</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2014-04-18T13:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Use subsearch results for dbquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135767#M184725</link>
      <description>&lt;P&gt;Set up a DB lookup as per this: &lt;A href="http://docs.splunk.com/Documentation/DBX/latest/DeployDBX/Setupadatabaselookuptable"&gt;http://docs.splunk.com/Documentation/DBX/latest/DeployDBX/Setupadatabaselookuptable&lt;/A&gt;&lt;BR /&gt;
Run your search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=ids sid=xxxx | dedup dst | table dst | lookup local=1 your_table ipAddressStr as dst OUTPUT NBName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can define that as an automatic lookup if you're not in a distributed environment.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2014 16:09:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135767#M184725</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-04-18T16:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Use subsearch results for dbquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135768#M184726</link>
      <description>&lt;P&gt;Thanks Martin,&lt;/P&gt;

&lt;P&gt;This is good stuff!!!&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2014 16:51:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135768#M184726</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2014-04-18T16:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Use subsearch results for dbquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135769#M184727</link>
      <description>&lt;P&gt;Martins Answer below is the better long term answer.  setting up a lookup will allow me to use the lookup over and over again.&lt;/P&gt;

&lt;P&gt;I chose this answer because it was easy to setup rather than modifying and implementing a database lookup.&lt;/P&gt;

&lt;P&gt;I will use the answer below just not right now.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2014 16:54:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-results-for-dbquery/m-p/135769#M184727</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2014-04-18T16:54:08Z</dc:date>
    </item>
  </channel>
</rss>

