<?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: Tabulate the list of folders under a directory for all hosts? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Tabulate-the-list-of-folders-under-a-directory-for-all-hosts/m-p/344679#M22438</link>
    <description>&lt;P&gt;@ sarnagar, If your script is adding multi-valued folder names per host as _raw data, you can just &lt;CODE&gt;table&lt;/CODE&gt; &lt;CODE&gt;host&lt;/CODE&gt; and &lt;CODE&gt;_raw&lt;/CODE&gt; i.e. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt;
| table host _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ideally if you have setup monitoring your your log files under specific folder the folder structure should be displayed as &lt;CODE&gt;source&lt;/CODE&gt;, which is a &lt;CODE&gt;inputs.conf&lt;/CODE&gt; setting (&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Data/Monitorfilesanddirectorieswithinputs.conf#Monitor_syntax_and_examples" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Data/Monitorfilesanddirectorieswithinputs.conf#Monitor_syntax_and_examples&lt;/A&gt;). Then all you would need to do in Splunk is use &lt;CODE&gt;split()&lt;/CODE&gt; with &lt;CODE&gt;mvindex()&lt;/CODE&gt; evaluation functions to extract required directory name.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 16:38:07 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2020-09-29T16:38:07Z</dc:date>
    <item>
      <title>Tabulate the list of folders under a directory for all hosts?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Tabulate-the-list-of-folders-under-a-directory-for-all-hosts/m-p/344678#M22437</link>
      <description>&lt;P&gt;1.&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/3779i32ADEFE384EAD430/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
I have  many directories of the below pattern in a set of hosts:&lt;BR /&gt;
/opt/&lt;STRONG&gt;ab&lt;/STRONG&gt;/admin/&lt;STRONG&gt;abdc&lt;/STRONG&gt;/apache/main.logs&lt;BR /&gt;
/opt/&lt;STRONG&gt;ab&lt;/STRONG&gt;/admin/&lt;STRONG&gt;xyzz&lt;/STRONG&gt;/apache/main.logs&lt;/P&gt;

&lt;P&gt;I want to tabulate all the foldernames i.e the 4th sub-dir in a host like below:&lt;BR /&gt;
host foldername&lt;BR /&gt;
A        abcd&lt;BR /&gt;
           xyzz&lt;BR /&gt;
B        abcd&lt;BR /&gt;
           pqrs&lt;BR /&gt;
           xyzz&lt;/P&gt;

&lt;P&gt;Is there any way I can achieve this in Splunk?&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;I tried to execute a shell script that just lists these folders names and this is available in the events as shown in screenshot attached. But Im not sure how I can tabulate them for the host?&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Kindly provide suggestions&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 16:50:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Tabulate-the-list-of-folders-under-a-directory-for-all-hosts/m-p/344678#M22437</guid>
      <dc:creator>sarnagar</dc:creator>
      <dc:date>2017-11-06T16:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Tabulate the list of folders under a directory for all hosts?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Tabulate-the-list-of-folders-under-a-directory-for-all-hosts/m-p/344679#M22438</link>
      <description>&lt;P&gt;@ sarnagar, If your script is adding multi-valued folder names per host as _raw data, you can just &lt;CODE&gt;table&lt;/CODE&gt; &lt;CODE&gt;host&lt;/CODE&gt; and &lt;CODE&gt;_raw&lt;/CODE&gt; i.e. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt;
| table host _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ideally if you have setup monitoring your your log files under specific folder the folder structure should be displayed as &lt;CODE&gt;source&lt;/CODE&gt;, which is a &lt;CODE&gt;inputs.conf&lt;/CODE&gt; setting (&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Data/Monitorfilesanddirectorieswithinputs.conf#Monitor_syntax_and_examples" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Data/Monitorfilesanddirectorieswithinputs.conf#Monitor_syntax_and_examples&lt;/A&gt;). Then all you would need to do in Splunk is use &lt;CODE&gt;split()&lt;/CODE&gt; with &lt;CODE&gt;mvindex()&lt;/CODE&gt; evaluation functions to extract required directory name.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:38:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Tabulate-the-list-of-folders-under-a-directory-for-all-hosts/m-p/344679#M22438</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-29T16:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: Tabulate the list of folders under a directory for all hosts?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Tabulate-the-list-of-folders-under-a-directory-for-all-hosts/m-p/344680#M22439</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search getting events from output of shell script
| rex max_match=0 "(?&amp;lt;foldername&amp;gt;\w+)"
| table host foldername
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Nov 2017 19:15:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Tabulate-the-list-of-folders-under-a-directory-for-all-hosts/m-p/344680#M22439</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-11-06T19:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Tabulate the list of folders under a directory for all hosts?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Tabulate-the-list-of-folders-under-a-directory-for-all-hosts/m-p/344681#M22440</link>
      <description>&lt;P&gt;HI  @niketnilay ,&lt;/P&gt;

&lt;P&gt;When I export the results I dont get all the folders for the host. Only the first folder for any host is present.&lt;/P&gt;

&lt;P&gt;Why does this happen? KindLy help.&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://C:Usersa594588Desktop" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 07:49:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Tabulate-the-list-of-folders-under-a-directory-for-all-hosts/m-p/344681#M22440</guid>
      <dc:creator>sarnagar</dc:creator>
      <dc:date>2017-11-08T07:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Tabulate the list of folders under a directory for all hosts?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Tabulate-the-list-of-folders-under-a-directory-for-all-hosts/m-p/344682#M22441</link>
      <description>&lt;P&gt;HI @somesoni2,&lt;/P&gt;

&lt;P&gt;When I export the results I dont get all the folders for the host. Only the first folder for any host is present.&lt;/P&gt;

&lt;P&gt;Why does this happen? KindLy help.&lt;/P&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/3777iDE30AEA325AA8796/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 07:51:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Tabulate-the-list-of-folders-under-a-directory-for-all-hosts/m-p/344682#M22441</guid>
      <dc:creator>sarnagar</dc:creator>
      <dc:date>2017-11-08T07:51:46Z</dc:date>
    </item>
  </channel>
</rss>

