<?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: What is the best way to compare search results to multiple lookup tables and identify which ones return hits? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132164#M7802</link>
    <description>&lt;P&gt;Yes, it might be, but there's no need to run a lookup after the search which might balance things &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Nov 2014 23:26:32 GMT</pubDate>
    <dc:creator>musskopf</dc:creator>
    <dc:date>2014-11-25T23:26:32Z</dc:date>
    <item>
      <title>What is the best way to compare search results to multiple lookup tables and identify which ones return hits?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132160#M7798</link>
      <description>&lt;P&gt;Here's what I'm trying to do:  I have multiple lists of bad IPs, each from a different source, each set up as a lookup.  Two are automatically updated and one is manually updated.  The lists are stored in files called badip1.csv, badip2.csv and badip3.csv.  I have a dashboard that shows if any of the IPs were found, but I'm not sure if this is the most efficient method.  &lt;/P&gt;

&lt;P&gt;Here is the search that creates the dashboard:&lt;/P&gt;

&lt;P&gt;sourcetype=IPS [inputlookup additionalbadips | fields src] OR [inputlookup malwareips | fields src]  | table source_host,source_address&lt;/P&gt;

&lt;P&gt;Is there a more efficient search?&lt;/P&gt;

&lt;P&gt;As a bonus, it would be nice for the results to show which lookup found which IP.                         &lt;/P&gt;

&lt;P&gt;Thoughts, suggestions?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:14:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132160#M7798</guid>
      <dc:creator>reswob4</dc:creator>
      <dc:date>2020-09-28T18:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to compare search results to multiple lookup tables and identify which ones return hits?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132161#M7799</link>
      <description>&lt;P&gt;That's a pretty efficient way of doing that, as long as you're not breaking the search with millions of bad IPs.&lt;/P&gt;

&lt;P&gt;As for listing where it came from, you could apply each lookup after the search and add a field to the data. That field has to exist in your lookup, so for example you would have this in one file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;src      lookup
1.2.3.4  additionalbadips
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And in the other file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;src      lookup
2.3.4.5  malwareips
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After adding the lookups to the search regularly you should see a field "lookup" filled appropriately.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2014 22:48:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132161#M7799</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-11-25T22:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to compare search results to multiple lookup tables and identify which ones return hits?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132162#M7800</link>
      <description>&lt;P&gt;Another option is to split your search and use &lt;CODE&gt;append&lt;/CODE&gt;. Something like that:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=IPS [inputlookup additionalbadips | fields src] | eval lookup="BadIP" |
append [
 search sourcetype=IPS [inputlookup malwareips | fields src] | eval lookup="Malware"
 ]
| table source_host,source_address, type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2014 23:01:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132162#M7800</guid>
      <dc:creator>musskopf</dc:creator>
      <dc:date>2014-11-25T23:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to compare search results to multiple lookup tables and identify which ones return hits?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132163#M7801</link>
      <description>&lt;P&gt;That should be much slower than one large search though.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2014 23:12:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132163#M7801</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-11-25T23:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to compare search results to multiple lookup tables and identify which ones return hits?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132164#M7802</link>
      <description>&lt;P&gt;Yes, it might be, but there's no need to run a lookup after the search which might balance things &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2014 23:26:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132164#M7802</guid>
      <dc:creator>musskopf</dc:creator>
      <dc:date>2014-11-25T23:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to compare search results to multiple lookup tables and identify which ones return hits?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132165#M7803</link>
      <description>&lt;P&gt;The lookup at the end will be a very quick in-memory operation. &lt;EM&gt;Much&lt;/EM&gt; quicker than going through all the buckets multiple times on disk.&lt;/P&gt;

&lt;P&gt;Also doesn't throw up duplicates and isn't constrained by subsearch size limits...&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2014 23:33:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132165#M7803</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-11-25T23:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to compare search results to multiple lookup tables and identify which ones return hits?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132166#M7804</link>
      <description>&lt;P&gt;This is the one I got to work (note that I changed eval lookup to eval Badlist and the table column from type to Badlist):&lt;/P&gt;

&lt;P&gt;sourcetype=IPS [inputlookup additionalbadips | fields src] | eval Badlist="BadIP" |&lt;BR /&gt;
append [&lt;BR /&gt;
search sourcetype=IPS [inputlookup malwareips | fields src] | eval Badlist="BadIP"&lt;BR /&gt;
]&lt;BR /&gt;
| table source_host,source_address,Badlist&lt;/P&gt;

&lt;P&gt;I could not get the right syntax for martin_mueller's suggestion to function.&lt;/P&gt;

&lt;P&gt;I tried:&lt;/P&gt;

&lt;P&gt;sourcetype=IPS [inputlookup additionalbadips | fields src | eval Badlist="BadIP" ] OR [inputlookup malwareips | fields src | eval Badlist="BadIP"] | table source_host,source_address,Badlist&lt;/P&gt;

&lt;P&gt;and&lt;/P&gt;

&lt;P&gt;and sourcetype=IPS [inputlookup additionalbadips | fields src ] | eval Badlist="BadIP"  OR  [inputlookup malwareips | fields src ]| eval Badlist="BadIP" | table source_host,source_address,Badlist&lt;/P&gt;

&lt;P&gt;but the first did not return any results and the second gave me an error (Error in 'eval' command: Typechecking failed. 'OR' only takes boolean arguments.)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:15:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132166#M7804</guid>
      <dc:creator>reswob4</dc:creator>
      <dc:date>2020-09-28T18:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to compare search results to multiple lookup tables and identify which ones return hits?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132167#M7805</link>
      <description>&lt;P&gt;By setting the &lt;CODE&gt;Badlist&lt;/CODE&gt; field within the subsearch you're effectively filtering for events with that field.&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  sourcetype=IPS [inputlookup additionalbadips | fields src] OR [inputlookup malwareips | fields src]
| lookup additionalbadips src OUTPUT lookup_name | lookup malwareips src OUTPUT lookup_name
| table source_host,source_address,lookup_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That's assuming the lookups contain a column called &lt;CODE&gt;lookup_name&lt;/CODE&gt; that identifies the name of the lookup you want to see in your results.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Nov 2014 20:34:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132167#M7805</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-11-26T20:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to compare search results to multiple lookup tables and identify which ones return hits?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132168#M7806</link>
      <description>&lt;P&gt;So it turns out I needed to combine the answers of @martin_mueller and @musskopf  for this to work. Using OR caused the search to run VERY slow. And piping the result of each search into a lookup got the info I wanted.&lt;/P&gt;

&lt;P&gt;example below:&lt;/P&gt;

&lt;P&gt;lookup#1&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Domain, thislist &lt;BR /&gt;
test.com,baddomainlist1 &lt;BR /&gt;
test2.com,baddomainlist2&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;lookup#2&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Domain, thislist &lt;BR /&gt;
anothertest.com,baddomainlist3 &lt;BR /&gt;
anothertest1.com,baddomainlist4&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Update your transforms.conf and props.conf as appropriate&lt;/P&gt;

&lt;P&gt;Then perform your search.  For example if user1 at 10.10.10.10  has made an DNS query to anothertest.com and user2 at 192.168.0.0 has made a DNS query to test.com the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=WinDNS [inputlookup additionalbaddomains | fields Domain ] | lookup additionalbaddomains Domain output thislist | append [ search sourcetype=WinDNS [inputlookup malwaredomains | fields Domain] | lookup malwaredomains Domain output thislist ] |table Domain,source_address,thislist  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Produces the following table:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Domain                                         source_address                                    thislist
anothertest.com                                10.10.10.10                                       baddomainlist3
test.com                                       192.168.0.0                                      baddomainlist1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is the point of this:&lt;/P&gt;

&lt;P&gt;Say you have multiple sources from which you collect malicious domains or IPs.  When you create your lookup tables, for each malicious domain/ip that you enter, put the source from where you go it.  This way, when you get a hit against a bad domain or bad IP, you can refer back to the source to get more information about why that domain/ip was bad and figure out what other actions you should take.&lt;/P&gt;

&lt;P&gt;We noticed that we were getting hits against an IP or domain labeled as BAD but no idea WHY because the reason it was put as an alert was lost.  By being able to refer to the source, we could now find out if the IP or domain was bad because it's part of a botnet or spearphish or whatever and take specific actions.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jan 2015 20:41:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/What-is-the-best-way-to-compare-search-results-to-multiple/m-p/132168#M7806</guid>
      <dc:creator>reswob4</dc:creator>
      <dc:date>2015-01-27T20:41:52Z</dc:date>
    </item>
  </channel>
</rss>

