Filter by name pattern

Summary

Patterns can be used to filter containers and items based on the name. 

An asterisk (*) can be used for exact matches or prefix/suffix matches (e.g. *txt for .txt extensions). You can also use asterisks to surround a pattern to filter file and/or folder names (e.g. names that contain *text*). Use a semicolon (;) for multiple patterns (e.g. *.txt;*.tmp)

Below is a description of the three attributes:

Attribute

Description

text The pattern to use to filter items. An asterisk (*) can be used for exact matches or prefix/suffix matches (e.g. *txt for .txt extensions). To filter file and/or folder names, you can use wildcard to surround a pattern (e.g. filter names that contain *text*). Use a semicolon (;) for multiple patterns (e.g. *.txt;*.tmp).

Matches will ignore case. For example, a text value of "secret" will match values including secret, Secret, and SECRET.
targets An optional array of item types, including container, item, all, or none. By default all is used.
type filter_pattern or pattern are the only allowable values for this filter type. Both values signify the same filter.

REST API - Example 1

The example below excludes any container (e.g. directory) with 'secret' as any part of its name from being transferred from the source.

POST {{url}}v1/jobs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90

{
    "name":"Sample Job | Do not transfer any container with 'secret' as a part of its name",
    "kind": "transfer",
    "transfer": {
      "transfer_type": "copy",
      "audit_level": "trace",
      "batch_mode": "always",
      "conflict_resolution": "latest",
      "delete_propagation": "ignore_both",
      "failure_policy": "continue",
      "large_item": "skip",
      "lock_propagation": "ignore",
      "max_items_per_container": 10000,
      "performance": {
                "parallel_writes": {
                    "requested": 2
                }
      },         
      "permissions": {
            "policy": "add",
            "links": true,
            "failures": "exceptions"
      },
      "preserve_owners": true,
      "timestamps": true,
      "empty_containers": "create",
      "duplicate_names": "rename",
      "item_overwrite": "overwrite",
      "restricted_content": "convert",
      "segment_transform": true,
      "versioning": {
            "preserve": "native",
            "select": "all"
      },
         "group_map": {
         "id": "{{group_map_id}}",
         "type": "group_map"
      },
      "account_map": {
         "id": "{{account_map_id}}",
         "type": "account_map"
    },
        "filter":{
         "source":[
            {
               "action":"exclude",
               "rules":[
                  {
                  "rules": [{
                    "text": "*secret*",
                    "targets": [
                        "container"
                        ],
                    "type": "filter_pattern"
                        }],
                     "type":"filter_rule"
                  }
               ],
               "type":"filter_rule"
            }
         ]
        },       
        "source": {
            "connection": { "id": "{{cloud_connection_source}}" },
            "impersonate_as": { "email": "joe@smith.com" },
            "target": {
                "path": "/sourcePath"
            }
        },
        "destination": {
            "connection": { "id": "{{cloud_connection_destination}}" },
            "impersonate_as": { "email": "joe@smith.com" },
            "target": {
                "path": "/destinationPath"
            }
        },
        "simulation_mode": false
    },
    "schedule": {
        "mode": "manual"
    },
    "stop_policy": {
        "on_success": 5,
        "on_failure": 5,
        "on_execute": 25
    },
    "category": {
      "name": "Reports | Jobs with Exclude Name Pattern Filters"
    }
}

Related Links