# Logstash and Grok filter problem with username

**URL:** <https://discuss.elastic.co/t/logstash-and-grok-filter-problem-with-username/246130>\
**Category:** Logstash\
**Created:** [August 24, 2020, 2:05pm UTC](https://discuss.elastic.co/t/logstash-and-grok-filter-problem-with-username/246130 "2020-08-24T14:05:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcoa](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@mcoa](https://discuss.elastic.co/u/mcoa)\
**Post date:** [August 24, 2020, 2:05pm UTC](https://discuss.elastic.co/t/logstash-and-grok-filter-problem-with-username/246130/1 "2020-08-24T14:05:15Z")

</div>

Hi,  
I try parser apache (access\_log) log but i've problem with username section (not capture the complete name), log example:

```auto
10.13.252.185 - - [23/Aug/2020:23:56:14 -0400] "PROPFIND /remote.php/dav/files/JF009-01/PAPER/00022/document.txt HTTP/1.1" 207 1132 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36"

```

My Grok filter is:

```auto
    grok {
      match => { "message" => '%{IPORHOST:clientip} - - \[%{HTTPDATE:timestamp}\] "%{WORD:Method} %{NOTSPACE:url}/%{NOTSPACE:user}/%{DATA:file} HTTP/%{NUMBER:httpversion}\" %{NUMBER:response} %{WORD:response_time}'
      }
    }

```

Where the username is: `JF009-01` , but the filter only capture `JF009` and the other section is captured inside folder tag .

```auto
{
  "clientip": [
    [
      "10.13.252.185"
    ]
  ],
  "HOSTNAME": [
    [
      "10.13.252.185"
    ]
  ],
  "IP": [
    [
      null
    ]
  ],
  "IPV6": [
    [
      null
    ]
  ],
  "IPV4": [
    [
      null
    ]
  ],
  "timestamp": [
    [
      "23/Aug/2020:23:56:14 -0400"
    ]
  ],
  "MONTHDAY": [
    [
      "23"
    ]
  ],
  "MONTH": [
    [
      "Aug"
    ]
  ],
  "YEAR": [
    [
      "2020"
    ]
  ],
  "TIME": [
    [
      "23:56:14"
    ]
  ],
  "HOUR": [
    [
      "23"
    ]
  ],
  "MINUTE": [
    [
      "56"
    ]
  ],
  "SECOND": [
    [
      "14"
    ]
  ],
  "INT": [
    [
      "-0400"
    ]
  ],
  "Method": [
    [
      "PROPFIND"
    ]
  ],
  "user": [
    [
      "JF009"
    ]
  ],
  "folder": [
    [
      "-01/PAPER/00022"
    ]
  ],
  "file": [
    [
      "document.txt"
    ]
  ],
  "httpversion": [
    [
      "1.1"
    ]
  ],
  "BASE10NUM": [
    [
      "1.1",
      "207"
    ]
  ],
  "response": [
    [
      "207"
    ]
  ],
  "response_time": [
    [
      "1132"
    ]
  ]
}

```

Any suggestions

Thanks

---

<div class="post-metadata">

**Author:** ![Jenni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jenni/32/29684_2.png) [@Jenni](https://discuss.elastic.co/u/Jenni)\
**Post date:** [August 24, 2020, 2:16pm UTC](https://discuss.elastic.co/t/logstash-and-grok-filter-problem-with-username/246130/2 "2020-08-24T14:16:30Z")

</div>

The pattern and result that you posted do not fit together. There is no `folder` in your grok configuration.

---

<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:** [September 21, 2020, 2:16pm UTC](https://discuss.elastic.co/t/logstash-and-grok-filter-problem-with-username/246130/3 "2020-09-21T14:16:51Z")

</div>

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