# I am getting (NoMethodError) undefined method \`to\_time' for 2016-09-09T17:57:40.873Z:LogStash::Timestamp

**URL:** <https://discuss.elastic.co/t/i-am-getting-nomethoderror-undefined-method-to-time-for-2016-09-09t1740-873z-timestamp/232311>\
**Category:** Logstash\
**Created:** [May 12, 2020, 7:50pm UTC](https://discuss.elastic.co/t/i-am-getting-nomethoderror-undefined-method-to-time-for-2016-09-09t1740-873z-timestamp/232311 "2020-05-12T19:50:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navaneetha\_KrishnanR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/navaneetha_krishnanr/32/48731_2.png) [@Navaneetha\_KrishnanR](https://discuss.elastic.co/u/Navaneetha_KrishnanR)\
**Post date:** [May 12, 2020, 7:50pm UTC](https://discuss.elastic.co/t/i-am-getting-nomethoderror-undefined-method-to-time-for-2016-09-09t1740-873z-timestamp/232311/1 "2020-05-12T19:50:17Z")

</div>

When i trying to get the Date field from the MSSQL via logstash I am getting the following error :

Caused by: org.jruby.exceptions.NoMethodError: (NoMethodError) undefined method `to\_time' for 2016-09-09T17:57:40.873Z:LogStash::Timestamp  
at usr.share.logstash.vendor.bundle.jruby.$2\_dot\_5\_dot\_0.gems.avro\_minus\_1\_dot\_9\_dot\_2.lib.avro.logical\_types.encode(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/avro-1.9.2/lib/avro/logical\_types.rb:40)  
at usr.share

Note : One of the options tried with no luck:

mutate{  
convert =\> {  
Sample\_date" =\> "string"

}  
}  
date{  
match =\> ["Sample\_date","YYYY-MM-dd'T'HH:mm:ss'.'SSS'Z'"]  
timezone =\> "Etc/UTC"  
target =\> "Sample\_date"  
}

I am using Avro codec plugin to validate the schema like :  
kafka {  
codec =\> avro {  
schema\_uri =\> "/etc/logstash/conf.d/test\_schema.avsc"  
}  
topic\_id =\> "test\_dev"  
}

---

<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 9, 2020, 7:53pm UTC](https://discuss.elastic.co/t/i-am-getting-nomethoderror-undefined-method-to-time-for-2016-09-09t1740-873z-timestamp/232311/2 "2020-06-09T19:53:02Z")

</div>

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