<?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 enhance the search results of events that match a lookup.csv? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446410#M126645</link>
    <description>&lt;P&gt;in other words we wanted the ioc domain pattern match to dynamically output and populate a field called "match" &lt;/P&gt;</description>
    <pubDate>Wed, 27 Mar 2019 15:01:48 GMT</pubDate>
    <dc:creator>Log_wrangler</dc:creator>
    <dc:date>2019-03-27T15:01:48Z</dc:date>
    <item>
      <title>How to enhance the search results of events that match a lookup.csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446403#M126638</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a query that produces the results I want but now I need to add some extra fields to the events.&lt;/P&gt;

&lt;P&gt;I have a lookup csv (e.g. Bad_IOC.csv) with column names "type and value".&lt;BR /&gt;
Under "type" I may have domains, hashes, IP(s) and under "value" I will have the corresponding , "domain.tld", "file-hashes", "ip_addresses". &lt;/P&gt;

&lt;P&gt;Example query&lt;/P&gt;

&lt;P&gt;Index = network_data sourcetype=foo [inputlookup Bad_IOC.csv | fields value | rename value as search | format maxresults =1000]  | stats values(URL)&lt;/P&gt;

&lt;P&gt;Index=network_data contains a field called "URL" which contains strings with domains I want to match against Bad_IOC.csv lookup.&lt;/P&gt;

&lt;P&gt;The results of the above query successfully finds matches of URL values with listed domains on Bad_IOC.csv.  Lets say  "malicious.com" is on the Bad_IOC.csv and when I run the query I get one exact match "malicious.com" and two matches with the pattern "malicious.com"  i.e.  cdn.malicious.com and san.cdn.malicious.com.edgekey.net...   &lt;/P&gt;

&lt;P&gt;What I need is to produce table where the following additional information is appended.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;URL                                                                  match                         type
cdn.malicious.com                                                  malicious.com                  domain
san.cdn.malicious.com.edgekey.net                                  malicious.com                  domain
malicious.com                                                      malicious.com                  domain
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please advise the best what to create new output from the matches.&lt;BR /&gt;
The objective is primarily to tag the matches with the ioc (in this case domain "malicious.com") and the type (which is domain)..&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:44:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446403#M126638</guid>
      <dc:creator>Log_wrangler</dc:creator>
      <dc:date>2020-09-29T23:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to enhance the search results of events that match a lookup.csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446404#M126639</link>
      <description>&lt;P&gt;Use the 'lookup' as a 'lookup'!&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index = network_data sourcetype=foo |lookup BAD_IOC match as URL OUTPUT match type| table URL match type&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;To make this work, I assume your CSV contains two columns - 'match', and 'type' (match is a wildcarded url, eg *malicious.com)&lt;BR /&gt;
I also assume your source data has a field called URL&lt;/P&gt;

&lt;P&gt;Once you have your CSV, you need to create a lookup definition &lt;CODE&gt;BAD_IOC&lt;/CODE&gt; (in my example) which references the CSV, and set the matchtype to WILDCARD for the 'match' field.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 11:20:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446404#M126639</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2019-03-21T11:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to enhance the search results of events that match a lookup.csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446405#M126640</link>
      <description>&lt;P&gt;Thank you for the reply.  Your assumptions are correct, except in the Bad_IOC lookup there is no field / column name "match".  We want the "match" field values to populate with the IOC field which is called "value"  (e.g. in this case type = domain and value = malicious.com).  The reason is so when the data is processed by our SOAR platform, there is a match value of "malicious.com" for URL values that match something like "san.cdn.malicious.com.edgekey.net "  which can be confusing as it is not simply formated domain.tld...&lt;/P&gt;

&lt;P&gt;In other words, we wanted the URL field value to match the IOC domain, and produce the tabled output above.&lt;/P&gt;

&lt;P&gt;If I am understanding you correctly, we need to add more columns to the BAD_IOC lookup.  We are trying to re-work a query that someone else wrote so maybe I just need to start from scratch.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 15:20:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446405#M126640</guid>
      <dc:creator>Log_wrangler</dc:creator>
      <dc:date>2019-03-21T15:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to enhance the search results of events that match a lookup.csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446406#M126641</link>
      <description>&lt;P&gt;No, just swap the field name “match” for the field “domain” from my example. &lt;/P&gt;

&lt;P&gt;I think you would need to prefix the domain list with * to make it work though. &lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 15:24:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446406#M126641</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2019-03-21T15:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to enhance the search results of events that match a lookup.csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446407#M126642</link>
      <description>&lt;P&gt;Thanks for the suggestion but its not working, we have a special situation here.&lt;/P&gt;

&lt;P&gt;For example here is a sample output with a  domain ioc from BAD_IOC lookup...&lt;/P&gt;

&lt;P&gt;|inputlookup BAD_IOC&lt;/P&gt;

&lt;P&gt;The results are &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;type        value
domain  malicious.com
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Mar 2019 15:38:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446407#M126642</guid>
      <dc:creator>Log_wrangler</dc:creator>
      <dc:date>2019-03-21T15:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to enhance the search results of events that match a lookup.csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446408#M126643</link>
      <description>&lt;P&gt;So here is where we were prior to asking the community...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=net_data sourcetype=foo
[inputlookup BAD_IOC | fields value | rename value as search | format maxresults=1000]
|rename URL as value
|lookup BAD_IOC value outputnew value AS match, type 
|table value,match,type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Results were sort of on target&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;value                                      match                    type
malicious.com                          malicious.com        domain
cdn.malicious.com                       
san.cdn.malicious.com.edgekey.net 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;we just wanted to add "malicious.com" and "domain" to the other rows that were not exact matches with the ioc domain "malicious.com".     Not even sure this is possible, doing this our way.  But we are getting matches without wildcarding * the ioc domains.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 16:03:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446408#M126643</guid>
      <dc:creator>Log_wrangler</dc:creator>
      <dc:date>2019-03-21T16:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to enhance the search results of events that match a lookup.csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446409#M126644</link>
      <description>&lt;P&gt;accepting your answer as it is correct, and what I am proposing is not possible I determined.  Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 20:36:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446409#M126644</guid>
      <dc:creator>Log_wrangler</dc:creator>
      <dc:date>2019-03-26T20:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to enhance the search results of events that match a lookup.csv?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446410#M126645</link>
      <description>&lt;P&gt;in other words we wanted the ioc domain pattern match to dynamically output and populate a field called "match" &lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2019 15:01:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-enhance-the-search-results-of-events-that-match-a-lookup/m-p/446410#M126645</guid>
      <dc:creator>Log_wrangler</dc:creator>
      <dc:date>2019-03-27T15:01:48Z</dc:date>
    </item>
  </channel>
</rss>

