TimeStampCompare

Compares a single timestamp to a list of timestamps.

Script Data


NameDescription
Script Typepython3
Tags
Demisto Version0.0.0

Used In


This script is used in the following playbooks and scripts.

  • TIM - Process Domain Age With Whois

Inputs


Argument NameDescription
tested_timeTimestamp to compare to the list of timestamps.
values_to_compareValues to compare the tested_time against. The script checks each value and determines whether it's before/after/equal to the tested_time.
time_formatTime format of the times you entered. By default, the script uses automatic parsing. This should be used for cases like DD/MM/YYYY. Automatic parsing will detect formats such as: February 15th 2009, 02-15-2020, 02-15-2020T14:30:00Z

Outputs


PathDescriptionType
TimeStampCompare.TestedTimeThe tested timeDate
TimeStampCompare.ComapredTimeThe compared timeDate
TimeStampCompare.ResultWhether the tested time was before, after, or equal to the comapred time.String

Script Example

!TimeStampCompare tested_time='01-01-2020' values_to_compare='2020-02-01T00:00:00,31.12.2019'

Context Example

{
"TimeStampCompare": [
{
"ComparedTime": "'2020-02-01T00:00:00",
"Result": "after",
"TestedTime": "'01-01-2020'"
},
{
"ComparedTime": "31.12.2019'",
"Result": "before",
"TestedTime": "'01-01-2020'"
}
]
}

Human Readable Output

Timestamp compare

TestedTimeComparedTimeResult
'01-01-2020''2020-02-01T00:00:00after
'01-01-2020'31.12.2019'before