You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Manish Rangari <li...@gmail.com> on 2016/09/21 13:23:19 UTC

Extracting data from ELB log date format

Guys,

I am trying to extract date, time, month, minute etc from below timestamp
format but did not find any function for this. Can anyone help me to
extract the details?

2016-09-15T23:45:22.943762Z
2016-09-15T23:45:22.948829Z

--Manish

Re: Extracting data from ELB log date format

Posted by Manish Rangari <li...@gmail.com>.
Thanks Nichole and Dudu for the reply. I got what I was looking for.

--Manish

On Thu, Sep 22, 2016 at 2:52 AM, Markovitz, Dudu <dm...@paypal.com>
wrote:

> select to_date(ts),year(ts),month(ts),day(ts),hour(ts),minute(ts),second(ts)
> from (select from_unixtime (unix_timestamp ('2016-09-15T23:45:22.943762Z',"yyyy-MM-dd'T'HH:mm:ss"))
> as ts) as t;
>
> OK
>
> 2016-09-15 2016 9    15   23   45   22
>
>
>
> Dudu
>
>
>
> *From:* Manish Rangari [mailto:linuxtricksfordevops@gmail.com]
> *Sent:* Wednesday, September 21, 2016 4:23 PM
> *To:* user@hive.apache.org
> *Subject:* Extracting data from ELB log date format
>
>
>
> Guys,
>
>
>
> I am trying to extract date, time, month, minute etc from below timestamp
> format but did not find any function for this. Can anyone help me to
> extract the details?
>
>
>
> 2016-09-15T23:45:22.943762Z
>
> 2016-09-15T23:45:22.948829Z
>
>
>
> --Manish
>

RE: Extracting data from ELB log date format

Posted by "Markovitz, Dudu" <dm...@paypal.com>.
select to_date(ts),year(ts),month(ts),day(ts),hour(ts),minute(ts),second(ts) from (select from_unixtime (unix_timestamp ('2016-09-15T23:45:22.943762Z',"yyyy-MM-dd'T'HH:mm:ss")) as ts) as t;
OK
2016-09-15 2016 9    15   23   45   22

Dudu

From: Manish Rangari [mailto:linuxtricksfordevops@gmail.com]
Sent: Wednesday, September 21, 2016 4:23 PM
To: user@hive.apache.org
Subject: Extracting data from ELB log date format

Guys,

I am trying to extract date, time, month, minute etc from below timestamp format but did not find any function for this. Can anyone help me to extract the details?

2016-09-15T23:45:22.943762Z
2016-09-15T23:45:22.948829Z

--Manish

Re: Extracting data from ELB log date format

Posted by "Haas, Nichole" <Ni...@concur.com>.
in Hive CL:

set today = cast(concat(substr(cast(current_date() as string),1,4),substr(cast(current_date() as string),6,2),substr(cast(current_date() as string),9,2)) as int)

From: Manish Rangari <li...@gmail.com>
Reply-To: "user@hive.apache.org" <us...@hive.apache.org>
Date: Wednesday, September 21, 2016 at 6:23 AM
To: "user@hive.apache.org" <us...@hive.apache.org>
Subject: Extracting data from ELB log date format

Guys,

I am trying to extract date, time, month, minute etc from below timestamp format but did not find any function for this. Can anyone help me to extract the details?

2016-09-15T23:45:22.943762Z
2016-09-15T23:45:22.948829Z

--Manish

________________________________

This e-mail message is authorized for use by the intended recipient only and may contain information that is privileged and confidential. If you received this message in error, please call us immediately at (425) 590-5000 and ask to speak to the message sender. Please do not copy, disseminate, or retain this message unless you are the intended recipient. In addition, to ensure the security of your data, please do not send any unencrypted credit card or personally identifiable information to this email address. Thank you.