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-06From 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.