You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+58
Original file line number
Diff line number
Diff line change
@@ -165,6 +165,64 @@ Open your browser to http://localhost:9090.
165
165
166
166
An example of a useful query is [rate(kubewatch_event_count[5m])](<http://localhost:9090/graph?g0.range_input=1h&g0.expr=rate(kubewatch_event_count%5B1m%5D)&g0.tab=0>)
167
167
168
+
## Event filtering
169
+
170
+
Events can be excluded from Sloop by adding `exclusionRules` to the config file:
Adding rules can help to reduce resources consumed by Sloop and remove unwanted noise from the UI for events that are of no interest.
194
+
195
+
### Limiting rules to specific kinds
196
+
197
+
* Rules under the special key `_any` are evaluated against events for objects of any kind
198
+
* Rules under any other key are evaluated only against objects whose kind matches the key, e.g. `Pod` only applies to pods, `Job` only applies to jobs etc.
199
+
200
+
### Rule format and supported operations
201
+
202
+
Rules should follow the [JsonLogic](https://jsonlogic.com) format and are evaluated against the json representation of the Kubernetes API object related to the event (see below).
203
+
204
+
Available operators, such as `==` and `in` shown above, are documented [here](https://jsonlogic.com/operations.html).
205
+
206
+
### Data available to rule logic
207
+
208
+
Kubernetes API conventions for [objects](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#objects) require the following keys to exist in the json data for all resources, all of which can be referenced in rules:
209
+
210
+
*`metadata`
211
+
*`spec`
212
+
*`status`
213
+
214
+
Some commonly useful fields under the `metadata`[object](https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#ObjectMeta) are:
215
+
216
+
*`name`
217
+
*`namespace`
218
+
*`labels`
219
+
220
+
#### Type specific data
221
+
222
+
Some resources contain additional type-specific fields, for example `PersistentVolumeClaimSpec` objects have fields named `selector` and `storageClassName`.
223
+
224
+
Type specific fields for each object and their corresponding keys in the object json representation are documented in the [core API](https://pkg.go.dev/k8s.io/[email protected]/core/v1), e.g. for `PersistentVolumeClaimSpec` objects the documentation is [here](https://pkg.go.dev/k8s.io/[email protected]/core/v1#PersistentVolumeClaimSpec).
0 commit comments