-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsearch.mjs
More file actions
20 lines (15 loc) · 769 Bytes
/
search.mjs
File metadata and controls
20 lines (15 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// An example of searching Secure Audit Log for specific events.
/* eslint-disable no-console */
import { PangeaConfig, AuditService } from "pangea-node-sdk";
const token = process.env.PANGEA_AUDIT_TOKEN;
const config = new PangeaConfig({ domain: process.env.PANGEA_DOMAIN });
const audit = new AuditService(token, config);
(async () => {
// Search for audit events with actor "Dennis" or target "Grant". More
// information about the search syntax can be found at
// <https://pangea.cloud/docs/audit/using-secure-audit-log/searching-the-logs#search-syntax>.
const response = await audit.search('actor:"Dennis" OR target:"Grant"');
// Log the results.
console.log(`Found ${response.result.count} events.`);
console.log(response.result.events);
})();