Convert a column in csv to hour time

excel
I have these 2 cells the first is Day which was converted fine using the date filter but the HOUR column is appearing as a random date time stamp with no hours

my logstash date config:

date {
match => ["DAY", "M/d/yyyy", "M/dd/yyyy", "MM/d/yyyy", "MM/dd/yyyy"]
target => "DAY"
locale => "en"
timezone => "UTC"

}
date {
match => ["HOUR", "H"]
target => "HOUR"
locale => "en"
timezone => "UTC"

}
how the hour appearing on elastic search
"HOUR" : "2019-01-01T00:00:00.000Z",
I want the hour column to appear as hours of each day

ruby { code => 'event.set("HOUR", LogStash::Timestamp.new(event.get("DAY")+ 3600 * event.get("HOUR")))' }

Error handling is left as an exercise for the reader.

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