logstash-plugins / logstash-input-cloudwatch

A Logstash input to pull events from the Amazon Web Services CloudWatch API
Apache License 2.0
43 stars 27 forks source link

Metric timestamp #23

Closed lboudard closed 5 years ago

lboudard commented 7 years ago

Hi,

I'm trying to use this plugin to import custom metrics. Though, I noticed that metric's stats timestamp was overriden by end_time of the requested period, which sounds inconsistent to me.

  def cleanup(event)
    event.delete :statistics
    event.delete :dimensions
    event[:start_time] = Time.parse(event[:start_time]).utc
    event[:end_time]   = Time.parse(event[:end_time]).utc
    event[:timestamp]  = event[:end_time]
    LogStash::Util.stringify_symbols(event)
  end

Any reason for this behavior? Thanks!

rahulsinghai commented 6 years ago

Following line should be removed:

event[:timestamp]  = event[:end_time]
Jeck-96 commented 6 years ago

Hi,

I agree with you, I noticed the same thing. In the configuration file to import data from cloudwatch to elasticsearch I choosed an interval of 15 minutes and a period of 5 minutes. In elasticsearch it upload two document foreach interval, each document refers data of a period. So each document shuld be spaced five minutes, but in the same interval, they have got the same timestamp field. It's possible solve the issue?

nerophon commented 5 years ago

@robbavey presumably this is fixed now? Can we close it?

robbavey commented 5 years ago

@nerophon Yes, thank you for the reminder