# Invalid malformaed date

**URL:** <https://discuss.elastic.co/t/invalid-malformaed-date/78459>\
**Category:** Logstash\
**Created:** [March 14, 2017, 7:48am UTC](https://discuss.elastic.co/t/invalid-malformaed-date/78459 "2017-03-14T07:48:59Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)\
**Post date:** [March 14, 2017, 7:48am UTC](https://discuss.elastic.co/t/invalid-malformaed-date/78459/1 "2017-03-14T07:48:59Z")

</div>

Hi,  
Im facing below error while processing log kindly help me to resolve the issue,

Error:

```
Failed parsing date from field {:field=>"iis_eventDate", :value=>"2017-03-12 02:01:43", :exception=>"Cannot parse \"2017-03-12 02:01:43\": Illegal instant due to time zone offset transition (America/Los_Angeles)", :config_parsers=>"YYYY-MM-dd HH:mm:ss", :config_locale=>"default=en_US", :level=>:warn}
NoMethodError: undefined method `>=' for nil:NilClass
    output_func at (eval):2918
   output_batch at /beep/envs/beep/software/logstash-2.3.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.0-java/lib/logstash/pipeline.rb:297
           each at org/jruby/RubyArray.java:1613
         inject at org/jruby/RubyEnumerable.java:852
   output_batch at /beep/envs/beep/software/logstash-2.3.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.0-java/lib/logstash/pipeline.rb:291
    worker_loop at /beep/envs/beep/software/logstash-2.3.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.0-java/lib/logstash/pipeline.rb:236
  start_workers at /beep/envs/beep/software/logstash-2.3.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.0-java/lib/logstash/pipeline.rb:205

```

Input:  
`2017-03-12 02:01:43 aaa POST xxx yyy 80 reynaj zzz Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/56.0.2924.87+Safari/537.36 200 0 0 942`

Code;  
request\_date:2017-03-12  
request\_time:02:01:43

```
    mutate {
        add_field => {
          
    	  "iis_eventDate" => "%{request_date} %{request_time}"
        }
      }
    date { 
          match => ["iis_eventDate", "YYYY-MM-dd HH:mm:ss"] 
    	  target => ["iis_eventDate"]     
        }
```

---

<div class="post-metadata">

**Author:** ![JeremyinNC](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremyinnc/32/44868_2.png) [@JeremyinNC](https://discuss.elastic.co/u/JeremyinNC)\
**Post date:** [March 14, 2017, 12:20pm UTC](https://discuss.elastic.co/t/invalid-malformaed-date/78459/2 "2017-03-14T12:20:12Z")

</div>

> [@Ganesh2303](#):
>
> target =\> ["iis\_eventDate"]

I don't think you should be specifying the target in this case.

---

<div class="post-metadata">

**Author:** ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)\
**Post date:** [March 14, 2017, 12:38pm UTC](https://discuss.elastic.co/t/invalid-malformaed-date/78459/3 "2017-03-14T12:38:41Z")

</div>

@JeremyinNC

If i command target line also it replicate same error ☹

---

<div class="post-metadata">

**Author:** ![JeremyinNC](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremyinnc/32/44868_2.png) [@JeremyinNC](https://discuss.elastic.co/u/JeremyinNC)\
**Post date:** [March 14, 2017, 12:46pm UTC](https://discuss.elastic.co/t/invalid-malformaed-date/78459/4 "2017-03-14T12:46:06Z")

</div>

Do you need to use lowercase "y" for year? I don't see capital Y for year anywhere in the docs.

```
match => ["iis_eventDate", "yyyy-MM-dd HH:mm:ss"]
```

---

<div class="post-metadata">

**Author:** ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)\
**Post date:** [March 14, 2017, 12:49pm UTC](https://discuss.elastic.co/t/invalid-malformaed-date/78459/5 "2017-03-14T12:49:05Z")

</div>

Okay, Let me check with lowercase "y" and let you know but i have tell on thing previously it was working fine with same condition last 3 days only it not processing any logs.

---

<div class="post-metadata">

**Author:** ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)\
**Post date:** [March 14, 2017, 12:52pm UTC](https://discuss.elastic.co/t/invalid-malformaed-date/78459/6 "2017-03-14T12:52:00Z")

</div>

@JeremyinNC

When i try with lowercase "yyyy", it replicate the same error.

---

<div class="post-metadata">

**Author:** ![JeremyinNC](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremyinnc/32/44868_2.png) [@JeremyinNC](https://discuss.elastic.co/u/JeremyinNC)\
**Post date:** [March 14, 2017, 12:56pm UTC](https://discuss.elastic.co/t/invalid-malformaed-date/78459/7 "2017-03-14T12:56:29Z")

</div>

What about the following (are your time stamps zulu (UTC) time)?

```
"iis_eventDate" => "%{request_date}:%{request_time} Z"

 match => [ "iis_eventDate" , "dd/MMM/yyyy:HH:mm:ss Z"
```

---

<div class="post-metadata">

**Author:** ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)\
**Post date:** [March 14, 2017, 1:20pm UTC](https://discuss.elastic.co/t/invalid-malformaed-date/78459/8 "2017-03-14T13:20:24Z")

</div>

@JeremyinNC  
Still pursuit same issue ☹

---

<div class="post-metadata">

**Author:** ![JeremyinNC](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremyinnc/32/44868_2.png) [@JeremyinNC](https://discuss.elastic.co/u/JeremyinNC)\
**Post date:** [March 14, 2017, 2:03pm UTC](https://discuss.elastic.co/t/invalid-malformaed-date/78459/9 "2017-03-14T14:03:04Z")

</div>

What does the mapping for your index show as the type for iis\_eventDate?

---

<div class="post-metadata">

**Author:** ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)\
**Post date:** [March 15, 2017, 5:54am UTC](https://discuss.elastic.co/t/invalid-malformaed-date/78459/10 "2017-03-15T05:54:34Z")

</div>

@JeremyinNC

Please find the below mapping  
name : iis\_eventDate  
Type: date

---

<div class="post-metadata">

**Author:** ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)\
**Post date:** [March 15, 2017, 9:38am UTC](https://discuss.elastic.co/t/invalid-malformaed-date/78459/11 "2017-03-15T09:38:50Z")

</div>

@JeremyinNC

Now im getting this error also,

`Unknown error while looking up GeoIP data {:exception=>#<Errno::EBADF: Bad file descriptor - Bad file descriptor>, :field=>"request_remoteIP", :event=>2017-03-15T09:20:38.600Z xxx 2017-03-10 14:44:42 11111 POST /Parts/ConfirmationReport/GetPartOrderLineItemsConfirmation |11|22|33|44|55| 80 jonesj158 123.34.5.00 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/7.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E;+InfoPath.3) 200 0 0 184, :level=>:error}`

Input:

`2017-03-10 14:44:42 11111 POST /Parts/ConfirmationReport/GetPartOrderLineItemsConfirmation |11|22|33|44|55| 80 jonesj158 123.34.5.00 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/7.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E;+InfoPath.3) 200 0 0 184`

you can find the event is diff compare with input. using csv filter to create fields

---

<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:** [April 12, 2017, 9:38am UTC](https://discuss.elastic.co/t/invalid-malformaed-date/78459/12 "2017-04-12T09:38:51Z")

</div>

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