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
@@ -237,6 +239,80 @@ properties `start`, `end`, and `duration` in the event. For example:
237
239
It's anticipated that more "helper" methods like this will be provided in the
238
240
future.
239
241
242
+
### Start
243
+
```typescript
244
+
245
+
exportinterfaceIEventLogClientService {
246
+
getClient(request:KibanaRequest):IEventLogClient;
247
+
}
248
+
249
+
exportinterfaceIEventLogClient {
250
+
findEventsBySavedObjectIds(
251
+
type:string,
252
+
ids:string[],
253
+
options?:Partial<FindOptionsType>
254
+
):Promise<QueryEventsBySavedObjectResult>;
255
+
}
256
+
```
257
+
258
+
The plugin exposes an `IEventLogClientService` object to plugins that pre-req it.
259
+
Those plugins need to call `getClient(request)` to get the event log client.
260
+
261
+
## Experimental RESTful API
262
+
263
+
Using of the event log allows you to retrive the events for a given saved object type by the specified set of IDs.
264
+
API listed below is experimental and could be changed or removed in the future.
265
+
266
+
### `GET /api/event_log/{type}/{id}/_find`: Get events for a given saved object type by the ID
267
+
268
+
Collects events information from the event log for the selected saved object by type and ID.
269
+
270
+
Params:
271
+
272
+
|Property|Description|Type|
273
+
|---|---|---|
274
+
|type|The type of the saved object whose events you're trying to get.|string|
275
+
|id|The id of the saved object.|string|
276
+
277
+
Query:
278
+
279
+
|Property|Description|Type|
280
+
|---|---|---|
281
+
|page|The page number.|number|
282
+
|per_page|The number of alerts to return per page.|number|
283
+
|sort_field|Sorts the response. Could be an event fields returned in the response.|string|
284
+
|sort_order|Sort direction, either `asc` or `desc`.|string|
285
+
|filter|A <<kuery-query, KQL>> string that you filter with an attribute from the event. It should look like event.action: "execute".|string|
286
+
|start|The date to start looking for saved object events in the event log. Either an ISO date string, or a duration string indicating time since now.|string|
287
+
|end|The date to end looking for saved object events in the event log. Either an ISO date string, or a duration string indicating time since now.|string|
288
+
289
+
### `POST /api/event_log/{type}/_find`: Retrive events for a given saved object type by the IDs
290
+
291
+
Collects events information from the event log for the selected saved object by type and a set of the IDs.
292
+
293
+
Params:
294
+
295
+
|Property|Description|Type|
296
+
|---|---|---|
297
+
|type|The type of the saved object whose events you're trying to get.|string|
298
+
299
+
Query:
300
+
301
+
|Property|Description|Type|
302
+
|---|---|---|
303
+
|page|The page number.|number|
304
+
|per_page|The number of alerts to return per page.|number|
305
+
|sort_field|Sorts the response. Could be an event fields returned in the response.|string|
306
+
|sort_order|Sort direction, either `asc` or `desc`.|string|
307
+
|filter|A <<kuery-query, KQL>> string that you filter with an attribute from the event. It should look like event.action: "execute".|string|
308
+
|start|The date to start looking for saved object events in the event log. Either an ISO date string, or a duration string indicating time since now.|string|
309
+
|end|The date to end looking for saved object events in the event log. Either an ISO date string, or a duration string indicating time since now.|string|
310
+
311
+
Body:
312
+
313
+
|Property|Description|Type|
314
+
|---|---|---|
315
+
|ids|The array ids of the saved object.|string array|
0 commit comments