<?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: Lookup Challenge in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Challenge/m-p/502392#M139852</link>
    <description>&lt;P&gt;Yes it was.&lt;/P&gt;</description>
    <pubDate>Sun, 22 Mar 2020 21:22:20 GMT</pubDate>
    <dc:creator>gabarrygowin</dc:creator>
    <dc:date>2020-03-22T21:22:20Z</dc:date>
    <item>
      <title>Lookup Challenge</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Challenge/m-p/502388#M139848</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;With all this work from home, I'm now pulling logs from the VPN equipment.  Now leadership is asking to equate the UserName to a business unit.  Our Active Directory doesn't natively provide that but does give 'department'.  I've built the  lookup to equate departments to BusinessUnit, but can't figure out the missing piece.&lt;/P&gt;

&lt;P&gt;Lookup:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Department  BusinessUnit
11-000-*    GA Legal
11-1*   GA Security
11-2*   GA HR
11-3*   GA Internal Audit
11-5*   GA Procurement
13-2*   GA ITS
14-*    GA Accounting
15-104* GA Publications
15-113-000  GA CFO
15-113-001  GA Intl Cntrl
15-180* GA Treasurer
15-250* GA Financial Planning
15-350* GA Treasury
16-1*   GA Facilities
18-4*   Fusion
19-*    EMS
20-505* Diazyme
51-001* GA Uranium Res. Co.
6*  ASI
7*  SI
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My current search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=cisco-ise-passed-authentication Location="Location#All Locations#US#CA#Poway" NAS_Port_Type="Virtual" | eval UserName=lower(UserName) | stats dc(UserName) by UserName | lookup adlookup sAMAccountName as UserName |  table UserName department | lookup BusinessUnitLookup.csv department as Department OUTPUTNEW BusinessUnit | stats dc(UserName) by BusinessUnit
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 Mar 2020 03:58:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Challenge/m-p/502388#M139848</guid>
      <dc:creator>gabarrygowin</dc:creator>
      <dc:date>2020-03-22T03:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Challenge</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Challenge/m-p/502389#M139849</link>
      <description>&lt;P&gt;What is the missing piece?&lt;BR /&gt;
Does it have something to do with the asterisks in your lookup file?  &lt;/P&gt;</description>
      <pubDate>Sun, 22 Mar 2020 13:38:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Challenge/m-p/502389#M139849</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-03-22T13:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Challenge</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Challenge/m-p/502390#M139850</link>
      <description>&lt;P&gt;@gabarrygowin,  lookup command is -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| lookup &amp;lt;lookup-table-name&amp;gt; &amp;lt;lookup-field1&amp;gt; AS &amp;lt;event-field1&amp;gt; OUTPUTNEW &amp;lt;lookup-destfield1&amp;gt; AS &amp;lt;event-destfield1&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After lookup command first field should be lookup field so in your case it would be-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| lookup BusinessUnitLookup.csv Department as department OUTPUTNEW BusinessUnit
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 Mar 2020 16:50:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Challenge/m-p/502390#M139850</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2020-03-22T16:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Challenge</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Challenge/m-p/502391#M139851</link>
      <description>&lt;P&gt;Rich gets the points!   It was the asterisks.   When I fully populated the department column it worked as stated.&lt;/P&gt;

&lt;P&gt;Moral here:  Wildcards can get wild....&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 22 Mar 2020 21:20:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Challenge/m-p/502391#M139851</guid>
      <dc:creator>gabarrygowin</dc:creator>
      <dc:date>2020-03-22T21:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Challenge</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Challenge/m-p/502392#M139852</link>
      <description>&lt;P&gt;Yes it was.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Mar 2020 21:22:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Challenge/m-p/502392#M139852</guid>
      <dc:creator>gabarrygowin</dc:creator>
      <dc:date>2020-03-22T21:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Challenge</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Challenge/m-p/502393#M139853</link>
      <description>&lt;P&gt;To use asterisks in your lookup file, first create a lookup definition that points to your CSV.  Go to Settings-&amp;gt;Lookups-&amp;gt;Lookup definitions and click New Lookup Definition.&lt;BR /&gt;
Select the appropriate app, enter "BusinessUnitLookup" as the Name, and choose "BusinessUnitLookup.csv" from the "Lookup file" dropdown.  Then check the Advanced box and enter "WILDCARD(Department)" in the "Match type" box.  Click Save.&lt;BR /&gt;
Change your query to use the lookup definition instead of the file.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| lookup BusinessUnitLookup Department as department OUTPUTNEW BusinessUnit
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Mar 2020 15:14:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Challenge/m-p/502393#M139853</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-03-23T15:14:34Z</dc:date>
    </item>
  </channel>
</rss>

