Timestats Command
Use this command to generate data for displaying statistical trends over time, optionally grouped by field.
Syntax
timestats [<bucketing_option>] <stats_function / timestats_function> "("<field_name>")" [as new_field_name] [by_<field_name>]
Parameters
The following table lists the parameters used with this command, along with their descriptions.
Parameter | Description |
---|---|
|
Use this parameter to specify how the data should be bucketed. Permitted values for this parameter must follow the format |
|
Use this parameter to set the size of each bucket, using a span length based on time. Permitted values for this parameter must follow the format |
|
Use this parameter to specify the time for sizing the buckets. Permitted values for this parameter must be either |
|
Use this parameter to specify whether the buckets should span across seconds. Permitted values for this parameter include |
|
Use this parameter to specify whether the bucket should span across minutes. Permitted values for this parameter include |
|
Use this parameter to specify whether the bucket should span across hours. Permitted values for this parameter include |
|
Use this parameter to specify whether the bucket should span across weeks. Permitted values for this parameter include |
|
Use this parameter to specify whether the bucket should span across months. Permitted values for this parameter include |
Note:
You can use the functions that are associated with thestats
command with the timestats
command too. For details about the functions and the examples of using the functions with the command, see Stats Command.
Functions
The following table lists the functions available with this command, along with their examples.
Function | Examples |
---|---|
persecond: Returns one data point per span interval representing the average rate per second. |
|
perminute: Returns one data point per span interval representing the average rate per minute |
|
perhour: Returns one data point per span interval representing the average rate per hour |
|
perday: Returns one data point per span interval representing the average rate per day |
|
The following query returns the count of fatal log entries over the specified time range.
Severity = fatal | timestats count
The following query returns the count of logs bucketed into daily chunks.
* | timestats span = 1day count