logstash/logstash — pull request #699 by kppullin (2013-10-07 00:18:07+00:00)
Title: Fix for syslog output timestamp formatting errors (LOGSTASH-1423)

This is a slightly alternative approach to PR #692 to address LOGSTASH-1423.

The advantages here are:
- We avoid the call to `event.sprintf(@timestamp)`. The `sprintf`implementation runs a regex and then converts the matched item to a string.
- When the event's `@timestamp` value is already a `Time` instance, we avoid the overhead of calling `Time.parse`.

Note: I haven't profiled this and assume it's faster, though perhaps only on a "micro" scale.

My logstash knowledge is limited at this point, so I'm not sure if removing the `event.sprintf(@timestamp)` call will break existing configs. However since the code is already written (the JIRA issue didn't exist when I ran into this problem a couple weeks ago), I figure it doesn't hurt to propose this change : )