Hi,
I am trying to calculate the time difference from a fields that has a timestamp in string format (%Y-%m-%dT%H:%M:%S%Z ("2024-10-10T13:51:32Z")), the search does not seem be get any compilation error but when the search and ran. it receives an error after running. "Error: Search has encountered an error and could not load data. Please try again, and contact support if this error continues."
This seems to happen when I try to use the timestamp.as_unix_seconds()
Was wondering if anyone came across a similar issue.
Here is the search:
metadata.log_type = "ABNORMAL_SECURITY" metadata.event_type = "EMAIL_TRANSACTION"
// replace
// format time string correctly
$recieved_time_s = re.replace(re.replace(additional.fields["mailReceivedTime"], "T", " "), "Z", "")
$remediated_time_s = re.replace(re.replace(additional.fields["mailRemediationTimestamp"], "T", " "), "Z", "")
$received_time = timestamp.as_unix_seconds($recieved_time_s)
$remediated_time = timestamp.as_unix_seconds($remediated_time_s)
match:
security_result.threat_name
outcome:
$c = count(security_result.threat_name)
$dif_avg = array_distinct($remediated_time - $received_time)
Yes I am aware about the regex replace commands, but the timestamp command doesn't allow me to provide a custom format.
