<?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 How to add new Lookup? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-new-Lookup/m-p/611654#M212644</link>
    <description>&lt;P&gt;I am working to leverage the below query for 'Stale Account Usage' from&amp;nbsp;&lt;A href="https://docs.splunksecurityessentials.com/content-detail/stale_account_usage/" target="_blank" rel="noopener"&gt;Splunk Security Essentials Docs&lt;/A&gt;, which uses lookup "account_status_tracker".&lt;/P&gt;
&lt;P&gt;The&amp;nbsp; 'How to Implement' guidance includes: "&lt;SPAN&gt;The only step you'll need to take is to create a lookup called account_status_tracker, and have authentication data in Common Information Model format. "&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;From the "Add New" lookup webpage, it is not clear how I assign an appropriate "Lookup File" that will the necessary fields in CIM format. I have looked through Splunk docs and other likely resources, with no strong hits. I admit this is an area new to me.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;My question is: what steps do I need to take to define this lookup, including assigning an appropriate "Lookup File"?&amp;nbsp; When I select existing authentication-related files as the "Lookup File", I receive error messages, for example:&amp;nbsp; "Cannot find the destination field 'count' in the lookup table...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;And leads greatly appreciated.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=* source="*WinEventLog:Security" action=success
| stats count min(_time) as earliest max(_time) as latest by user
| multireport
[| stats values(*) as * by user
| lookup account_status_tracker user OUTPUT count as prior_count earliest as prior_earliest latest as prior_latest
| where prior_latest &amp;lt; relative_time(now(), "-90d")
| eval explanation="The last login from this user was " . (round( (earliest-prior_latest) / 3600/24, 2) ) . " days ago."
| convert ctime(earliest) ctime(latest) ctime(prior_earliest) ctime(prior_latest) ]
[| inputlookup append=t account_status_tracker
| stats min(earliest) as earliest max(latest) as latest sum(count) as count by user
| outputlookup account_status_tracker
| where this_only_exists_to_update_the_lookup='so we will make sure there are no results']

&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 01 Sep 2022 18:29:04 GMT</pubDate>
    <dc:creator>Sven1</dc:creator>
    <dc:date>2022-09-01T18:29:04Z</dc:date>
    <item>
      <title>How to add new Lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-new-Lookup/m-p/611654#M212644</link>
      <description>&lt;P&gt;I am working to leverage the below query for 'Stale Account Usage' from&amp;nbsp;&lt;A href="https://docs.splunksecurityessentials.com/content-detail/stale_account_usage/" target="_blank" rel="noopener"&gt;Splunk Security Essentials Docs&lt;/A&gt;, which uses lookup "account_status_tracker".&lt;/P&gt;
&lt;P&gt;The&amp;nbsp; 'How to Implement' guidance includes: "&lt;SPAN&gt;The only step you'll need to take is to create a lookup called account_status_tracker, and have authentication data in Common Information Model format. "&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;From the "Add New" lookup webpage, it is not clear how I assign an appropriate "Lookup File" that will the necessary fields in CIM format. I have looked through Splunk docs and other likely resources, with no strong hits. I admit this is an area new to me.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;My question is: what steps do I need to take to define this lookup, including assigning an appropriate "Lookup File"?&amp;nbsp; When I select existing authentication-related files as the "Lookup File", I receive error messages, for example:&amp;nbsp; "Cannot find the destination field 'count' in the lookup table...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;And leads greatly appreciated.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=* source="*WinEventLog:Security" action=success
| stats count min(_time) as earliest max(_time) as latest by user
| multireport
[| stats values(*) as * by user
| lookup account_status_tracker user OUTPUT count as prior_count earliest as prior_earliest latest as prior_latest
| where prior_latest &amp;lt; relative_time(now(), "-90d")
| eval explanation="The last login from this user was " . (round( (earliest-prior_latest) / 3600/24, 2) ) . " days ago."
| convert ctime(earliest) ctime(latest) ctime(prior_earliest) ctime(prior_latest) ]
[| inputlookup append=t account_status_tracker
| stats min(earliest) as earliest max(latest) as latest sum(count) as count by user
| outputlookup account_status_tracker
| where this_only_exists_to_update_the_lookup='so we will make sure there are no results']

&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Sep 2022 18:29:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-new-Lookup/m-p/611654#M212644</guid>
      <dc:creator>Sven1</dc:creator>
      <dc:date>2022-09-01T18:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new Lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-new-Lookup/m-p/611694#M212661</link>
      <description>&lt;P&gt;Usually, the first step to adding a lookup is to put a CSV file on the server in one of Splunk's 'lookups'&amp;nbsp; directories.&amp;nbsp; Then use the GUI to reference that file.&lt;/P&gt;&lt;P&gt;You also can use the Lookup File Editor app to create a new lookup file from the GUI.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 00:21:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-new-Lookup/m-p/611694#M212661</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-09-02T00:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new Lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-new-Lookup/m-p/611695#M212662</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;:&amp;nbsp;Thank you.&amp;nbsp; After reading the guidance,&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN&gt;The only step you'll need to take is to create a lookup called account_status_tracker, and have authentication data in CIM format" I grabbed the current authentication CIM (&lt;A href="https://docs.splunk.com/Documentation/CIM/latest/User/Authentication" target="_blank"&gt;Authentication - Splunk Documentation&lt;/A&gt;), but then held off on pushing to create the lookup.&amp;nbsp; For example, I noticed that while the lookup will attempt to OUTPUT field "count", the authentication CIM does not include a "count" field.&amp;nbsp; So, I was just taking a step back and seeing if there is any other information needed to best implement this solution.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Again, thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 02:08:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-new-Lookup/m-p/611695#M212662</guid>
      <dc:creator>Sven1</dc:creator>
      <dc:date>2022-09-02T02:08:20Z</dc:date>
    </item>
  </channel>
</rss>

