QueryStringProps Struct
Properties for a QueryString.
Example
new logs.QueryDefinition(this, 'QueryDefinition', {
queryDefinitionName: 'MyQuery',
queryString: new logs.QueryString({
fields: ['@timestamp', '@message'],
parseStatements: [
'@message "[*] *" as loggingType, loggingMessage',
'@message "<*>: *" as differentLoggingType, differentLoggingMessage',
],
filterStatements: [
'loggingType = "ERROR"',
'loggingMessage = "A very strange error occurred!"',
],
statsStatements: [
'count(loggingMessage) as loggingErrors',
'count(differentLoggingMessage) as differentLoggingErrors',
],
sort: '@timestamp desc',
limit: 20,
}),
});
Properties
Default: no display in QueryString
Default: no fields in QueryString
Default: no filter in QueryString
filterStatementsstring[]filter_statementstyping.List[str]filterStatementsList<String>FilterStatementsstring[]FilterStatements*[]*string#Default: no filter in QueryString
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 limit in QueryString
Default: no parse in QueryString
parseStatementsstring[]parse_statementstyping.List[str]parseStatementsList<String>ParseStatementsstring[]ParseStatements*[]*string#Default: no parse in QueryString
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 sort in QueryString
Default: no stats in QueryString
statsStatementsstring[]stats_statementstyping.List[str]statsStatementsList<String>StatsStatementsstring[]StatsStatements*[]*string#Default: no stats in QueryString
notes
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.