Job Filters: Filter By Date Range or Age



On This Page

Overview

There are two filters that allow you to filter content by date range or age. The available filter dates are the created on, modified on, and last touched date. The filters are multiselect, so you can choose one, two, or all three dates as part of the filter.

Filter by date range

 

 

Filter by Date Range

This filter allows you to include or exclude items based on the selected date(s) date. Use the After and/or Before fields to specify the dates you want to use. Either the “after” or “before” date is required, but you cannot use both dates.

 

Age

This filter allows you to filter content based on the age of the selected date(s). Use the Within the last field to set the number of days that corresponds to the age you want to use as a filter.

 


Filter Using the REST API

Items may be filtered by dates using the filter_date or date rule type. Date filter rules have two attributes: targets and range. Date filters are applied based on either a fixed date range or a sliding range. The examples below show the difference between these two methods.

Attributes

Attribute

Description

Attribute

Description

targets

An array of date targets to which the filter applies. These targets include: none, created_on, modified_on, accessed_on, last_touched, and all.

range

The range attribute is defined a subset of the attributes below depending on whether items are intended to be filtered by a fixed range of dates or a sliding range. For fixed range filters, set type to range and set the to and from attributes. See Example 1 on the right for this type of filter. For sliding range filters, set the type to any other value and the value attribute to the amount to use for the scale. See Example 2 on the right for this type of filter.

type: Allowed values include day (default), week, month, year, and range. The day, week, month, and year values are used in conjunction with value to define a sliding range (to/from not used). Use range with to and from attributes to define a fixed range.

from: The date and time the filter begins - a date-time offset in UNIX time format (e.g. 1508544000 for October 21, 2017 12:00 AM UTC)

to: The date and time the filter ends; see the from attribute for format details

value: For a sliding range, this value represents the quantity of the range as an integer (e.g. for a type "day" and value 5 with targets set to created_on, the filter will apply to files created within the last five days).

type

filter_date or date are the only allowable values for this filter type. Both values signify the same filter.

 

Example 1

The following example excludes files created between June 25, 2017 and August 25, 2017 from being transferred from the source.

{ ... "transfer": { ... "filter": { "source": [{ "action": "exclude", "rules": [{ "targets": "created_on", "range": { "type": "range", "from": 1508457600, "to": 1508544000 }, "type": "filter_date" } ], "type": "filter_rule" } ] } } ... }

 

Example 2

The following example will only transfer files modified within the last five days.

{ ... "transfer": { ... "filter": { "source": [{ "action": "include", "rules": [{ "targets": "modified_on", "range": { "type": "day", "value": 5 }, "type": "filter_date" } ], "type": "filter_rule" } ] } } ... }

 

 

DryvIQ Migrate Version: 5.9.2
Release Date: December 17, 2024