# Grok parse failure for django logs

**URL:** <https://discuss.elastic.co/t/grok-parse-failure-for-django-logs/86370>\
**Category:** Logstash\
**Created:** [May 19, 2017, 7:32am UTC](https://discuss.elastic.co/t/grok-parse-failure-for-django-logs/86370 "2017-05-19T07:32:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sLuvpreet33](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sluvpreet33/32/50626_2.png) [@sLuvpreet33](https://discuss.elastic.co/u/sLuvpreet33)\
**Post date:** [May 19, 2017, 7:32am UTC](https://discuss.elastic.co/t/grok-parse-failure-for-django-logs/86370/1 "2017-05-19T07:32:31Z")

</div>

This is 1 of my log entries,

```
INFO 2017-05-16 17:24:11,690 views 14463 139643033982720 https://play.google.com/store/apps/details?id=com.VoDrive&referrer=referral_code%3DP5E

```

This is my pattern ,

```
DJANGOTIMESTAMP %{YEAR}-%{MONTHNUM}-%{MONTHDAY} %{HOUR}:%{MINUTE}:%{SECOND}

DJANGOLOG %{LOGLEVEL:loglevel} %{DJANGOTIMESTAMP:timestamp},{INT:pid} %{WORD:origin} %{INT:id} %{INT:number} %{GREEDYDATA:action}

```

This is my logstash conf file,

```
    if[type] == "django" {
        grok {
         patterns_dir => ["/opt/logstash/patterns/"]
         match => ["message" , "%{DJANGOLOG}"]
        overwrite => ["message"]
        }
    }

```

But still this parser fails, what is wrong here ?

What am I lacking ? @magnusbaeck help ?

---

<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:** [May 20, 2017, 11:24pm UTC](https://discuss.elastic.co/t/grok-parse-failure-for-django-logs/86370/2 "2017-05-20T23:24:27Z")

</div>

A quick glance says your timestamp is not correct, it's missing milliseconds.

> [@sLuvpreet33](#):
>
> What am I lacking ? @magnusbaeck help ?

Please don't do that. Magnus volunteers his time here and you wanting an answer doesn't mean you can just summon him as desired.

---

<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 17, 2017, 11:24pm UTC](https://discuss.elastic.co/t/grok-parse-failure-for-django-logs/86370/3 "2017-06-17T23:24:29Z")

</div>

Closed on June 17, 2017, 11:24pm UTC

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