Search API Time Specification

There are two ways of specifying the start and end time for a query:

Absolute Time

With absolute time, you specify a number that expresses the precise time in milliseconds since the Unix epoch (Unix time) in the UTC/Zulu time zone. This method is shown in the following example:

json
{
  "queryString": "css",
  "start": 1473449370018,
  "end": 1473535816755
}

Relative Time

With relative time, you specify the start and end time as a relative time such as 1minute or 24hours. Falcon LogScale supports this using relative time modifiers. LogScale treats the start and end times as relative times if you specify them as strings.

When providing a timestamp, relative time modifiers are specified relative to "now".

See the Relative Time Syntax reference page.

Note

Relative time modifiers are always relative to now.

This method is shown in the following examples:

Search the last 24 hours:

json
{
  "queryString": "ERROR",
  "start": "24hours",
  "end": "now"
}

You can also mix relative and absolute time modifiers. For example, to search from a specified moment in time until two days ago:

json
{
  "queryString": "loglevel=ERROR",
  "start": 1473449370018,
  "end": "2days"
}

Advanced time selection is also available using the Advanced Time Syntax.

Note

Omitted and required arguments: LogScale has defined behavior when you omit time arguments: if you omit the end argument, it gets the default value now; and if you omit the start argument, it gets the default value of 24hours. For *_live queries_*, you must either set end to now, or omit it. You must set start to a relative time modifier.

Live Query Streaming All Events

This live query returns an empty search, finding all events in a time window going 10 seconds back in time.

Notice the ACCEPT header. This tells the server to stream data as Newline Delimited JSON.

Show:
json
{
   "queryString" : "",
   "isLive" : true,
   "start" : "10s"
}

Aggregate Query Returning Standard JSON

This query groups results by service and counts the number of events for each service. The query blocks until it is complete and returns events as a JSON array:

Show:
json
{
   "queryString" : "count()",
   "isLive" : false,
   "start" : "1h",
   "end" : "now"
}