<?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 Lookup table to return column value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Lookup-table-to-return-column-value/m-p/325236#M96981</link>
    <description>&lt;P&gt;I am having issues with displaying data based off the results from the lookup table. &lt;BR /&gt;
I am using this search below, which works perfectly fine but the only issue I have is, it does not tell me which IOC caused the event to be generated. I can tell by looking at the raw event or other interesting fields but that is time consuming which beats the purpose of the dashboard that I am building out. &lt;/P&gt;

&lt;P&gt;Search:&lt;/P&gt;

&lt;P&gt;Index=zyx  [|inputlookup URLList.csv | rename BI_URL as query | fields query] &lt;BR /&gt;
|lookup URLList.csv BI_URL AS url OUTPUTNEW BI_URL IOCs_ADDED_DATE REPORT_TYPE THREAT_TYPE&lt;BR /&gt;
|lookup URLList.csv BI_URL AS dest_hostname OUTPUTNEW BI_URL IOCs_ADDED_DATE REPORT_TYPE THREAT_TYPE&lt;BR /&gt;
|lookup URLList.csv BI_URL AS dest OUTPUTNEW BI_URL IOCs_ADDED_DATE REPORT_TYPE THREAT_TYPE&lt;BR /&gt;
|rename BI_URL as IOC_Match &lt;BR /&gt;
|table _time IOC_Match IOCs_ADDED_DATE REPORT_TYPE THREAT_TYPE index sourcetype url dest dest_ip src_ip _raw&lt;/P&gt;

&lt;P&gt;Events are being generated but these fields are return blank:&lt;BR /&gt;
IOC_Match IOCs_ADDED_DATE REPORT_TYPE THREAT_TYPE.&lt;/P&gt;

&lt;P&gt;Here is scenario:&lt;BR /&gt;
so let say in the lookup table i have a IOC value, cnn.com and i run the query above.&lt;BR /&gt;
which will work perfectly fine. it will show there was network traffic going out to money.cnn.com or cnn.com/xyz and it will show that in the dest or url field. How can i make that show the IOC cnn.com? I have the lookup table to display in the IOC_Match column?&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 16:24:36 GMT</pubDate>
    <dc:creator>AbubakarShahid</dc:creator>
    <dc:date>2020-09-29T16:24:36Z</dc:date>
    <item>
      <title>Lookup table to return column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-table-to-return-column-value/m-p/325236#M96981</link>
      <description>&lt;P&gt;I am having issues with displaying data based off the results from the lookup table. &lt;BR /&gt;
I am using this search below, which works perfectly fine but the only issue I have is, it does not tell me which IOC caused the event to be generated. I can tell by looking at the raw event or other interesting fields but that is time consuming which beats the purpose of the dashboard that I am building out. &lt;/P&gt;

&lt;P&gt;Search:&lt;/P&gt;

&lt;P&gt;Index=zyx  [|inputlookup URLList.csv | rename BI_URL as query | fields query] &lt;BR /&gt;
|lookup URLList.csv BI_URL AS url OUTPUTNEW BI_URL IOCs_ADDED_DATE REPORT_TYPE THREAT_TYPE&lt;BR /&gt;
|lookup URLList.csv BI_URL AS dest_hostname OUTPUTNEW BI_URL IOCs_ADDED_DATE REPORT_TYPE THREAT_TYPE&lt;BR /&gt;
|lookup URLList.csv BI_URL AS dest OUTPUTNEW BI_URL IOCs_ADDED_DATE REPORT_TYPE THREAT_TYPE&lt;BR /&gt;
|rename BI_URL as IOC_Match &lt;BR /&gt;
|table _time IOC_Match IOCs_ADDED_DATE REPORT_TYPE THREAT_TYPE index sourcetype url dest dest_ip src_ip _raw&lt;/P&gt;

&lt;P&gt;Events are being generated but these fields are return blank:&lt;BR /&gt;
IOC_Match IOCs_ADDED_DATE REPORT_TYPE THREAT_TYPE.&lt;/P&gt;

&lt;P&gt;Here is scenario:&lt;BR /&gt;
so let say in the lookup table i have a IOC value, cnn.com and i run the query above.&lt;BR /&gt;
which will work perfectly fine. it will show there was network traffic going out to money.cnn.com or cnn.com/xyz and it will show that in the dest or url field. How can i make that show the IOC cnn.com? I have the lookup table to display in the IOC_Match column?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:24:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-table-to-return-column-value/m-p/325236#M96981</guid>
      <dc:creator>AbubakarShahid</dc:creator>
      <dc:date>2020-09-29T16:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup table to return column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-table-to-return-column-value/m-p/325237#M96982</link>
      <description>&lt;P&gt;I suspect the problem is related to capitalization. This search  &lt;CODE&gt;index=zyx [|inputlookup URLList.csv | rename BI_URL as query | fields query]&lt;/CODE&gt; will generate matches that are case-insensitive. So if your lookup table contains an entry with  &lt;CODE&gt;BI_URL="CNN.COM"&lt;/CODE&gt;, that search will return events with  &lt;CODE&gt;CNN.COM&lt;/CODE&gt; or  &lt;CODE&gt;cnn.com&lt;/CODE&gt; or even  &lt;CODE&gt;cNn.cOm&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;However, the lookup functionality is NOT case-insensitive. So in the above possibilities, the only events that will generate hits from the &lt;CODE&gt;| lookup URLList.csv...&lt;/CODE&gt; portions of the search are those containing  &lt;CODE&gt;CNN.COM&lt;/CODE&gt;, not any of the ones containing only  &lt;CODE&gt;cnn.com&lt;/CODE&gt;, for example.&lt;/P&gt;

&lt;P&gt;Your best bet is to convert the entire lookup table to lowercase and then start your search with this:&lt;BR /&gt;
&lt;CODE&gt;index=zyx [|inputlookup URLList.csv | rename BI_URL as query | fields query]  | foreach url dest_hostname dest [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=lower(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;)]&lt;/CODE&gt; before applying all the lookups.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 18:15:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-table-to-return-column-value/m-p/325237#M96982</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-10-24T18:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup table to return column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-table-to-return-column-value/m-p/325238#M96983</link>
      <description>&lt;P&gt;No this does not resolve the issue either. The IOC_Match column is still empty.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 19:05:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-table-to-return-column-value/m-p/325238#M96983</guid>
      <dc:creator>AbubakarShahid</dc:creator>
      <dc:date>2017-10-24T19:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup table to return column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-table-to-return-column-value/m-p/325239#M96984</link>
      <description>&lt;P&gt;Oh, I'm sorry - I misread your final paragraph. In order to take an event with url="cnn.com/xyz" and make it match on a lookup table containing host="cnn.com", you would need a wildcard lookup. Here's some good guidance on that:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/52580/can-we-use-wildcard-characters-in-a-lookup-table.html"&gt;https://answers.splunk.com/answers/52580/can-we-use-wildcard-characters-in-a-lookup-table.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Caveat here is that converting your existing lookup table to a wildcard lookup may compel you to either:&lt;BR /&gt;
1. Add a non-wildcarded column that you use in the subsearch to avoid searching on wildcarded fields; OR&lt;BR /&gt;
2. Apply some string-replacement functions to remove the wildcards from the host field before populating it out into the base search.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 19:35:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-table-to-return-column-value/m-p/325239#M96984</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-10-24T19:35:40Z</dc:date>
    </item>
  </channel>
</rss>

