How to enter dates in your queries

To search for dates you'll use a date range [start date .. end date] or a specific date.

Examples

Find systems that were last booted between 1-2 months ago

asset.lastBoot: [now-2M .. now-1M]

Find assets that were last booted between May 1st and October 1st 2018

asset.lastBoot: [2018-05-01 .. 2018-10-01]

Find assets that were last booted between 10 days ago and 1 second ago

asset.lastBoot: [now-10d .. now-1s]

Find assets that were last booted between 2018-10-01 and 2018-10-03

asset.lastBoot: [2018-10-01 .. 2018-10-03]

Find assets that were last booted on October 1st 2018

asset.lastBoot: '2018-10-01'

Find assets that were last booted on November 1st 2018 at time 10:53:49

asset.lastBoot: "2018-11-01 10:53:49"

Date variables

Date variables help you define a date or date range you're interested in. We support yyyy, yyyy-MM, yyyy-MM-dd and more.

Find assets last updated between January 1st 2017 and December 31st 2017 (i.e. yyyy)

inventory.lastUpdated: "2017"

Find assets last updated between September 1st and 30th 2018 (i.e. yyyy-MM)

inventory.lastUpdated: "2018-09"

Find assets last updated anytime on October 1st 2018 (i.e. yyyy-MM-dd)

inventory.lastUpdated: "2018-10-01"

Find assets last updated on July 15th 2018 from 10 to 11am (i.e. yyyy-MM-dd HH)

inventory.lastUpdated: "2018-07-15 10"

Find assets last updated on June 12th 2018 at 10:15am (i.e. yyyy-MM-dd HH:mm)

inventory.lastUpdated: "2018-06-12 10:15"

Find assets last updated on September 21st 2016 at 10:15:44am (i.e. yyyy-MM-dd HH:mm:ss)

inventory.lastUpdated: "2018-09-11 10:15:44"

Use the "now" shortcut

Type now- then a number and a time unit: y (year), M (month), w (week), d (day), h (hour), m (minute), s (second)

now-1y for 1 year ago

now-2M for 2 months ago

now-5d for 5 days ago

Comparison operators

We support comparison operators in your date searches.

inventory.lastUpdated > 2018-10-12

inventory.lastUpdated >= 2018-10-12

inventory.lastUpdated < 2018-10-12

inventory.lastUpdated <= 2016-10-12