For Elastic Security and Kibana
Practise and learn Elastic KQL and ES|QL
Elastic Security and Kibana give you two ways to search. KQL filters events, and ES|QL counts, sorts and shapes the results. Practise both with exercises written like the tickets you get on shift, on realistic lab data, and see straight away whether your query found the right rows.
ELASTIC · KQL
event.category : "process"
and process.parent.name : "OUTLOOK.EXE"
and process.name : ("powershell.exe" or "cmd.exe")
Questions you’ll answer
Every exercise starts as a ticket. You write the query that answers it.
event.category : "process"
and process.name : ("powershell.exe" or "cmd.exe")
and host.name : dc-*
FROM logs-*
| WHERE event.category == "authentication"
AND event.outcome == "failure"
| STATS failures = COUNT(*) BY user.name
| SORT failures DESC
| LIMIT 10
Where you’ll use it
- Elastic SecuritySearch alerts, hosts and timelines.
- KibanaDiscover and dashboards use the same two languages.
What you’ll learn, from beginner to advanced
Twelve modules in three levels. Each one has a short lesson, questions to answer and then exercises.
Beginner
- Searching in DiscoverKQL’s
field : value, the time picker and data views. - Combining filters
and,or,not, brackets and*wildcards. - Ranges and missing fieldsRanges on numbers and dates, and
field : *to check a field exists. - Your first ES|QL query
FROM,WHERE,KEEP,SORTandLIMIT.
Intermediate
- Counting with STATS
STATS … BY,COUNT()andCOUNT_DISTINCT(). - Working with time
BUCKET()andDATE_TRUNC()for timelines. - Shaping results
EVAL,RENAME,DROPandCASE(). - Real investigationsProcess trees with
process.parent.name, failed sign-ins by user.
Advanced
- Parsing text
DISSECTandGROKto pull fields out of messages. - Enriching results
ENRICHandLOOKUP JOINto add context from other indices. - Multi-value fields
MV_EXPANDand theMV_functions. - Sequences of eventsEQL’s
sequence by, to catch one step followed by another.
Worth knowing before you start
- Kibana KQL shares a name with Microsoft’s KQL, but it’s a different language.
- KQL only filters. To count, sort or pick columns you need ES|QL.
- Field names follow the Elastic Common Schema, so
process.namemeans the same thing whatever sent the log.
Cheat sheet
Compare
Other languages
Be first in when it launches
Elastic KQL and ES|QL is one of the languages SOC Fluent launches with. Join the waitlist and we’ll email you once, on launch day.
Free to join. Students get 50% off at launch.