Lookup Tables
RoleAdministrator | AnalystRead12 min
Screen
Lookup Tables
/management/lookup-tablesReusable reference data sets (blocked IPs, trusted accounts, VIP users, etc.) stored in Affinity and referenced in SQL queries and detection rules with `{{table_name}}` placeholders.
What it's for
Create, import, and maintain reference lists in Management → Lookup Tables, and use them in Logs and Detection Rules via the Lists button.
Before you start
- Admin permissions on
/management/lookup-tables. - For CSV import: the first row is the column headers.
- Create tables before referencing them in SQL or rules — if the table is missing or empty, the query fails.
Expected result
- The table appears in the sidebar list with its row and column count.
- You can insert it in Logs or Detection Rules with Lists and
{{name}}references. - When the query runs, placeholders resolve with the table's current data.
Tips
- For large lists (IPs, hashes, domains) use Quick List or CSV instead of row-by-row entry.
- In detection rules, prefer Reference over Value list — update the list without editing every rule.
- Pick the right column type: numeric and date comparisons depend on it.
Access the panel
- MANAGEMENT → LOOKUP TABLES (route
/management/lookup-tables). - Screen subtitle: Reusable reference sets for SQL queries and detection rules.
The screen — three areas
- Left — Tables: table list with Filter tables… search and a + button to create. Each row shows name and
{rows} rows · {cols} cols. - Center — detail: selecting a table shows its name (inline-editable), counters, tags, data grid, and Export, Add Row, and delete-table actions.
- Right — Create Table (slide-in panel): opens with + and has three tabs: Manual, Quick List, and CSV.
Create · Manual
- Table Name — unique name (e.g.
blocked_ips); used in{{placeholders}}. If it already exists, Affinity auto-appends a date suffix. - Description — what the table contains.
- Columns — name + type (
string,number,boolean,date). Starts withkeyandvalue; Add column for more. - Tags — comma-separated labels (e.g.
threat-intel, malware). - Confirm with Create Table. The table starts empty; add rows with Add Row or inline cell editing.
Create · Quick List
- Ideal for simple lists: IPs, domains, hashes, etc.
- List Name — table name (e.g.
blocked_ips). - Column Name — column name (default
value). - Values — paste plain-text values; delimiter auto-detected (newline, comma, or semicolon).
- Preview:
{N} values detectedwith the first values shown. - Confirm with Create List ({N} rows).
Create · CSV
- Drag or select a
.csvfile; the first row defines columns. - Preview:
{N} rows · {M} columns detectedwith a mini-table of the first rows. - Table Name and Description (optional).
- Confirm with Import CSV.
Manage data
- Click any cell to edit inline · Enter to save · Esc to cancel — direct grid editing.
- Add Row — adds an empty row (null values).
- Hover a row → trash icon to delete it.
- Click the table name → rename inline.
- Export — downloads CSV; delete the table with the header trash icon (asks for confirmation).
Placeholder syntax
- Single-column table
trusted_ips:WHERE "src_endpoint_ip" NOT IN ({{trusted_ips}}) - Multi-column table
vip_users, columnemail:WHERE "actor_user_uid" IN ({{vip_users.email}}) - At query time the engine resolves placeholders to SQL literals.
- Placeholders work in Logs (Run Query) and the alerts engine (Detection Rules).