# Report cwd in metricbeat system process

**URL:** <https://discuss.elastic.co/t/report-cwd-in-metricbeat-system-process/75567>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [February 17, 2017, 10:33pm UTC](https://discuss.elastic.co/t/report-cwd-in-metricbeat-system-process/75567 "2017-02-17T22:33:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcenirm](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@mcenirm](https://discuss.elastic.co/u/mcenirm)\
**Post date:** [February 17, 2017, 10:33pm UTC](https://discuss.elastic.co/t/report-cwd-in-metricbeat-system-process/75567/1 "2017-02-17T22:33:11Z")

</div>

I need metricbeat's system process metricset to report current working directory (cwd).

I have a fork at [https://github.com/mcenirm/beats/tree/report\_cwd](https://github.com/mcenirm/beats/tree/report_cwd) (based on v5.2.1) that passes tests [https://travis-ci.org/mcenirm/beats/builds/202678818](https://travis-ci.org/mcenirm/beats/builds/202678818)

It was straightforward to use gosigar's ProcExe, at least for linux. I had to skip the test on darwin since gosigar doesn't get cwd, and libproc.h is not a public interface anyway. I have not checked freebsd and windows.

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [February 21, 2017, 8:23am UTC](https://discuss.elastic.co/t/report-cwd-in-metricbeat-system-process/75567/2 "2017-02-21T08:23:12Z")

</div>

@mcenirm Perhaps you can open a PR agains the beats repo so we can discuss directly based on the code if it makes sense to get it into beats and how we could fix / improve it for other platforms.

---

<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:** [March 21, 2017, 8:23am UTC](https://discuss.elastic.co/t/report-cwd-in-metricbeat-system-process/75567/3 "2017-03-21T08:23:13Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
