158 lines
5.0 KiB
TypeScript
158 lines
5.0 KiB
TypeScript
import type { Construct } from 'constructs';
|
|
import { Resource } from '../../core';
|
|
import type { ILogGroupRef } from '../../interfaces/generated/aws-logs-interfaces.generated';
|
|
/**
|
|
* Properties for a QueryString
|
|
*/
|
|
export interface QueryStringProps {
|
|
/**
|
|
* Retrieves the specified fields from log events for display.
|
|
*
|
|
* @default - no fields in QueryString
|
|
*/
|
|
readonly fields?: string[];
|
|
/**
|
|
* A single statement for parsing data from a log field and creating ephemeral fields that can
|
|
* be processed further in the query.
|
|
*
|
|
* @deprecated Use `parseStatements` instead
|
|
* @default - no parse in QueryString
|
|
*/
|
|
readonly parse?: string;
|
|
/**
|
|
* An array of one or more statements for parsing data from a log field and creating ephemeral
|
|
* fields that can be processed further in the query. Each provided statement generates a separate
|
|
* parse line in the query string.
|
|
*
|
|
* Note: If provided, this property overrides any value provided for the `parse` property.
|
|
*
|
|
* @default - no parse in QueryString
|
|
*/
|
|
readonly parseStatements?: string[];
|
|
/**
|
|
* A single statement for filtering the results of a query based on a boolean expression.
|
|
*
|
|
* @deprecated Use `filterStatements` instead
|
|
* @default - no filter in QueryString
|
|
*/
|
|
readonly filter?: string;
|
|
/**
|
|
* An array of one or more statements for filtering the results of a query based on a boolean
|
|
* expression. Each provided statement generates a separate filter line in the query string.
|
|
*
|
|
* Note: If provided, this property overrides any value provided for the `filter` property.
|
|
*
|
|
* @default - no filter in QueryString
|
|
*/
|
|
readonly filterStatements?: string[];
|
|
/**
|
|
* A single statement for using log field values to calculate aggregate statistics.
|
|
*
|
|
* @deprecated Use `statsStatements` instead
|
|
* @default - no stats in QueryString
|
|
*/
|
|
readonly stats?: string;
|
|
/**
|
|
* An array of one or more statements for calculating aggregate statistics.
|
|
* CloudWatch Logs Insights supports up to two stats commands in a single query.
|
|
* Each provided statement generates a separate stats line in the query string.
|
|
*
|
|
* Note: If provided, this property overrides any value provided for the `stats` property.
|
|
*
|
|
* @default - no stats in QueryString
|
|
*/
|
|
readonly statsStatements?: string[];
|
|
/**
|
|
* Sorts the retrieved log events.
|
|
*
|
|
* @default - no sort in QueryString
|
|
*/
|
|
readonly sort?: string;
|
|
/**
|
|
* Specifies the number of log events returned by the query.
|
|
*
|
|
* @default - no limit in QueryString
|
|
*/
|
|
readonly limit?: Number;
|
|
/**
|
|
* Specifies which fields to display in the query results.
|
|
*
|
|
* @default - no display in QueryString
|
|
*/
|
|
readonly display?: string;
|
|
}
|
|
/**
|
|
* Define a QueryString
|
|
*/
|
|
export declare class QueryString {
|
|
private readonly fields?;
|
|
private readonly parse;
|
|
private readonly filter;
|
|
private readonly stats;
|
|
private readonly sort?;
|
|
private readonly limit?;
|
|
private readonly display?;
|
|
/**
|
|
* Length of statsStatements
|
|
*/
|
|
readonly statsStatementsLength?: number;
|
|
/**
|
|
* If the props for the query string have both stats and statsStatements
|
|
*/
|
|
readonly hasStatsAndStatsStatements: boolean;
|
|
constructor(props?: QueryStringProps);
|
|
/**
|
|
* String representation of this QueryString.
|
|
*/
|
|
toString(): string;
|
|
/**
|
|
* Build an array of query lines given a command and statement(s).
|
|
*
|
|
* @param command a query command
|
|
* @param statements one or more query statements for the specified command, or undefined
|
|
* @returns an array of the query string lines generated from the provided command and statements
|
|
*/
|
|
private buildQueryLines;
|
|
/**
|
|
* Build a single query line given a command and statement.
|
|
*
|
|
* @param command a query command
|
|
* @param statement a single query statement
|
|
* @returns a single query string line generated from the provided command and statement
|
|
*/
|
|
private buildQueryLine;
|
|
}
|
|
/**
|
|
* Properties for a QueryDefinition
|
|
*/
|
|
export interface QueryDefinitionProps {
|
|
/**
|
|
* Name of the query definition.
|
|
*/
|
|
readonly queryDefinitionName: string;
|
|
/**
|
|
* The query string to use for this query definition.
|
|
*/
|
|
readonly queryString: QueryString;
|
|
/**
|
|
* Specify certain log groups for the query definition.
|
|
*
|
|
* @default - no specified log groups
|
|
*/
|
|
readonly logGroups?: ILogGroupRef[];
|
|
}
|
|
/**
|
|
* Define a query definition for CloudWatch Logs Insights
|
|
*/
|
|
export declare class QueryDefinition extends Resource {
|
|
/** Uniquely identifies this class. */
|
|
static readonly PROPERTY_INJECTION_ID: string;
|
|
/**
|
|
* The ID of the query definition.
|
|
*
|
|
* @attribute
|
|
*/
|
|
readonly queryDefinitionId: string;
|
|
constructor(scope: Construct, id: string, props: QueryDefinitionProps);
|
|
}
|