Skip to content

GetLogGroupFields

Source: src/AWS/Logs/GetLogGroupFields.ts

Runtime binding for logs:GetLogGroupFields (CloudWatch Logs Insights).

Bind this operation to a LogGroup inside a function runtime to discover the fields present in the group’s recent log events (and the percentage of events each field appears in), automatically injecting the log group name. Useful for building Insights queries dynamically.

const getLogGroupFields = yield* AWS.Logs.GetLogGroupFields(logGroup);
const { logGroupFields } = yield* getLogGroupFields();
// e.g. [{ name: "@timestamp", percent: 100 }, { name: "@message", ... }]