# Malformed Error

**URL:** <https://discuss.elastic.co/t/malformed-error/71151>\
**Category:** Logstash\
**Created:** [January 10, 2017, 9:02pm UTC](https://discuss.elastic.co/t/malformed-error/71151 "2017-01-10T21:02:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![romspacenut](https://avatars.discourse-cdn.com/v4/letter/r/96bed5/32.png) [@romspacenut](https://discuss.elastic.co/u/romspacenut)\
**Post date:** [January 10, 2017, 9:02pm UTC](https://discuss.elastic.co/t/malformed-error/71151/1 "2017-01-10T21:02:07Z")

</div>

Can't figure out these errors I've been seeing. Been seeing a lot of these kind errors in my logstash.log file:

`"caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"Invalid format: \"2017-01-10T12:36:22-08:00\" is malformed at \"17-01-10T12:36:22-08:00\""}}`

Here's my config:

```
filter {
  if [source] == "/var/log/test.log" {
    multiline {
        pattern => "^(%{SYSLOGTIMESTAMP:timestamp}|%{TIMESTAMP_ISO8601:timestamp})"
        what => "previous"
        negate=> true
    }

    grok {
      break_on_match => false
      match => ["message", "(%{SYSLOGTIMESTAMP:timestamp}|%{TIMESTAMP_ISO8601:timestamp})%{SPACE}%{WORD:severity} \(%{INT:severity_level}\)\:\s(?<vx_tid>[0-9a-zA-Z-]*)\s(HAR = )(?:(?<har_log>[^\t]*))" ]
    }

    date {
      match => ["timestamp", "yyyy-MM-dd'T'HH:mm:ssZZ"]
      timezone => "America/Los_Angeles"
    }
  }
}

```

Currently using logstash 2.3.4.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 10, 2017, 9:04pm UTC](https://discuss.elastic.co/t/malformed-error/71151/2 "2017-01-10T21:04:56Z")

</div>

Please show the full log message. I suspect the error message comes from ES rather than Logstash.

---

<div class="post-metadata">

**Author:** ![romspacenut](https://avatars.discourse-cdn.com/v4/letter/r/96bed5/32.png) [@romspacenut](https://discuss.elastic.co/u/romspacenut)\
**Post date:** [January 10, 2017, 9:33pm UTC](https://discuss.elastic.co/t/malformed-error/71151/3 "2017-01-10T21:33:48Z")

</div>

{:timestamp=\>"2017-01-10T21:19:19.084000+0000", :message=\>"Failed action. ", :status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"filebeat-smith-nginx-2017.01", :\_type=\>"log", :\_routing=\>nil}, #\<LogStash::Event:0x7e5e344d @metadata\_accessors=#\<LogStash::Util::Accessors:0x5f6c2c26 @store={"beat"=\>"filebeat-smith-nginx", "type"=\>"log"}, @lut={"[type]"=\>[{"beat"=\>"filebeat-smith-nginx", "type"=\>"log"}, "type"], "[beat]"=\>[{"beat"=\>"filebeat-smith-nginx", "type"=\>"log"}, "beat"]}\>, @cancelled=false, @data={"@timestamp"=\>"2017-01-10T21:19:10.000Z", "beat"=\>{"hostname"=\>"HOST-123", "name"=\>"HOST-123"}, "count"=\>1, "input\_type"=\>"log", "message"=\>"2017-01-10T13:19:10-08:00 HEAVYINFO (8): tId-e3789f2da5313c1847d560f7013b3e0f HAR = {\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}", "offset"=\>224089479, "source"=\>"/var/log/request.log", "type"=\>"log", "@version"=\>"1", "mid"=\>"smith-nginx.stage", "timestamp"=\>"2017-01-10T13:19:10-08:00", "severity"=\>"HEAVYINFO", "severity\_level"=\>"8", "tid"=\>"tId-e3789f2da5313c1847d560f7013b3e0f", "har\_log"=\>"{\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}"}, @metadata={"beat"=\>"filebeat-smith-nginx", "type"=\>"log"}, @accessors=#\<LogStash::Util::Accessors:0x4643fbe0 @store={"@timestamp"=\>"2017-01-10T21:19:10.000Z", "beat"=\>{"hostname"=\>"HOST-123", "name"=\>"HOST-123"}, "count"=\>1, "input\_type"=\>"log", "message"=\>"2017-01-10T13:19:10-08:00 HEAVYINFO (8): tId-e3789f2da5313c1847d560f7013b3e0f HAR = {\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}", "offset"=\>224089479, "source"=\>"/var/log/request.log", "type"=\>"log", "@version"=\>"1", "mid"=\>"smith-nginx.stage", "timestamp"=\>"2017-01-10T13:19:10-08:00", "severity"=\>"HEAVYINFO", "severity\_level"=\>"8", "tid"=\>"tId-e3789f2da5313c1847d560f7013b3e0f",

---

<div class="post-metadata">

**Author:** ![romspacenut](https://avatars.discourse-cdn.com/v4/letter/r/96bed5/32.png) [@romspacenut](https://discuss.elastic.co/u/romspacenut)\
**Post date:** [January 10, 2017, 9:34pm UTC](https://discuss.elastic.co/t/malformed-error/71151/4 "2017-01-10T21:34:32Z")

</div>

"har\_log"=\>"{\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}"}, @lut={"message"=\>[{"@timestamp"=\>"2017-01-10T21:19:10.000Z", "beat"=\>{"hostname"=\>"HOST-123", "name"=\>"HOST-123"}, "count"=\>1, "input\_type"=\>"log", "message"=\>"2017-01-10T13:19:10-08:00 HEAVYINFO (8): tId-e3789f2da5313c1847d560f7013b3e0f HAR = {\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}", "offset"=\>224089479, "source"=\>"/var/log/request.log", "type"=\>"log", "@version"=\>"1", "mid"=\>"smith-nginx.stage", "timestamp"=\>"2017-01-10T13:19:10-08:00", "severity"=\>"HEAVYINFO", "severity\_level"=\>"8", "tid"=\>"tId-e3789f2da5313c1847d560f7013b3e0f", "har\_log"=\>"{\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}"}, "message"], "timestamp"=\>[{"@timestamp"=\>"2017-01-10T21:19:10.000Z", "beat"=\>{"hostname"=\>"HOST-123", "name"=\>"HOST-123"}, "count"=\>1, "input\_type"=\>"log", "message"=\>"2017-01-10T13:19:10-08:00 HEAVYINFO (8): tId-e3789f2da5313c1847d560f7013b3e0f HAR = {\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}", "offset"=\>224089479, "source"=\>"/var/log/request.log", "type"=\>"log", "@version"=\>"1", "mid"=\>"smith-nginx.stage", "timestamp"=\>"2017-01-10T13:19:10-08:00", "severity"=\>"HEAVYINFO", "severity\_level"=\>"8", "tid"=\>"tId-e3789f2da5313c1847d560f7013b3e0f", "har\_log"=\>"{\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}"}, "timestamp"], "severity"=\>[{"@timestamp"=\>"2017-01-10T21:19:10.000Z", "beat"=\>{"hostname"=\>"HOST-123", "name"=\>"HOST-123"}, "count"=\>1, "input\_type"=\>"log", "message"=\>"2017-01-10T13:19:10-08:00 HEAVYINFO (8): tId-e3789f2da5313c1847d560f7013b3e0f HAR = {\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}", "offset"=\>224089479, "source"=\>"/var/log/request.log", "type"=\>"log", "@version"=\>"1", "mid"=\>"smith-nginx.stage", "timestamp"=\>"2017-01-10T13:19:10-08:00", "severity"=\>"HEAVYINFO", "severity\_level"=\>"8", "tid"=\>"tId-e3789f2da5313c1847d560f7013b3e0f", "har\_log"=\>"{\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}"}, "severity"], "severity\_level"=\>[{"@timestamp"=\>"2017-01-10T21:19:10.000Z", "beat"=\>{"hostname"=\>"HOST-123", "name"=\>"HOST-123"}, "count"=\>1, "input\_type"=\>"log", "message"=\>"2017-01-10T13:19:10-08:00 HEAVYINFO (8): tId-e3789f2da5313c1847d560f7013b3e0f HAR = {\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}", "offset"=\>224089479, "source"=\>"/var/log/request.log", "type"=\>"log", "@version"=\>"1", "mid"=\>"smith-nginx.stage", "timestamp"=\>"2017-01-10T13:19:10-08:00", "severity"=\>"HEAVYINFO", "severity\_level"=\>"8", "tid"=\>"tId-e3789f2da5313c1847d560f7013b3e0f", "har\_log"=\>"{\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}"}, "severity\_level"], "tid"=\>[{"@timestamp"=\>"2017-01-10T21:19:10.000Z", "beat"=\>{"hostname"=\>"HOST-123", "name"=\>"HOST-123"}, "count"=\>1, "input\_type"=\>"log", "message"=\>"2017-01-10T13:19:10-08:00 HEAVYINFO (8): tId-e3789f2da5313c1847d560f7013b3e0f HAR = {\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}",

---

<div class="post-metadata">

**Author:** ![romspacenut](https://avatars.discourse-cdn.com/v4/letter/r/96bed5/32.png) [@romspacenut](https://discuss.elastic.co/u/romspacenut)\
**Post date:** [January 10, 2017, 9:34pm UTC](https://discuss.elastic.co/t/malformed-error/71151/5 "2017-01-10T21:34:44Z")

</div>

"offset"=\>224089479, "source"=\>"/var/log/request.log", "type"=\>"log", "@version"=\>"1", "mid"=\>"smith-nginx.stage", "timestamp"=\>"2017-01-10T13:19:10-08:00", "severity"=\>"HEAVYINFO", "severity\_level"=\>"8", "tid"=\>"tId-e3789f2da5313c1847d560f7013b3e0f", "har\_log"=\>"{\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}"}, "tid"], "har\_log"=\>[{"@timestamp"=\>"2017-01-10T21:19:10.000Z", "beat"=\>{"hostname"=\>"HOST-123", "name"=\>"HOST-123"}, "count"=\>1, "input\_type"=\>"log", "message"=\>"2017-01-10T13:19:10-08:00 HEAVYINFO (8): tId-e3789f2da5313c1847d560f7013b3e0f HAR = {\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}", "offset"=\>224089479, "source"=\>"/var/log/request.log", "type"=\>"log", "@version"=\>"1", "mid"=\>"smith-nginx.stage", "timestamp"=\>"2017-01-10T13:19:10-08:00", "severity"=\>"HEAVYINFO", "severity\_level"=\>"8", "tid"=\>"tId-e3789f2da5313c1847d560f7013b3e0f", "har\_log"=\>"{\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}"}, "har\_log"], "@timestamp"=\>[{"@timestamp"=\>"2017-01-10T21:19:10.000Z", "beat"=\>{"hostname"=\>"HOST-123", "name"=\>"HOST-123"}, "count"=\>1, "input\_type"=\>"log", "message"=\>"2017-01-10T13:19:10-08:00 HEAVYINFO (8): tId-e3789f2da5313c1847d560f7013b3e0f HAR = {\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}", "offset"=\>224089479, "source"=\>"/var/log/request.log", "type"=\>"log", "@version"=\>"1", "mid"=\>"smith-nginx.stage", "timestamp"=\>"2017-01-10T13:19:10-08:00", "severity"=\>"HEAVYINFO", "severity\_level"=\>"8", "tid"=\>"tId-e3789f2da5313c1847d560f7013b3e0f", "har\_log"=\>"{\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}"}, "@timestamp"], "[source]"=\>[{"@timestamp"=\>"2017-01-10T21:19:10.000Z", "beat"=\>{"hostname"=\>"HOST-123", "name"=\>"HOST-123"}, "count"=\>1, "input\_type"=\>"log", "message"=\>"2017-01-10T13:19:10-08:00 HEAVYINFO (8): tId-e3789f2da5313c1847d560f7013b3e0f HAR = {\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}", "offset"=\>224089479, "source"=\>"/var/log/request.log", "type"=\>"log", "@version"=\>"1", "mid"=\>"smith-nginx.stage", "timestamp"=\>"2017-01-10T13:19:10-08:00", "severity"=\>"HEAVYINFO", "severity\_level"=\>"8", "tid"=\>"tId-e3789f2da5313c1847d560f7013b3e0f", "har\_log"=\>"{\n "log": {\n "version": "1.2",\n "creator": {\n "name": "Sample Harchive",\n "version": "0.1",\n "comment": "SERVER\_NAME: api.sample.local"\n },\n "entries": [\n\n]\n }\n}"}, "source"]}\>\>], :response=\>{"create"=\>{"\_index"=\>"filebeat-smith-nginx-2017.01", "\_type"=\>"log", "\_id"=\>"AVmKP-Ai3MMKPhA1Iw0h", "status"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse [timestamp]", "caused\_by"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"Invalid format: "2017-01-10T13:19:10-08:00" is malformed at "17-01-10T13:19:10-08:00""}}}}, :level=\>:warn}

---

<div class="post-metadata">

**Author:** ![romspacenut](https://avatars.discourse-cdn.com/v4/letter/r/96bed5/32.png) [@romspacenut](https://discuss.elastic.co/u/romspacenut)\
**Post date:** [January 10, 2017, 9:35pm UTC](https://discuss.elastic.co/t/malformed-error/71151/6 "2017-01-10T21:35:21Z")

</div>

Sorry for the multiple posts, that was one single entry.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 11, 2017, 6:39am UTC](https://discuss.elastic.co/t/malformed-error/71151/7 "2017-01-11T06:39:26Z")

</div>

Okay, it's ES that's complaining. What's the mapping of the `timestamp` field? Use ES's get mapping API.

---

<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:** [February 8, 2017, 6:39am UTC](https://discuss.elastic.co/t/malformed-error/71151/8 "2017-02-08T06:39:28Z")

</div>

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