<?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 exclude sub folders in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-sub-folders/m-p/350577#M103780</link>
    <description>&lt;P&gt;Hi All&lt;/P&gt;

&lt;P&gt;I would like to monitor "4670: Permissions on an object were changed". &lt;/P&gt;

&lt;P&gt;I have the following query:&lt;/P&gt;

&lt;P&gt;index=wineventlog sourcetype="WinEventLog:Security" "EventCode=4670" "Object_Name"!= "&lt;EM&gt;.&lt;/EM&gt;"&lt;BR /&gt;
| search [inputlookup xxxxxx.csv]&lt;BR /&gt;
| Table _time EventCode Account_Name "Object_Type" "Object_Name"&lt;BR /&gt;
| rename EventCode AS "Event", "Account_Name" AS "User", "Object_Type" AS "Object", "Object_Name" AS "Folder"&lt;/P&gt;

&lt;P&gt;In the results I get the root folder and all it subfolders. &lt;/P&gt;

&lt;P&gt;How can I exclude the subfolders from the results so I just get the root folder?&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 13:50:36 GMT</pubDate>
    <dc:creator>socdtv</dc:creator>
    <dc:date>2020-09-29T13:50:36Z</dc:date>
    <item>
      <title>How to exclude sub folders</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-sub-folders/m-p/350577#M103780</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;

&lt;P&gt;I would like to monitor "4670: Permissions on an object were changed". &lt;/P&gt;

&lt;P&gt;I have the following query:&lt;/P&gt;

&lt;P&gt;index=wineventlog sourcetype="WinEventLog:Security" "EventCode=4670" "Object_Name"!= "&lt;EM&gt;.&lt;/EM&gt;"&lt;BR /&gt;
| search [inputlookup xxxxxx.csv]&lt;BR /&gt;
| Table _time EventCode Account_Name "Object_Type" "Object_Name"&lt;BR /&gt;
| rename EventCode AS "Event", "Account_Name" AS "User", "Object_Type" AS "Object", "Object_Name" AS "Folder"&lt;/P&gt;

&lt;P&gt;In the results I get the root folder and all it subfolders. &lt;/P&gt;

&lt;P&gt;How can I exclude the subfolders from the results so I just get the root folder?&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:50:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-sub-folders/m-p/350577#M103780</guid>
      <dc:creator>socdtv</dc:creator>
      <dc:date>2020-09-29T13:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude sub folders</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-sub-folders/m-p/350578#M103781</link>
      <description>&lt;P&gt;Hello soctv,&lt;BR /&gt;
the field "Object_Name" contains the path with all folders, here i used eval split and mvindex to extract it. there are other ways like | rex command for example.&lt;BR /&gt;
here is my search based on your search and a screenshot:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog sourcetype="WinEventLog:Security" "EventCode=4670" "Object_Name"!= "." 
| head
| eval dirs=split(Object_Name ,"\\")
| eval root_dir= mvindex(dirs, 1)
| table _time EventCode Account_Name "Object_Type" "root_dir"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2836i2A1767694B264F9F/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 20:16:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-sub-folders/m-p/350578#M103781</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-04-26T20:16:34Z</dc:date>
    </item>
  </channel>
</rss>

