<?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: Looking to see if a string is present in another search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270444#M81394</link>
    <description>&lt;P&gt;Yes, so would your &lt;CODE&gt;map&lt;/CODE&gt; search.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Oct 2015 20:48:03 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2015-10-12T20:48:03Z</dc:date>
    <item>
      <title>Looking to see if a string is present in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270440#M81390</link>
      <description>&lt;P&gt;I'm looking through DNS logs in one index.  They are normal DNS logs, so they have the normal query containing the host+domain.  I have threat data which just has the domain in another index.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=dns 
| map search="index=sec u_type=domain u_status=Active earliest=0 latest=now u_indicator=$domain$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;above is what i've come up with so far, but it doesn't seem to work.  Am I looking at this wrong?  I want to make sure that if the domain in the threat data exist at all in the dns domain data, then I get a alert.  &lt;/P&gt;

&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 19:06:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270440#M81390</guid>
      <dc:creator>wweiland</dc:creator>
      <dc:date>2015-10-12T19:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to see if a string is present in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270441#M81391</link>
      <description>&lt;P&gt;If the number of threat domains is manageable, you can do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=dns [search index=sec u_type=domain u_status=Active earliest=0 latest=now | dedup u_indicator | fields u_indicator | rename u_indicator as domain]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If the number is larger, consider moving it to a lookup.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 19:56:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270441#M81391</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-10-12T19:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to see if a string is present in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270442#M81392</link>
      <description>&lt;P&gt;When you are using map, it is better to have a deduplicated list of the values you want to map.&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=dns
| dedup domain
| table domain
| map search="index=sec u_type=domain u_status=Active earliest=0 latest=now u_indicator=$domain$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Another way you could do it would be using the &lt;CODE&gt;set&lt;/CODE&gt; command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| set intersect
[ index=main sourcetype=dns | fields - _* | fields domain]
[ index=sec u_type=domain u_status=Active | fields - _* | fields u_indicator]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which I personally find a little clearer.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Please remember - subsearches have limits - please look at sideview's answer &lt;A href="https://answers.splunk.com/answers/207150/how-to-overcome-sub-search-limitation-only-10k-rec.html"&gt;here&lt;/A&gt; for an example of using lookups.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 20:00:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270442#M81392</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2015-10-12T20:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to see if a string is present in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270443#M81393</link>
      <description>&lt;P&gt;Would this only trigger if the domain exactly matches the u_indicator?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 20:39:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270443#M81393</guid>
      <dc:creator>wweiland</dc:creator>
      <dc:date>2015-10-12T20:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to see if a string is present in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270444#M81394</link>
      <description>&lt;P&gt;Yes, so would your &lt;CODE&gt;map&lt;/CODE&gt; search.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 20:48:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270444#M81394</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-10-12T20:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to see if a string is present in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270445#M81395</link>
      <description>&lt;P&gt;Can you think of a way I can write it so that if u_indicator is in any part of domain it would trigger?  I was trying to think of how to use the if(match) but I can't seem to come up with the way.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 20:53:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270445#M81395</guid>
      <dc:creator>wweiland</dc:creator>
      <dc:date>2015-10-12T20:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to see if a string is present in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270446#M81396</link>
      <description>&lt;P&gt;Yeah, but it might be very slow:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=dns [search index=sec u_type=domain u_status=Active earliest=0 latest=now | dedup u_indicator | fields u_indicator | rename u_indicator as domain | eval domain = "*".domain."*"]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Oct 2015 21:35:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270446#M81396</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-10-12T21:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to see if a string is present in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270447#M81397</link>
      <description>&lt;P&gt;With the lookup-based approach, you can set the lookup to match using wildcards and include those asterisks in the lookup.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 21:36:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270447#M81397</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-10-12T21:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to see if a string is present in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270448#M81398</link>
      <description>&lt;P&gt;Thank you kind sir.  That works like a charm.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 21:51:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270448#M81398</guid>
      <dc:creator>wweiland</dc:creator>
      <dc:date>2015-10-12T21:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to see if a string is present in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270449#M81399</link>
      <description>&lt;P&gt;It also occurred to me that I could output the threat data to outputcsv and then do the same query against inputcsv? Can I still do the eval if I do that?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 15:27:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270449#M81399</guid>
      <dc:creator>wweiland</dc:creator>
      <dc:date>2015-10-14T15:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to see if a string is present in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270450#M81400</link>
      <description>&lt;P&gt;evals are interpreted before lookups, but if they are in separate queries, should be no problem.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 01:59:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270450#M81400</guid>
      <dc:creator>mreynov_splunk</dc:creator>
      <dc:date>2015-10-15T01:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to see if a string is present in another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270451#M81401</link>
      <description>&lt;P&gt;So the query works as written, but I ran into the problem that you suspected I would have.  Trying to compare 50k threat domains to each record with a wildcard is taking 8 mins for a 15 min period.  The only way I can think to resolve the problem would be to use a custom search command and drop it to python with dictionaries.  Problem is, I don't control the Splunk back-end and can't add custom commands easily.  Any suggestions on what I could do within native Splunk?  Would lookup tables be faster than inputcsv?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 16:18:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-see-if-a-string-is-present-in-another-search/m-p/270451#M81401</guid>
      <dc:creator>wweiland</dc:creator>
      <dc:date>2015-10-15T16:18:09Z</dc:date>
    </item>
  </channel>
</rss>

