Home

How to enter dates in queries?

Date variables help you define a date or date range. Use a date range [start date..end date] or a specific date to search for dates. 

For accurate results, we recommend you use the supported date formats - yyyy, yyyy-MM, and yyyy-MM-dd. 

Date Query Examples

  • Find assets with the last checked-in between January 1st, 2018, and December 31st, 2018 that is in yyyy date format
    lastCheckedIn: "2018"
  • Find assets with the last check-in between February 1st and 29th, 2018, that is in yyyy-MM
    lastCheckedIn: "2018-02"

  • Find assets with the last check-in anytime on February 1st, 2018, that is in yyyy-MM-dd
    lastCheckedIn: "2018-02-01"

  • Find assets with the last check-in on February 1st, 2018 from 10 to 11 AM that is in yyyy-MM-dd HH
    lastCheckedIn: "2018-02-01 10"

  • Find assets with the last check-in on February 1st, 2018 at 10:15 AM that is in yyyy-MM-dd HH:mm
    lastCheckedIn: "2018-02-01 10:15"

  • Find assets with the last check-in on February 1st, 2018 at 10:15:44 AM that is in yyyy-MM-dd HH:mm:ss
    lastCheckedIn: "2018-02-01 10:15:44"

  • Find systems that were last booted between 1-2 months ago
    system.lastBoot: [now-2M .. now-1M]
  • Find assets with vulnerabilities first found between January 1st and April 1st, 2018 
    vulnerabilities.firstFound: [2018-01-01 .. 2018-04-01]
  • Find assets with vulnerabilities last found between 10 days ago and 1-second ago
    vulnerabilities.lastFound: [now-10d .. now-1s]
  • Find assets with vulnerabilities published between 2018-10-01 and 2018-10-03
    vulnerabilities.vulnerability.published: [2018-10-01 .. 2018-10-03]
  • Find assets with vulnerabilities published on February 1st, 2018
    vulnerabilities.vulnerability.published: '2018-02-01'
  • Find assets with vulnerabilities first found on February 1st, 2018, at time 10:53:4
    vulnerabilities.firstFound: "2018-02-01 10:53:49"
  • Find assets with vulnerabilities first found between January 1st and April 1st, 2018
    vulnerabilities.firstFound: [2018-01-01 .. 2018-04-01]

Comparison Operators

We support comparison operators in your date searches.

  • vulnerabilities.vulnerability.published > 2018-03-12
  • vulnerabilities.vulnerability.published >= 2018-03-12
  • vulnerabilities.vulnerability.published < 2018-03-12
  • vulnerabilities.vulnerability.published <= 2018-03-12

Use the keyword now

Type the now keyword 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