Highlighted
Bechara Super Contributor.
Super Contributor.
598 views

Flex Time stamp

Jump to solution

Hi Guys,

I need your help in Flex.

I am trying to create a file reader regex, for the following log:

140711080000

which is refer to :yymmddHHmmss

I tried to parse it with the following code

token[4].name=Date

token[4].type=String

token[5].name=Time

token[5].type=String

event.endTime=__createOptionalTimeStampFromString(__concatenate(Date," ",Time),yymmdd HHmmss)

I can receive the time in manager but it is in EET zone and not in EEST,

Please help

Tags (2)
0 Likes
1 Solution

Accepted Solutions
jring1 Frequent Contributor.
Frequent Contributor.

Re: Flex Time stamp

Jump to solution

Hi,

not sure if Evgenys version works - if yes, it wins a price for elegance. Anyways it contains an important hint:

yyMMdd  -  with capital M for month...


And if today is parsed as Jan 15th it's not just a daylight saving time problem (although winter time is correct in january).


Joachim

0 Likes
5 Replies
jring1 Frequent Contributor.
Frequent Contributor.

Re: Flex Time stamp

Jump to solution

Hi,

are you sure that the box the flexconn is running on is set to EEST? Otherwise it's going to be tricky unless you have got the TZ or offset to GMT in the log (you can then use z or Z in the time format description).

Or set the box generating the logs to log in GMT and force this in the connector - safes a lot of hassle when your boxes are in different timezones...

Joachim

0 Likes
Bechara Super Contributor.
Super Contributor.

Re: Flex Time stamp

Jump to solution

i found my problem, this function is converting to epoch time, and it send it to ESM, Esm will convert it back to human readable format, which is wrong, in ESM i can see the time 15 jan 20014 08am Capture.PNG

why the epoch time is wrong?

0 Likes
Acclaimed Contributor.. lless Acclaimed Contributor..
Acclaimed Contributor..

Re: Flex Time stamp

Jump to solution

token[4].name=Date

token[4].type=TimeStamp

token[4].format=yyMMdd

token[5].name=Time

token[5].type=TimeStamp

token[5].format=HHmmss

0 Likes
jring1 Frequent Contributor.
Frequent Contributor.

Re: Flex Time stamp

Jump to solution

Hi,

not sure if Evgenys version works - if yes, it wins a price for elegance. Anyways it contains an important hint:

yyMMdd  -  with capital M for month...


And if today is parsed as Jan 15th it's not just a daylight saving time problem (although winter time is correct in january).


Joachim

0 Likes
Acclaimed Contributor.. lless Acclaimed Contributor..
Acclaimed Contributor..

Re: Flex Time stamp

Jump to solution

MMM - jan feb .. dec

MM - 01 02 03 04 .. 12

M - 1 2 3 4 .. 12

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.