Se connecter

Practice: fields, values and phrases

12 min · 2 exercice(s)

This chapter wraps up the module. Use the cheat sheet, then solve the extra exercises without hints first.

Cheat sheet

You want KQL Note
Exact value in a field user.name: m.keller Keyword fields match the whole value
Value with spaces event.reason: "bad password" Quotes make it a phrase
One of several values service.name: (ssh or rdp) Shorter than repeating the field
Any field contains a value 185.220.101.47 Free text: slow and imprecise, avoid in rules

How Kibana reads your query

  1. Kibana parses the KQL text into a tree of conditions.
  2. Every field: value becomes a match (text fields) or term (keyword, ip, number) query.
  3. The result is a filter: documents either match or they don't. There is no ranking in KQL.

Typical mistakes

  • Wrong case on keyword fields. service.name: SSH finds nothing when the data says ssh. Keyword matching is case-sensitive unless the field has a normalizer.
  • Forgetting quotes. event.reason: bad password is read as event.reason: bad or the free-text term password.
  • Typos in field names. KQL does not warn you about unknown fields, it just returns 0 hits. Check the field list in the sidebar.

Work like an analyst

Start broad and narrow down. First host.name: srv-web-01 to see what normal looks like, then add one condition at a time and watch how the hit count changes.

Exercices pratiques de cette leçon

Résolvez ces exercices avec une requête sur le lab Elasticsearch réel. Connectez-vous gratuitement pour accéder au lab, aux indices et à la correction automatique.

  1. 1. Remote workers

    How many logons in lab-auth came through the VPN (service.name is vpn)?

  2. 2. Who touches the domain controller?

    Write a query that returns every authentication event on the domain controller srv-dc-01. Your query is graded by its result.