Implicit variables and variable functions
You can use implicit variables and variable functions in your saved search query expressions to store a query that is based on a condition relative to when it is run.
An implicit variable is a placeholder for a value that is automatically replaced when the query is run. For example, you can use a variable that is replaced by current user ID, date and time, or offset from current date and time when the query expression is run.
- {USER}
- Current user.
- {DATE}
- Current date.
- {DATE_OFFSET (<+|->,yyyy,mm,dd)}
- Current date with four parameters offset function.
- {DATETIME}
- Current date and time.
- {DATETIME_OFFSET(<+|->,yyyy,mm,dd)}
- Current date and time with four parameters offset function.
- {DATETIME_OFFSET(<+|->,yyyy,mm,dd,hh,mn,ss)}
- Current date and time with seven parameters offset function.
Offset function syntax
You can use four parameters or seven parameters for the date and time attribute offset function,
but only four parameters for a date attribute offset function. You can select either
+ or - as the first parameter and then all positive integers
for the remaining parameters and the sign is applied to all the parameters. Any positive integer is
supported and is not limited to the number of digits that are specified. Leading zeros are optional.
Large values are rolled into and automatically propagated into the larger field. For example, an
offset of 36 hours is considered as 1 day and 12 hours. They are applied to the current date when
run and the calendar date is rolled back or forward the exact count that is stated for each
parameter. For example, use the following query to search for all documents that are created by the
current user in the last 1 day or 24
hours:
[@SEMANTICTYPE!=2 AND @CREATEUSERID="{USER}" AND @CREATETS>"{DATETIME_OFFSET
(-,0000,00,01,00,00,00)"]