inputlookup
Read one of your lookup tables as search results, or fetch rows from a URL.
Use inputlookup to read your lookup table as search results. You can also fetch rows from an HTTP(S) URL.
inputlookup is a generating command: it starts the search instead of reading events.
Syntax
| inputlookup <table>
| inputlookup url="<url>" [format=json|csv|ndjson] [key=<field>] [timeout=<seconds>] [max_rows=<n>] [cache_ttl=<seconds>]The leading | is optional: inputlookup threat_iocs on its own also runs the command. To search for the words "inputlookup threat_iocs" instead, quote them or start with search.
| Argument | Default | Description |
|---|---|---|
table | — | Name of one of your lookup tables. Letters, digits, _, - and .. |
url="…" | — | URL to fetch instead of a table (see below). |
format | json | How to parse the URL response: json (an array or a single object), csv (with a header row) or ndjson. |
key | — | Enrichment mode: the event field whose value fills {field} placeholders in the URL. |
timeout | 30 | Request timeout in seconds, clamped to 1–60. |
max_rows | 10000 | Maximum rows to read, 1–100000. Values outside the range are a syntax error. |
cache_ttl | 300 | Seconds to cache a URL response, capped at 3600. 0 disables the cache. |
Examples
List a watchlist table:
| inputlookup threat_iocsRead the asset inventory and keep the critical servers:
| inputlookup asset_inventory | where criticality="high" | table hostname, owner, criticalityCount assets per owner:
| inputlookup asset_inventory | stats count by owner | sort -countSweep every value in a table across your logs. This is a search term, not inputlookup; see retro:
ioc in lookup("threat_iocs") | stats count by metadata.log_sourceURL mode
| inputlookup url="https://feeds.example.com/blocklist.csv" format=csv max_rows=50000Fetches the URL and returns its rows. With key=<field>, the URL is fetched once per distinct value of that field, the value is substituted into the {field} placeholder, and the response columns are added to each row with an inputlookup_ prefix.
Run commands after enrichment
inputlookup is not compiled into the ClickHouse query. The search splits at the first lookup, prevalence, inputlookup, resolve_identity, ai or lateral stage, and every command after it runs in post-processing. Only these commands work there: where, head, tail, sort, table, stats, dedup, rename, fields, top, rare, fillnull, eval, timechart, rex, risk, reverse, tree.