Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Query Syntax

FsPulse provides a flexible, SQL-like query language for exploring scan results. This language supports filtering, custom column selection, ordering, and limiting the number of results.


Query Structure

Each query begins with one of the four supported domains:

  • roots
  • scans
  • items
  • changes

You can then add any of the following optional clauses:

DOMAIN [WHERE ...] [SHOW ...] [ORDER BY ...] [LIMIT ...]

Column Availability

roots Domain

All queries that retrieve root information begin with the keyword roots:

roots [WHERE ...] [SHOW ...] [ORDER BY ...] [LIMIT ...]
PropertyType
root_idInteger
root_pathPath

scans Domain

All queries that retrieve scan information begin with the keyword scans:

scans [WHERE ...] [SHOW ...] [ORDER BY ...] [LIMIT ...]
PropertyTypeDescription
scan_idIntegerUnique scan identifier
root_idIntegerRoot directory identifier
scan_stateScan State EnumState of the scan
is_hashBooleanHash new or changed files
hash_allBooleanHash all items including unchanged
is_valBooleanValidate new or changed files
val_allBooleanValidate all items including unchanged
scan_timeDateTimestamp when scan was performed
file_countIntegerCount of files found in the scan
folder_countIntegerCount of directories found in the scan
total_file_sizeIntegerTotal size in bytes of all files in the scan
alert_countIntegerNumber of alerts created during the scan
add_countIntegerNumber of items added in the scan
modify_countIntegerNumber of items modified in the scan
delete_countIntegerNumber of items deleted in the scan
errorStringError message if scan failed

items Domain

All queries that retrieve item information begin with the keyword items:

items [WHERE ...] [SHOW ...] [ORDER BY ...] [LIMIT ...]
PropertyType
item_idInteger
scan_idInteger
root_idInteger
item_pathPath
item_typeItem Type Enum
last_scanInteger
is_tsBoolean
mod_dateDate
file_sizeInteger
last_hash_scanInteger
file_hashString
last_val_scanInteger
valValidation Status
val_errorString

changes Domain

All queries that retrieve change history begin with the keyword changes:

changes [WHERE ...] [SHOW ...] [ORDER BY ...] [LIMIT ...]
PropertyType
change_idInteger
root_idInteger
scan_idInteger
item_idInteger
item_pathPath
change_typeChange Type Enum
is_undeleteBoolean
meta_changeBoolean
mod_date_oldDate
mod_date_newDate
hash_changeBoolean
last_hash_scan_oldInteger
hash_oldString
hash_newString
val_changeBoolean
last_val_scan_oldInteger
val_oldValidation Status
val_newValidation Status
val_error_oldString
val_error_newString

The WHERE Clause

The WHERE clause filters results using one or more filters. Each filter has the structure:

column_name:(value1, value2, ...)

Values must match the column’s type. You can use individual values, ranges (when supported), or a comma-separated combination. Values are not quoted unless explicitly shown.

TypeExamplesNotes
Integer5, 1..5, 3, 5, 7..9, null, not null, NULL, NOT NULLSupports ranges and nullability. Ranges are inclusive.
Date2024-01-01, 2024-01-01..2024-06-30, null, not null, NULL, NOT NULLUse YYYY-MM-DD. Ranges are inclusive.
Booleantrue, false, T, F, null, not null, NULL, NOT NULLValues are unquoted. Null values are allowed in all-lower or all-upper case.
String'example', 'error: missing EOF', null, NULLQuoted strings. Null values are allowed in all-lower or all-upper case.
Path'photos/reports', 'file.txt'Must be quoted. Null values are not supported.
Validation StatusV, I, N, U, null, not null, NULL, NOT NULLValid (V), Invalid (I), No Validator (N), Unknown (U). Unquoted. Ranges not supported.
Item Type EnumF, D, S, O, null, not null, NULL, NOT NULLFile (F), Directory (D), Symlink (S), Other (O). Unquoted. Ranges not supported.
Change Type EnumN, A, M, D, null, not null, NULL, NOT NULLNo Change (N), Add (A), Modify (M), Delete (D). Unquoted. Ranges not supported.
Scan State EnumS, W, A, C, P, E, null, not null, NULL, NOT NULLScanning (S), Sweeping (W), Analyzing (A), Completed (C), Stopped (P), Error (E). Unquoted. Ranges not supported.

Combining Filters

When specifying multiple values within a single filter, the match is logically OR. When specifying multiple filters across different columns, the match is logically AND.

For example:

scans where scan_time:(2025-01-01..2025-01-07, 2025-02-01..2025-02-07), hashing:(T)

This query matches scans that:

  • Occurred in either the first week of January 2025 or the first week of February 2025
  • AND were performed with hashing enabled

The SHOW Clause

The SHOW clause controls which columns are displayed and how some of them are formatted. If omitted, a default column set is used.

You may specify:

  • A list of column names
  • The keyword default to insert the default set
  • The keyword all to show all available columns

Formatting modifiers can be applied using the @ symbol:

item_path@name, mod_date@short

Format Specifiers by Type

TypeAllowed Format Modifiers
Datefull, short, timestamp
Pathfull, relative, short, name
Validation / Enum / Booleanfull, short
Integer / String(no formatting options)

The timestamp format modifier converts dates to UTC timestamps (seconds since Unix epoch), which is useful for programmatic processing or web applications that need to format dates in the user's local timezone.


The ORDER BY Clause

Specifies sort order for the results:

items order by mod_date desc, item_path asc

If direction is omitted, ASC is assumed.


The LIMIT Clause

Restricts the number of rows returned:

items limit 50

Examples

# Items whose path contains 'reports'
items where item_path:('reports')

# Changes involving validation failures
changes where val_new:(I) show default, val_old, val_new order by change_id desc

# Scans with timestamp for programmatic processing
scans show scan_id, scan_time@timestamp, file_count order by scan_time desc limit 10

# Scans with changes and alerts
scans show scan_id, file_count, total_file_size, add_count, modify_count, delete_count, alert_count order by scan_time desc

See also: Interactive Mode · Validators · Configuration