# Monitor Size of Single Directory?

**URL:** <https://discuss.elastic.co/t/monitor-size-of-single-directory/56038>\
**Category:** Beats\
**Created:** [July 20, 2016, 11:08pm UTC](https://discuss.elastic.co/t/monitor-size-of-single-directory/56038 "2016-07-20T23:08:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![seth.yes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seth.yes/32/11788_2.png) [@seth.yes](https://discuss.elastic.co/u/seth.yes)\
**Post date:** [July 20, 2016, 11:08pm UTC](https://discuss.elastic.co/t/monitor-size-of-single-directory/56038/1 "2016-07-20T23:08:00Z")

</div>

Is there any way to configure Topbeat to monitor the size of one directory? I am considering just writing a script that does: 'du -h \> dirsize.txt' and tailing that file, but I'd prefer something more elegant..

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [July 20, 2016, 11:32pm UTC](https://discuss.elastic.co/t/monitor-size-of-single-directory/56038/2 "2016-07-20T23:32:56Z")

</div>

No, Topbeat and Metricbeat both report filesystem usage metrics on a per mount point basis.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 20, 2016, 11:37pm UTC](https://discuss.elastic.co/t/monitor-size-of-single-directory/56038/3 "2016-07-20T23:37:09Z")

</div>

[https://github.com/kimjmin/lsbeat](https://github.com/kimjmin/lsbeat) might help

---

<div class="post-metadata">

**Author:** ![seth.yes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seth.yes/32/11788_2.png) [@seth.yes](https://discuss.elastic.co/u/seth.yes)\
**Post date:** [July 21, 2016, 4:04am UTC](https://discuss.elastic.co/t/monitor-size-of-single-directory/56038/4 "2016-07-21T04:04:01Z")

</div>

I'll research lsbeat, it looks like it can either do what I need or be  
modified to do it.. I just wonder if that's more efficient than using  
(already implemented) Filebeat and simply running a cron job every 5  
minutes or so to write the results of 'du /filepath/filename'.

Thank you for your suggestion Mark.

---

<div class="post-metadata">

**Author:** ![seth.yes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seth.yes/32/11788_2.png) [@seth.yes](https://discuss.elastic.co/u/seth.yes)\
**Post date:** [July 22, 2016, 7:19pm UTC](https://discuss.elastic.co/t/monitor-size-of-single-directory/56038/5 "2016-07-22T19:19:15Z")

</div>

It looks like the current solution is to simply write file size to a file that is tailed by Filebeat.

Is anyone aware of a way to push the data without tailing a file? Ideally we don't write this data in any logs, but rather push it directly to Logstash.

Ideas regarding implementation, good/bad idea etc..?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 22, 2016, 8:14pm UTC](https://discuss.elastic.co/t/monitor-size-of-single-directory/56038/6 "2016-07-22T20:14:30Z")

</div>

You could just send the metric with netcat over UDP or TCP.

---

<div class="post-metadata">

**Author:** ![seth.yes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seth.yes/32/11788_2.png) [@seth.yes](https://discuss.elastic.co/u/seth.yes)\
**Post date:** [July 22, 2016, 8:27pm UTC](https://discuss.elastic.co/t/monitor-size-of-single-directory/56038/7 "2016-07-22T20:27:58Z")

</div>

Good call, thank you!

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [July 22, 2016, 10:09pm UTC](https://discuss.elastic.co/t/monitor-size-of-single-directory/56038/8 "2016-07-22T22:09:51Z")

</div>

Another option... use curl to POST the data to the [logstash http input](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http.html).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 10, 2016, 11:08pm UTC](https://discuss.elastic.co/t/monitor-size-of-single-directory/56038/9 "2016-08-10T23:08:04Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
