Skip to content

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

@tombonfert

Description

@tombonfert

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions