Iniciar sesión

Practice: building precise filters

12 min · 2 ejercicio(s)

Cheat sheet

Pattern Example
All conditions event.outcome: failure and service.name: ssh
Any condition user.name: root or user.name: admin
Exclude not host.name: srv-web-01
Value list user.name: (root or admin or ubuntu)
Grouping event.outcome: failure and (service.name: ssh or service.name: rdp)

Precedence: not binds tightest, then and, then or. When you mix and and or, always add parentheses, even if you think you know the rule. Your colleagues will thank you.

Excluding noise safely

not also matches documents where the field does not exist. not http.response.status_code: 200 therefore also returns auth or process events if you search across several indices. Combine exclusions with a positive condition that pins the event type:

event.category: process and not host.name: wks-it-06

From question to filter

Translate the question word by word: "successful logons by h.yilmaz that are not Windows desktop logons" becomes user.name: h.yilmaz and event.outcome: success and not service.name: windows.

Ejercicios prácticos de esta lección

Resuelve estos ejercicios con una consulta en el laboratorio Elasticsearch real. Inicia sesión gratis para acceder al laboratorio, las pistas y la corrección automática.

  1. 1. Failed remote logons

    Return all failed logons that used ssh or rdp. Your query is graded by its result.

  2. 2. The IT admin on servers

    How many successful logons does h.yilmaz have that are not normal Windows desktop logons (service.name: windows)?