# Parsing timestamp: NumberFormatException

**URL:** <https://discuss.elastic.co/t/parsing-timestamp-numberformatexception/10753>\
**Category:** Elasticsearch\
**Created:** [February 15, 2013, 11:17am UTC](https://discuss.elastic.co/t/parsing-timestamp-numberformatexception/10753 "2013-02-15T11:17:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SimonMo](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@SimonMo](https://discuss.elastic.co/u/SimonMo)\
**Post date:** [February 15, 2013, 11:17am UTC](https://discuss.elastic.co/t/parsing-timestamp-numberformatexception/10753/1 "2013-02-15T11:17:20Z")

</div>

Hi,

i try to store my log4j messages in ES.

log4j -\> flume -\> ES

So in flume i use a regex\_extractor to write the timestamp in a field  
called 'timestamp'

timestamp = "2013-02-15T12:01:37.089+01"

Now i want to use this field in ES:

"\_timestamp" : {  
"enabled" : true,  
"format" : "yyyy-MM-ddTHH:mm:ss.SSSZ"  
}

i also try to set the date\_format to date\_hour\_minute\_second\_millis but i  
always get

"java.lang.NumberFormatException: For input string:  
"2013-02-15T12:01:37.089+01""

Can anybody help me to solve this problem?

Regards,  
Simon

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![drewr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewr/32/7803_2.png) [@drewr](https://discuss.elastic.co/u/drewr)\
**Post date:** [February 15, 2013, 2:51pm UTC](https://discuss.elastic.co/t/parsing-timestamp-numberformatexception/10753/2 "2013-02-15T14:51:24Z")

</div>

Simon Monecke wrote:

> timestamp = "2013-02-15T12:01:37.089+01"
> 
> Now i want to use this field in ES:
> 
> "\_timestamp" : {  
> "enabled" : true,  
> "format" : "yyyy-MM-ddTHH:mm:ss.SSSZ"  
> }
> 
> i also try to set the date\_format to date\_hour\_minute\_second\_millis but i  
> always get
> 
> "java.lang.NumberFormatException: For input string:  
> "2013-02-15T12:01:37.089+01""
> 
> Can anybody help me to solve this problem?

The default "dateOptionalTime" format parses your timestamp  
successfully.

"2013-02-15T12:01:37.089+01" --\> 1360926097089

Start off with no mapping and build up from there. ES has very  
sensible defaults. It's better to throw data at ES and only fix what  
doesn't work.

-Drew

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:51am UTC](https://discuss.elastic.co/t/parsing-timestamp-numberformatexception/10753/3 "2017-07-06T02:51:19Z")

</div>


