Skip to content

Commit

Permalink
Addressed comments: updating readme and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry-shao committed Apr 19, 2022
1 parent d14c873 commit 03fcd99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-logs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ Example:
new logs.QueryDefinition(this, 'QueryDefinition', {
queryDefinitionName: 'MyQuery',
queryString: new logs.QueryString({
fields: '@timestamp, @message',
fields: ['@timestamp', '@message'],
sort: '@timestamp desc',
limit: 20,
}),
Expand Down
20 changes: 7 additions & 13 deletions packages/@aws-cdk/aws-logs/lib/query-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,49 @@ export interface QueryStringProps {
/**
* Retrieves the specified fields from log events for display.
*
* @default undefined no fields in QueryString
* @default - no fields in QueryString
*/
readonly fields?: string[];

/**
* Extracts data from a log field and creates one or more ephemeral fields that you can process further in the query.
*
* @default undefined no parse in QueryString
* @default - no parse in QueryString
*/
readonly parse?: string;

/**
* Filters the results of a query that's based on one or more conditions.
*
* @default undefined no filter in QueryString
* @default - no filter in QueryString
*/
readonly filter?: string;

/**
* Uses log field values to calculate aggregate statistics.
*
* @default undefined no stats in QueryString
* @default - no stats in QueryString
*/
readonly stats?: string;

/**
* Sorts the retrieved log events.
*
* @default undefined no sort in QueryString
* @default - no sort in QueryString
*/
readonly sort?: string;

/**
* Specifies the number of log events returned by the query.
*
* @default undefined no limit in QueryString
* @default - no limit in QueryString
*/
readonly limit?: Number;

/**
* Specifies which fields to display in the query results.
*
* @default undefined no display in QueryString
* @default - no display in QueryString
*/
readonly display?: string;
}
Expand All @@ -73,17 +73,11 @@ interface QueryStringMap {
*/
export class QueryString {
private readonly fields?: string[];

private readonly parse?: string;

private readonly filter?: string;

private readonly stats?: string;

private readonly sort?: string;

private readonly limit?: Number;

private readonly display?: string;

constructor(props: QueryStringProps = {}) {
Expand Down

0 comments on commit 03fcd99

Please sign in to comment.