Filtering Syntax

Purpose of Filtering

Filtering is designed to help you explore, analyze, and understand the contents of compared Data Sources.
It allows you to focus on files and directories that match specific criteria, making it easier to:

  • Inspect differences between Data Sources
  • Identify missing, outdated, or unexpected files
  • Detect anomalies in large file sets
  • Narrow down results when working with large volumes of data

Instead of browsing raw comparison results, filters let you express what you are looking for using clear and precise conditions.

Filtering Syntax

Filters are logical expressions like:

is:file AND name=="report*" AND A1.size>1MB AND NOT on:B1
# filters out files whose name starts with "report", whose size is greater than 1MB and which are not located on the B1 Data Source.

Each filter is evaluated for every file or folder, based on its metadata and its presence across the various datasources.

Simple Text Search

Just type plain text to search file and folder names:

report 2025
# Find all files and folders whose name contains both "report" and "2025".

Universal Operators

Universal Operators apply directly to files & folders without needing to specify a particular datasource.

OperatorExampleDescription
namename=="file1.txt"Exact or pattern match on file name
onon:A1Checks if the file exists in datasource A1
onlyonly:A1True if the file exists only in A1
isis:fileFile type: file, dir, or directory
has:actionshas:actions.copy>0Synchronization action: copy, delete, etc.

Datasource-Specific Operators

These operators compare specific properties of datasources, typically to detect differences.

OperatorExampleDescription
contentA1.content==A2.contentCompares binary content
content-and-dateA1.content-and-date==A2.content-and-dateCompares content and last-write time
last-write-timeA1.last-write-time > A2.last-write-timeCompares last modification dates
sizeA1.size != A2.sizeCompares file sizes

Logical Operators

Use logical operators to combine or negate conditions:

  • AND: name:"*.log" AND A1.size>1MB
  • OR: is:file OR is:directory
  • NOT: NOT name=="temp*"
  • Parentheses ( … ): not (A1.size<10KB or name:"temp*")

Comparison Operators

OperatorMeaningExample
== or =EqualsA1.size == 1024
!= or <>Not equal toA1.size != 0
<, >, <=, >=Comparisonslastwritetime >= 2025-01-01
=~Matches regex patternname =~ "^report.*\.pdf$"

Datasources and Inventory Identifiers

ByteSync compares multiple inventory sources called datasources, identified by short codes:

IdentifierRole
AMain inventory of node A
A1, A2Individual file sources under node A

Filter by name

You can filter files based on their name using the name operator. This is useful to include or exclude files by exact name, pattern, or regular expression.

Basic Comparisons

Use : or == to match files & folders whose name equals the specified value.

name:README.md
name=="file1.txt"


Use != to matches files & folders whose name is different from the specified value.

name!="temp.log"

Wildcards

You can use wildcard character (*) to match any sequence of characters.

name:file1*
name==*.log

Regular Expressions

Use =~ to match a regular expression pattern:

name=~"^log_.*\\.txt$"
# This matches any .txt file whose name starts with log_.

Filter by Synchronization Actions

Synchronization Actions can filtered with the has:actions operator.

Actions Sources

KeywordDescription
targetedMatch targeted actions
rulesMatch actions resulting of synchronization rules

Actions Types

KeywordDescription
copyContent and dates of the file will be synchronized
copy-contentContent of the file will be synchronized
copy-datesDates will be synchronized
createDirectory will be created
deleteFile/Directory will be deleted
do-nothingDo Nothing is set, nothing will be done on File/Directory

Action Source & Action Type can be omitted, but if both are used, Action Source must be specified before Action Type.


Examples

Files that will be synced (contents & date):

has:actions.copy

Files that will be deleted due to a synchronization rule:

has:actions.rules.delete

Files that won’t be touched:

has:actions.do-nothing

Files larger than 10 MB on A1:

A1.size > 10485760

Files modified since 2024 on B:

B.last-write-time >= 2024-01-01

.log files that will be synced:

name == "*.log" AND actions.copy

Directories only:

is:directory
# can also be filtered out with is:dir

Files present only in inventory A:

only:A

Files present in both A1 and B1:

on:A1 AND on:B1

Files present in A1 or A2 and B1:

(on:A1 OR on:A2) AND on:B1

This syntax gives you precise control over which files are included or excluded from your sync operations.

Previous Article

Data Comparison