Tool Detect & Hunt
Hunt Query Builder
Build a hunting query in KQL, SPL, LogScale or PowerQuery against documented field names, or start from a prebuilt hunt.
Build a hunting query in the language your platform speaks: KQL, SPL, LogScale or PowerQuery. Every field name comes from that platform's own documentation, and the prebuilt hunts load straight into the form.
This runs in your browser. Nothing you type or open is uploaded.
How to read it
Start from a prebuilt hunt when one fits. Each says what it finds, what data it needs and where the noise comes from.
Filter as early as you can, aggregate after, and sort before you truncate. Those three habits fix most slow or wrong hunting queries.
Field names do not map one to one between platforms, so each tab builds its own query rather than translating another tab's.
Tab by tab
KQL
Build a Kusto query for Defender XDR advanced hunting or a Sentinel workspace, one clause at a time. It writes query text and nothing else. There is no tenant connection, so you copy the result and run it yourself.
Start from a hunt, then edit it. Each one says what it finds and how to tune it before you trust the results.
Use the case-insensitive operators (=~, in~, has) for file names and command lines. Attackers change case, and == is case-sensitive.
It covers one table piped through where, summarize, project, sort and take. Joins and let statements are out of scope.
SPL
Build a Splunk search as a base search plus a pipeline of commands. It writes SPL. It does not run it.
Always set a time range. A triage search without one is an all-time scan of every index you can read.
Order matters more than syntax. Filter before stats, because once you aggregate, the field you wanted to filter on is gone.
Stats takes aggregations as count, dc(user) as users. Sort takes fields with a leading minus for descending.
| Command | Syntax | What it does |
|---|---|---|
| where | where <eval-expression> | Filters results with an eval expression, so you can compare one field against another. |
| eval | eval <field>=<expression>[, <field>=<expression>]... | Calculates an expression and puts the result into a new or existing field. |
| stats | stats <agg-function>(<field>) [AS <name>] [BY <field-list>] | Aggregates events into statistics, optionally grouped by one or more fields. |
| sort | sort [<count>] (+|-)<field>[, (+|-)<field>]... | Orders results by the given fields. Minus for descending, plus for ascending. |
| table | table <field-list> | Keeps only the listed fields and renders them as a table, in the order given. |
| head | head [<N>] | Returns only the first N results. Splunk documents the default N as 10. |
LogScale
Build a Falcon LogScale query for Advanced Event Search. It writes query text with no connection to any tenant.
Pick the event first. ProcessRollup2 is where nearly every hunt starts: what ran, as whom, from where.
Check field names against the Event Data Dictionary in your own console. A field name that is slightly wrong returns zero rows, and zero rows looks like nothing to find.
Use groupBy to stack-count. The rare values at the bottom are usually the interesting ones.
PowerQuery
Build a SentinelOne PowerQuery for Singularity Event Search: a filter expression, then group, filter, sort, limit and columns.
Terms in the filter are joined by a space, which means AND. A query grows by adding conditions, not by nesting them.
src.* is the parent process and tgt.* is the child. Mixing them up is the most common reason a hunt returns nothing.
Use contains:anycase for names and command lines. Plain contains is case-sensitive.
Terms behind it
- Threat Hunting: Proactively searching for threats that evaded detection.
- Hunt Hypothesis: A testable assumption about adversary activity that guides a hunt.
- SIEM: Central platform that aggregates logs to alert, search, and investigate.
- Log Normalization: Mapping diverse log formats onto a single common schema.
- Detection Engineering: The discipline of designing, building, and maintaining detections.
Sources
- Kusto Query Language (KQL) overview. Microsoft's own reference landing page for the whole language: the authority on every operator, function, and data type beyond the single-table pipeline this builder assembles.
- Advanced hunting schema reference (Microsoft Defender XDR). The complete list of advanced hunting tables, each linking to its own per-column schema page. The authority on the full column set this builder only carries a DFIR-relevant subset of.
- Advanced hunting query best practices. Microsoft's documented guidance on writing queries that don't time out (filter early, has beats contains, project selectively), and the source of the performance hints this tool surfaces as you build.
- Kusto string operators reference. The per-operator table that settles which string comparisons are case-sensitive, plus the explanation of how term indexing makes has fundamentally different from contains.
- Splunk Search Reference: Command quick reference. Splunk's own alphabetical index of every SPL search command, each with a one-line description and a link to its full syntax page. The authoritative answer to "is there a command for this?", and the source every command name and syntax line on this page was verified against.
- Splunk Search Manual: Anatomy of a search. Splunk's own breakdown of how a search is put together (search terms, commands, functions, arguments, clauses), and what the pipe actually does between stages. Worth reading once if the pipeline model this builder is organized around is new to you.
- Splunk Search Reference: Time modifiers. The full specification for earliest/latest, the relative-time format, the snap-to (@) operator, and the complete table of valid time unit abbreviations, including the absolute-timestamp forms this builder passes through verbatim rather than modeling.
- SentinelOne: Transform Your Data On The Fly! (PowerQuery primer). SentinelOne's own introduction to PowerQuery, and the single most useful public page on the syntax: it walks one complete query through group, let, sort, filter, limit and columns in order, which is the pipeline this builder is organized around.
- SentinelOne: PowerQuery Brings New Data Analytics Capabilities to Singularity XDR. The vendor's own command list (filter, columns, group by, join, limit, sort, transpose, parse, union, let) with the aggregate function names each one accepts. Worth reading for the four commands this builder deliberately leaves out.
- SentinelOne: Singularity Operations Center. Carries two complete worked PowerQueries against real investigation questions: a command-frequency hunt and an outbound-connection hunt. Short, but it is vendor-published query text, which makes it a primary source for field spellings.
Worth using too
- Microsoft Sentinel & Defender XDR content repository. The MIT-licensed, community-contributed repository of real hunting queries, detection rules, workbooks, and parsers for Sentinel and Defender: thousands of working KQL queries to read, adapt, and learn the idioms from.
- Must Learn KQL (Rod Trent). A free, MIT-licensed 21-part KQL course with queries, an eBook, workshop material, and companion videos. The resource most people are pointed at when they ask how to actually learn the language.
- Splunk Boss of the SOC (BOTS) v3 dataset. Splunk's free, CC0-licensed CTF dataset: pre-indexed Windows, Linux, AWS, cloud, and network telemetry from a simulated intrusion. The realistic way to practice the query shapes on this page against data that actually has something to find.
- Splunk Cheat Sheet: Query, SPL, RegEx, & Commands. Splunk's own practical cheat sheet: the core concepts, the commonly-used commands with worked query examples, eval functions, regex patterns, and time formatting: a faster lookup than the full reference once you know what you're after.
- SentineLabs: S1QL-Queries. SentinelOne Research's own repository of hunting queries, each with its ATT&CK tags, false positives and minimum agent version. Written in the earlier S1QL dialect rather than PowerQuery, so read it for the detection logic and translate the field names.
- pySigma-backend-sentinelone-pq. The maintained Sigma-to-PowerQuery backend. Its processing pipeline is effectively a published Sigma-field-to-SentinelOne-field mapping table, which makes it the most useful public cross-reference for a field name you can't find anywhere else.