to_timestamp - Reference Guide - Cortex XDR - Cortex - Security Operations

Cortex XDR XQL Language Reference

Product
Cortex XDR
Creation date
2023-10-31
Last date published
2024-03-27
Category
Reference Guide
Abstract

Learn more about the Cortex Query Language to_timestamp() function that converts an integer to a timestamp.

Syntax

to_timestamp (<integer>, <units>)

Description

The to_timestamp() function converts an integer to a timestamp. This function requires a units value, which indicates whether the integer represents seconds, milliseconds, or microseconds since the Unix epoch. Supported values are:

  • SECONDS

  • MILLIS

  • MICROS

Example

dataset = xdr_data 
| filter story_publish_timestamp != null 
| alter ts = to_timestamp(story_publish_timestamp, "MILLIS") 
| fields ts