# LogPathMatcher cannot work correctly because of the os specified char "/"

**URL:** <https://discuss.elastic.co/t/logpathmatcher-cannot-work-correctly-because-of-the-os-specified-char/131409>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 11, 2018, 6:31am UTC](https://discuss.elastic.co/t/logpathmatcher-cannot-work-correctly-because-of-the-os-specified-char/131409 "2018-05-11T06:31:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaku\_li](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@kaku\_li](https://discuss.elastic.co/u/kaku_li)\
**Post date:** [May 11, 2018, 6:31am UTC](https://discuss.elastic.co/t/logpathmatcher-cannot-work-correctly-because-of-the-os-specified-char/131409/1 "2018-05-11T06:31:22Z")

</div>

**file** : [https://github.com/elastic/beats/blob/a6e232f633480603d7a7e99773841bdc4fa64a62/filebeat/processor/add\_kubernetes\_metadata/matchers.go](https://github.com/elastic/beats/blob/a6e232f633480603d7a7e99773841bdc4fa64a62/filebeat/processor/add_kubernetes_metadata/matchers.go)

**line** : 42

**code** :

```auto
if logPath[len(logPath)-1:] != "/" {
		logPath = logPath + "/"
	}

```

there should be use _os.Separator_ or _filepath.Separator_ instead of the char "/"

---

<div class="post-metadata">

**Author:** ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)\
**Post date:** [May 11, 2018, 6:58am UTC](https://discuss.elastic.co/t/logpathmatcher-cannot-work-correctly-because-of-the-os-specified-char/131409/2 "2018-05-11T06:58:02Z")

</div>

Could you please open a PR on Github with the fix?

---

<div class="post-metadata">

**Author:** ![kaku\_li](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@kaku\_li](https://discuss.elastic.co/u/kaku_li)\
**Post date:** [May 16, 2018, 1:58am UTC](https://discuss.elastic.co/t/logpathmatcher-cannot-work-correctly-because-of-the-os-specified-char/131409/3 "2018-05-16T01:58:49Z")

</div>

I have created a PR

---

<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:** [June 13, 2018, 1:58am UTC](https://discuss.elastic.co/t/logpathmatcher-cannot-work-correctly-because-of-the-os-specified-char/131409/4 "2018-06-13T01:58:50Z")

</div>

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