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 five supported domains:

  • roots
  • scans
  • items
  • versions
  • hashes

You can then add any of the following optional clauses:

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

Column Availability

Each domain has a set of available columns. Columns marked as default are shown when no SHOW clause is specified.

roots Domain

ColumnTypeDefault
root_idIntegerYes
root_pathPathYes

scans Domain

ColumnTypeDefaultDescription
scan_idIntegerYesUnique scan identifier
root_idIntegerYesRoot directory identifier
schedule_idIntegerYesSchedule identifier (null for manual scans)
started_atDateYesTimestamp when scan started
ended_atDateYesTimestamp when scan ended (null if incomplete)
was_restartedBooleanYesTrue if scan was resumed after restart
scan_stateScan State EnumYesState of the scan
is_hashBooleanYesHash new or changed files
hash_allBooleanNoHash all items including unchanged
is_valBooleanYesValidate new or changed files
file_countIntegerYesCount of files found in the scan
folder_countIntegerYesCount of directories found in the scan
total_sizeIntegerYesTotal size in bytes of all files
new_hash_suspect_countIntegerNoNew suspect hashes detected in this scan
new_val_invalid_countIntegerNoNew validation failures detected in this scan
add_countIntegerYesNumber of items added in the scan
modify_countIntegerYesNumber of items modified in the scan
delete_countIntegerYesNumber of items deleted in the scan
val_unknown_countIntegerNoFiles with unknown validation state
val_valid_countIntegerNoFiles with valid validation state
val_invalid_countIntegerNoFiles with invalid validation state
val_no_validator_countIntegerNoFiles with no available validator
hash_unknown_countIntegerNoFiles with unknown hash state
hash_baseline_countIntegerNoFiles with baseline hash state
hash_suspect_countIntegerNoFiles with suspect hash state
errorStringNoError message if scan failed

items Domain

The items domain queries item identity — the permanent properties of each tracked file or directory.

ColumnTypeDefaultDescription
item_idIntegerYesUnique item identifier
root_idIntegerYesRoot directory identifier
item_pathPathYesFull path of the item
item_namePathYesFilename or directory name (last segment)
file_extensionStringYesLowercase file extension (null for folders/extensionless)
item_typeItem Type EnumYesFile, Directory, Symlink, or Unknown
has_validatorBooleanNoTrue if a structural validator exists for this file type
do_not_validateBooleanNoTrue if user has opted this item out of validation

versions Domain

The versions domain queries individual item version rows — each representing a distinct state of an item over a temporal range. Filter with is_current:(T) to query only the latest version of each item.

ColumnTypeDefaultDescription
item_versionIntegerYesVersion number (per-item sequence)
item_idIntegerYesItem this version belongs to
root_idIntegerYesRoot directory identifier
item_pathPathYesFull path of the item
item_namePathNoFilename or directory name (last segment)
file_extensionStringNoLowercase file extension (null for folders/extensionless)
item_typeItem Type EnumYesFile, Directory, Symlink, or Unknown
first_scan_idIntegerYesScan where this version was first observed
last_scan_idIntegerYesLast scan confirming this version’s state
is_addedBooleanNoTrue if item was added in this version
is_deletedBooleanYesTrue if item was deleted in this version
is_currentBooleanNoTrue if this is the latest version of the item
accessAccess StatusNoAccess state
mod_dateDateYesLast modification date
sizeIntegerYesFile size in bytes
add_countIntegerNoDescendant items added (folders only; null for files)
modify_countIntegerNoDescendant items modified (folders only; null for files)
delete_countIntegerNoDescendant items deleted (folders only; null for files)
unchanged_countIntegerNoDescendant items unchanged (folders only; null for files)
val_scan_idIdNoScan in which this version was validated (NULL if not yet validated; may differ from first_scan_id)
val_stateValidation StatusNoValidation state (files only; null for folders)
val_errorStringNoValidation error message (files only; null for folders)
val_reviewed_atDateNoTimestamp when user marked a validation issue as reviewed (NULL until reviewed)
hash_reviewed_atDateNoTimestamp when user marked a hash integrity issue as reviewed (NULL until reviewed)

hashes Domain

The hashes domain queries hash observation records — each representing a SHA-256 hash computed for an item version during a scan.

ColumnTypeDefaultDescription
item_idIntegerYesItem this hash belongs to
item_versionIntegerYesVersion this hash was observed on
item_pathPathYesFull path of the item
item_namePathNoFilename or directory name (last segment)
first_scan_idIntegerYesScan where this hash was first observed
last_scan_idIntegerYesLast scan confirming this hash
file_hashHashYesSHA-256 content hash (hex)
hash_stateHash StateYesBaseline or Suspect

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.

TypeExamplesNotes
Integer5, 1..5, 3, 5, 7..9, > 1024, < 10, null, not nullSupports ranges, comparators, and nullability. Ranges are inclusive.
Date2024-01-01, 2024-01-01 14:30:00, 1711929600, null, not nullThree input forms (see below). Ranges are inclusive.
Booleantrue, false, T, F, null, not nullUnquoted.
String'example', 'error: missing EOF', null, not nullQuoted strings.
Path'photos/reports', 'file.txt'Must be quoted. Null values are not supported.
Validation StatusV, I, N, U, null, not nullValid, Invalid, No Validator, Unknown. Null for folders. Unquoted.
Hash StateV, S, U, null, not nullValid, Suspect, Unknown. Null for folders. Unquoted.
Item Type EnumF, D, S, UFile, Directory, Symlink, Unknown. Unquoted.
Scan State EnumS, W, AF, AS, C, P, EScanning, Sweeping, Analyzing Files, Analyzing Scan, Completed, Stopped, Error. A is shorthand for AF. Unquoted.
Access StatusN, M, RNo Error, Meta Error, Read Error. Unquoted.

Date Filter Formats

Date columns accept three input forms, matching the three display formats available via @short, @full, and @timestamp. Any value produced by a query can be used directly as filter input.

FormExampleBehavior
Date only2025-01-15Matches the entire day (00:00:00 through 23:59:59 local time)
Date and time2025-01-15 14:30:00Matches that exact second
Unix epoch1737936000Matches that exact second (10+ digits, UTC)

These forms can be mixed freely within a filter or range:

# Date-only range
started_at:(2025-01-01..2025-01-31)

# Exact time range
started_at:(2025-01-15 08:00:00..2025-01-15 17:00:00)

# Mixed forms in a range
started_at:(2025-01-15..2025-01-16 14:30:00)
mod_date:(1737936000..2025-02-01)

# Multiple values (OR'd)
started_at:(2025-01-15, 2025-02-01 09:00:00, 1737936000)

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 started_at:(2025-01-01..2025-01-07, 2025-02-01..2025-02-07), is_hash:(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 / Hash State / Enum / Booleanfull, short
Integer / String(no formatting options)

All three date display formats (@short, @full, @timestamp) produce values that can be used directly as date filter input — see Date Filter Formats above.


The GROUP BY Clause

Groups rows by one or more columns and enables aggregate functions in the SHOW clause. When GROUP BY is used, a SHOW clause is required.

versions where is_current:(T), root_id:(1) group by file_extension show file_extension, count(*), sum(size) order by sum(size) desc

Aggregate Functions

FunctionApplies ToDescription
count(*)AnyCount all rows in the group
count(col)Any columnCount non-null values
sum(col)Integer columnsSum of values
avg(col)Integer columnsAverage of values
min(col)Integer, Date, Id columnsMinimum value
max(col)Integer, Date, Id columnsMaximum value

Rules

  • Every non-aggregate column in SHOW must also appear in GROUP BY
  • Aggregate functions can be used in ORDER BY (e.g., order by count(*) desc)

The ORDER BY Clause

Specifies sort order for the results. Supports both column names and aggregate expressions.

items order by mod_date desc, item_path asc
scans group by root_id show root_id, count(*) order by count(*) desc

If direction is omitted, ASC is assumed.


The LIMIT and OFFSET Clauses

LIMIT restricts the number of rows returned. OFFSET skips a number of rows before returning results.

items limit 50 offset 100

Examples

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

# All PDF items
items where file_extension:('pdf')

# Current state of large files, sorted by size
versions where is_current:(T), item_type:(F), size:(> 1048576) show item_path, size order by size desc

# Version history for a specific item
versions where item_id:(42) order by first_scan_id

# Deleted versions across all roots
versions where is_deleted:(true) show item_path, item_type, first_scan_id, last_scan_id

# Versions with validation failures
versions where val_state:(I) show default, val_error order by first_scan_id desc

# Suspect hash observations
hashes where hash_state:(S) show item_path, item_version, file_hash

# All hash observations for a specific item
hashes where item_id:(42) order by first_scan_id

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

# Scans with change and integrity counts
scans show scan_id, file_count, total_size, add_count, modify_count, delete_count, new_hash_suspect_count, new_val_invalid_count order by started_at desc

# File count and total size by extension
versions where is_current:(T), root_id:(1), item_type:(F) group by file_extension show file_extension, count(*), sum(size) order by sum(size) desc

# Scan count per root
scans group by root_id show root_id, count(*), max(total_size), max(file_count) order by count(*) desc

# Hash state distribution
hashes group by hash_state show hash_state, count(*)

# Validation failures by root
versions where val_state:(I) group by root_id show root_id, count(*)

See also: Data Explorer · Validators · Configuration