DynamicTimeRangeRelative method: FilterValues class

Syntax

DynamicTimeRangeRelative(&startTime, &endTime)

Description

Use this method to dynamically change the time range to view the data on a visualization in OpenSearch Insights. Use this method to specify relative time range, which is relative to the current time or now.

Parameters

Parameter Description

&startTime

Specifies the start of the time range as a String value.

&endTime

Specifies the end of the time range as a String value.

Returns

None.

Example

import PTSF_INSIGHTS:FilterValues;

Local array of PTSF_INSIGHTS:FilterValues &filter;
Local PTSF_INSIGHTS:FilterValues &KibCondition;

&filter = CreateArrayRept(&KibCondition, 0);
Local PTSF_INSIGHTS:FilterValues &timeRange = create PTSF_INSIGHTS:FilterValues();
&timeRange.DynamicTimeRangeRelative("now-3y", "now");
&filter.Push(&timeRange);