<?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: Inputlookup not functioning as expecting in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-not-functioning-as-expecting/m-p/324405#M161783</link>
    <description>&lt;P&gt;Try removing the &lt;CODE&gt;| search Name=*&lt;/CODE&gt; so as to have: &lt;CODE&gt;sourcetype=office365 ResultStatus=Succeeded Operation=UserLoggedIn&lt;BR /&gt;
| lookup sensitive_accounts.csv UserId AS UserId OUTPUT Name&lt;BR /&gt;
| iplocation ClientIP&lt;BR /&gt;
| search Country!="United States"&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Apr 2018 16:16:40 GMT</pubDate>
    <dc:creator>thomast_splunk</dc:creator>
    <dc:date>2018-04-10T16:16:40Z</dc:date>
    <item>
      <title>Inputlookup not functioning as expecting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-not-functioning-as-expecting/m-p/324399#M161777</link>
      <description>&lt;P&gt;I have a query for detecting logins to "sensitive" accounts from outside of certain countries. Rather than listing every single account, I want to use a lookup listing the UserIds of sensitive accounts.&lt;/P&gt;

&lt;P&gt;Currently my query looks like this and functions fine:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; sourcetype=office365 ResultStatus=Succeeded Operation=UserLoggedIn (UserId="john.doe@whateverdotcom" OR 
 UserId="jane.doe@whateverdotcom" OR UserId="man.face@ whateverdotcom" OR UserId="onemore.example@ whateverdotcom")
    | iplocation ClientIP
    | search Country!="United States"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Only add like 20 more account names. I've made a csv titled &lt;EM&gt;sensitive_accounts.csv&lt;/EM&gt; that's laid out as follows:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;UserId,Name&lt;BR /&gt;
john.doe@whateverdotcom,John Doe&lt;BR /&gt;
jane.doe@whateverdotcom,Jane Doe&lt;BR /&gt;
man.face@whateverdotcom,Man Face&lt;BR /&gt;
onemore.example@whateverdotcom,Onemore Example&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;I've put this lookup into the query like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    sourcetype=office365 ResultStatus=Succeeded Operation=UserLoggedIn
    [inputlookup sensitive_accounts.csv]
        | iplocation ClientIP
        | search Country!="United States"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It runs for a few seconds and then returns no results -- I've verified that with the original query it does pull back results. Anyone have any ideas on what I'm doing wrong here? Bonus points if it's something really obvious -- I have a feeling it is.&lt;/P&gt;

&lt;P&gt;**Edited to add appropriate iplocation argument (ClientIP), forgot to include that when I was sanitizing these queries -- thank you to the user who pointed that out!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Apr 2018 19:57:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-not-functioning-as-expecting/m-p/324399#M161777</guid>
      <dc:creator>mraymer1</dc:creator>
      <dc:date>2018-04-09T19:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup not functioning as expecting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-not-functioning-as-expecting/m-p/324400#M161778</link>
      <description>&lt;P&gt;It would appear that you should specify a field for the iplocation command.   E.g. | iplocation src_ip&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     sourcetype=office365 ResultStatus=Succeeded Operation=UserLoggedIn
     [inputlookup sensitive_accounts.csv]
         | iplocation src_ip
         | search Country!="United States"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Apr 2018 20:14:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-not-functioning-as-expecting/m-p/324400#M161778</guid>
      <dc:creator>thomast_splunk</dc:creator>
      <dc:date>2018-04-09T20:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup not functioning as expecting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-not-functioning-as-expecting/m-p/324401#M161779</link>
      <description>&lt;P&gt;Rather : &lt;CODE&gt;sourcetype=office365 ResultStatus=Succeeded Operation=UserLoggedIn (UserId="john.doe@whateverdotcom" OR &lt;BR /&gt;
  UserId="jane.doe@whateverdotcom" OR UserId="man.face@ whateverdotcom" OR UserId="onemore.example@ whateverdotcom")&lt;BR /&gt;
     | iplocation src_ip&lt;BR /&gt;
     | search Country!="United States"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Apr 2018 20:16:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-not-functioning-as-expecting/m-p/324401#M161779</guid>
      <dc:creator>thomast_splunk</dc:creator>
      <dc:date>2018-04-09T20:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup not functioning as expecting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-not-functioning-as-expecting/m-p/324402#M161780</link>
      <description>&lt;P&gt;Hey@mraymer1,&lt;/P&gt;

&lt;P&gt;Inputlookup is a generating command and should be the first command used in search. In your case the subsearch | is missing. &lt;/P&gt;

&lt;P&gt;Try running your query like this:&lt;BR /&gt;
sourcetype=office365 ResultStatus=Succeeded Operation=UserLoggedIn&lt;BR /&gt;
[| inputlookup sensitive_accounts.csv]&lt;BR /&gt;
 | iplocation ClientIP&lt;BR /&gt;
 | search Country!="United States"&lt;/P&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;P&gt;sourcetype=office365 ResultStatus=Succeeded Operation=UserLoggedIn&lt;BR /&gt;
| lookup sensitive_accounts.csv UserId AS UserId OUTPUT Name | search Name=*&lt;BR /&gt;
| iplocation ClientIP&lt;BR /&gt;
| search Country!="United States"&lt;/P&gt;

&lt;P&gt;Let me know if this helps!!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 02:25:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-not-functioning-as-expecting/m-p/324402#M161780</guid>
      <dc:creator>deepashri_123</dc:creator>
      <dc:date>2018-04-10T02:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup not functioning as expecting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-not-functioning-as-expecting/m-p/324403#M161781</link>
      <description>&lt;P&gt;@mraymer1, if your intent is to use inputlookup to search UserId from lookup file into the raw data then you should try the following (inputlookup should return only UserId as Name field might not be present in your raw event:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; sourcetype="office365" ResultStatus="Succeeded" Operation="UserLoggedIn"
 [| inputlookup sensitive_accounts.csv | table UserId]
  | stats count by ClientIP
  | iplocation ClientIP
  | search Country!="United States"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please try out and confirm!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 03:01:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-not-functioning-as-expecting/m-p/324403#M161781</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-10T03:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup not functioning as expecting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-not-functioning-as-expecting/m-p/324404#M161782</link>
      <description>&lt;P&gt;That second query structure worked! The only downside is the job runs exponentially slower than the original messy one. (&lt;EM&gt;434 seconds/command search/134 invocations&lt;/EM&gt; vs .&lt;EM&gt;94 seconds/command search/15 invocations&lt;/EM&gt;)&lt;/P&gt;

&lt;P&gt;So now I'm troubleshooting why that difference is so extreme, since it needs this lookup functionality to ensure scalability for queries. Thank you for getting me in the right direction!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 15:53:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-not-functioning-as-expecting/m-p/324404#M161782</guid>
      <dc:creator>mraymer1</dc:creator>
      <dc:date>2018-04-10T15:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup not functioning as expecting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-not-functioning-as-expecting/m-p/324405#M161783</link>
      <description>&lt;P&gt;Try removing the &lt;CODE&gt;| search Name=*&lt;/CODE&gt; so as to have: &lt;CODE&gt;sourcetype=office365 ResultStatus=Succeeded Operation=UserLoggedIn&lt;BR /&gt;
| lookup sensitive_accounts.csv UserId AS UserId OUTPUT Name&lt;BR /&gt;
| iplocation ClientIP&lt;BR /&gt;
| search Country!="United States"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 16:16:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-not-functioning-as-expecting/m-p/324405#M161783</guid>
      <dc:creator>thomast_splunk</dc:creator>
      <dc:date>2018-04-10T16:16:40Z</dc:date>
    </item>
  </channel>
</rss>

