Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pkg/ottl] Add Epoch Time Parsing Functionality #29088

Closed
Mrod1598 opened this issue Nov 9, 2023 · 3 comments
Closed

[pkg/ottl] Add Epoch Time Parsing Functionality #29088

Mrod1598 opened this issue Nov 9, 2023 · 3 comments
Labels
enhancement New feature or request needs triage New item requiring triage pkg/ottl

Comments

@Mrod1598
Copy link
Contributor

Mrod1598 commented Nov 9, 2023

Component(s)

pkg/ottl

Is your feature request related to a problem? Please describe.

There's currently no easy way to get an epoch time from a value.
here's an example of the best way I've come up with to parse a simple epoch time.

example:

- set(time, Time("1970-01-01T00:00:00.000000+0000", "%Y-%m-%dT%H:%M:%S.%f%z") + Duration(Concat([body["timestamp"], "ms"], "")))

We have to add the duration to the beginning of the epoch to be able to parse the timestamp. So, we are using additional computation to parse the beginning of the epoch's timestamp every time this statement runs.

Describe the solution you'd like

The Time function to take in a float value with a passed in the format of something like s, ms, s.ms, or s.ns.

Describe alternatives you've considered

Alternatively, there could be new functions that were the inverse of the Unix Time functions.

Additional context

No response

@Mrod1598 Mrod1598 added enhancement New feature or request needs triage New item requiring triage labels Nov 9, 2023
Copy link
Contributor

github-actions bot commented Nov 9, 2023

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@TylerHelmuth
Copy link
Member

@Mrod1598 does #27868 solve your issue?

@Mrod1598
Copy link
Contributor Author

@Mrod1598 does #27868 solve your issue?

Ah, yes sorry missed that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New item requiring triage pkg/ottl
Projects
None yet
Development

No branches or pull requests

2 participants