# Two kinds of logs, the same grok

**URL:** <https://discuss.elastic.co/t/two-kinds-of-logs-the-same-grok/213369>\
**Category:** Logstash\
**Created:** [December 30, 2019, 4:52pm UTC](https://discuss.elastic.co/t/two-kinds-of-logs-the-same-grok/213369 "2019-12-30T16:52:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Incauto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/incauto/32/60149_2.png) [@Incauto](https://discuss.elastic.co/u/Incauto)\
**Post date:** [December 30, 2019, 4:52pm UTC](https://discuss.elastic.co/t/two-kinds-of-logs-the-same-grok/213369/1 "2019-12-30T16:52:32Z")

</div>

Hi, I have two kinds of logs. if the server is linux it display : "$1" after the string "Used disk space on", and if the server is windows display the letter of the drive: "C:"  
Logs:

```
12/28/19 21:59:10 server-hostname Used disk space on $1 (percentage) vfs.fs.size[/boot,pused] 23.2783

12/28/19 22:44:01 server-hostname Used disk space on C: (percentage) vfs.fs.size[C:,pused] 49.5835

12/28/19 21:54:02 server-hostname Used disk space on D: (percentage) vfs.fs.size[D:,pused] 41.7053

```

Grok:

```
%{DATA:date} %{TIME:time} %{DATA:hostname} Used disk space on ??? \(percentage\) vfs.fs.size\[%{DATA:disc},pused\] %{NUMBER:percent}

```

it is posible to parse the logs with the same grok, maybe ignorin those characters, represented by the three question marks

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [December 30, 2019, 5:26pm UTC](https://discuss.elastic.co/t/two-kinds-of-logs-the-same-grok/213369/2 "2019-12-30T17:26:02Z")

</div>

Why not use %{NOTSPACE} to match that?

---

<div class="post-metadata">

**Author:** ![Incauto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/incauto/32/60149_2.png) [@Incauto](https://discuss.elastic.co/u/Incauto)\
**Post date:** [December 30, 2019, 6:02pm UTC](https://discuss.elastic.co/t/two-kinds-of-logs-the-same-grok/213369/3 "2019-12-30T18:02:53Z")

</div>

Thanks again Badger!

```
%{DATA:date} %{TIME:time} %{DATA:hostname} Used disk space on \S+ \(percentage\) vfs.fs.size\[%{DATA:disc},pused\] %{NUMBER:percent}
```

---

<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:** [January 27, 2020, 6:14pm UTC](https://discuss.elastic.co/t/two-kinds-of-logs-the-same-grok/213369/4 "2020-01-27T18:14:43Z")

</div>

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