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

convert [timeformat=string] ctime(<field>) #60

Open
tombonfert opened this issue Nov 29, 2021 · 1 comment
Open

convert [timeformat=string] ctime(<field>) #60

tombonfert opened this issue Nov 29, 2021 · 1 comment

Comments

@tombonfert
Copy link
Contributor

The ctime function converts a given field to a human readable format, which can be provided with the optional timeformat (default: "%m/%d/%Y %H:%M:%S") parameter.

In Splunk, the provided field can either be a unix epoch time in seconds or a timestamp field like the _time column. Please see the example in the Splunk doc for the latter.

Here, we have the same issue as we have with the strftime function. Depending on the type of the input field, we either need to call the 'from_unixtime' function or the 'date_format' function. The current implementation leverages the date_format function to convert timestamp fields (e.g. '_time'). Hence, we do not support fields in seconds, but only in timestamp format.

@tombonfert tombonfert mentioned this issue Nov 29, 2021
7 tasks
@tombonfert
Copy link
Contributor Author

This issue and the strftime issue can be solved with a CaseWhen expression (see num() implementation). I will solve it asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant