<?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: how to count the number of files and directories in a folder in splunk in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180318#M36159</link>
    <description>&lt;P&gt;I want just to calculate the number of directories and files in a specific folder ! so if it is possible to not index data it will be good. If not i want to have the count and create a dashboard like that :&lt;/P&gt;

&lt;P&gt;DIRECTORY            NumberOfFiles    NumberOfDirectories&lt;BR /&gt;
Dir Name               NBFiles            NBDir&lt;/P&gt;

&lt;P&gt;So How could i do this ?&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Wed, 13 Aug 2014 11:58:13 GMT</pubDate>
    <dc:creator>Afef</dc:creator>
    <dc:date>2014-08-13T11:58:13Z</dc:date>
    <item>
      <title>how to count the number of files and directories in a folder in splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180316#M36157</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
Please Could someone tell me how to count the number of files and directories in a folder in splunk ?&lt;BR /&gt;
Regards&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2014 11:26:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180316#M36157</guid>
      <dc:creator>Afef</dc:creator>
      <dc:date>2014-08-13T11:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to count the number of files and directories in a folder in splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180317#M36158</link>
      <description>&lt;P&gt;Are you trying to index that count for some directory, or are you trying to calculate statistics based on already indexed data and the path in their &lt;CODE&gt;source&lt;/CODE&gt; field?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2014 11:37:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180317#M36158</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-08-13T11:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to count the number of files and directories in a folder in splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180318#M36159</link>
      <description>&lt;P&gt;I want just to calculate the number of directories and files in a specific folder ! so if it is possible to not index data it will be good. If not i want to have the count and create a dashboard like that :&lt;/P&gt;

&lt;P&gt;DIRECTORY            NumberOfFiles    NumberOfDirectories&lt;BR /&gt;
Dir Name               NBFiles            NBDir&lt;/P&gt;

&lt;P&gt;So How could i do this ?&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2014 11:58:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180318#M36159</guid>
      <dc:creator>Afef</dc:creator>
      <dc:date>2014-08-13T11:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to count the number of files and directories in a folder in splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180319#M36160</link>
      <description>&lt;P&gt;You could create a script that computes the counts you're looking for, a naïve one-liner counting the files and directories in a path could be this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;cd /path/to/count; date; pwd; ls | wc -l
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then configure that as a scripted input in your Splunk.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2014 12:49:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180319#M36160</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-08-13T12:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to count the number of files and directories in a folder in splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180320#M36161</link>
      <description>&lt;P&gt;Can you expand on the "Then configure that as a scripted input in your Splunk."  Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2014 13:03:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180320#M36161</guid>
      <dc:creator>smudge797</dc:creator>
      <dc:date>2014-08-13T13:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to count the number of files and directories in a folder in splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180321#M36162</link>
      <description>&lt;P&gt;Sure. Say you saved my one-liner or your much better script to &lt;CODE&gt;$SPLUNK_HOME/etc/apps/your_app/bin/dircount.sh&lt;/CODE&gt;, then you can define this in inputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script://$SPLUNK_HOME/etc/apps/your_app/bin/dircount.sh]
index = your_index
sourcetype = your_sourcetype
interval = number of seconds between runs
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can also configure this through the UI if run on a Searchhead, Indexer, or Heavy Forwarder by going to Settings -&amp;gt; Data Inputs -&amp;gt; Scripts -&amp;gt; New.&lt;/P&gt;

&lt;P&gt;Find the docs here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/Data/Setupcustominputs"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.3/Data/Setupcustominputs&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2014 13:15:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180321#M36162</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-08-13T13:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to count the number of files and directories in a folder in splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180322#M36163</link>
      <description>&lt;P&gt;Thank you martin, but i'm working with windows not linux, so what should i do ?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 07:48:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180322#M36163</guid>
      <dc:creator>Afef</dc:creator>
      <dc:date>2014-08-14T07:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to count the number of files and directories in a folder in splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180323#M36164</link>
      <description>&lt;P&gt;I'm sure similar things can be done with PowerShell. A quick googling suggests something like this: &lt;A href="http://stackoverflow.com/questions/14714284/count-items-in-a-folder-with-powershell"&gt;http://stackoverflow.com/questions/14714284/count-items-in-a-folder-with-powershell&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 09:07:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-count-the-number-of-files-and-directories-in-a-folder-in/m-p/180323#M36164</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-08-14T09:07:24Z</dc:date>
    </item>
  </channel>
</rss>

