logstash-plugins / logstash-output-influxdb

Apache License 2.0
58 stars 77 forks source link

Move coerce method call before time creation #35

Closed IngaFeick closed 6 years ago

IngaFeick commented 8 years ago

Hi,

I had a problem with type conversion on the @timestamp field. My config is as follows:

data_points =>
{
   "time" => "%{@timestamp}"   
  "value" => "%{value}"
}
allow_time_override => true 
coerce_values =>
{
   "time" => "integer"
}

which did not work because of an ordering problem in the code: the coerce method is executed after the initialization of the time field. As a consequence, the output would contain iso8601 timestamp representations and cause error messages from the database. I have rearranged the order and now it works like a charm.

elasticsearch-release commented 8 years ago

Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'.