Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to convert epoch (Unix timestamp) into timestamp

How to convert epoch (Unix timestamp) into timestamp

83458-covertproccessor.png

83459-csvreader-settings.png

83460-json-writter-setting.png

Hi,

I want to convert one column of my CSV file which is named as "EpochWithMicroSec", datatype -> epoch. I want to convert this column into 'Timestamp' and pass it to elasticsearch to visualize logs against time in kibana. Following attached is the error i am getting on using the 'ConvertRecord' processor and attaching the screenshots of properties i have configured.

    1 REPLY 1
    Highlighted

    Re: How to convert epoch (Unix timestamp) into timestamp

    Super Collaborator

    Hi @shraddha srivastav,

    Apperently you try to convert string field into the time stamp.

    on your record schema at the source end you shoud define the data type as long instead of string for EpochWithMicroSec

    under the fields secton

    {"name":"EpochWithMicroSec","type":{"type":"long","logicalType":"timestamp-millis"}}

    so that the conversion shall be able to perform from source to target.

    hope this helps!!

    Don't have an account?
    Coming from Hortonworks? Activate your account here