Skip to content

Commit

Permalink
feat(logs): Add support for specifying the result limit
Browse files Browse the repository at this point in the history
  • Loading branch information
bcelenza committed Jul 13, 2023
1 parent 4737b4c commit de21426
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ process.on("SIGINT", async () => {
default: false,
description: "Return just the message in plain-text format (no CSV)",
})
.option("limit", {
alias: "i",
type: "number",
default: 1000,
description: "The limit to the number of results returned",
})
.demandOption("log-group", "At least one log group is required.")
.help()
.alias("help", "h").argv;
Expand All @@ -76,6 +82,7 @@ process.on("SIGINT", async () => {

const startTime = time.parseTimeOrDuration(args.start);
const endTime = time.parseTimeOrDuration(args.end);
const limit = args.limit;

const query = args._[0];
if (!query) {
Expand Down Expand Up @@ -107,6 +114,7 @@ process.on("SIGINT", async () => {
// CloudWatch uses standard unix timestamp (seconds since epoch)
startTime: Math.ceil(startTime / 1000),
endTime: Math.ceil(endTime / 1000),
limit,
})
);
runningQueryId = startOutput.queryId;
Expand Down

0 comments on commit de21426

Please sign in to comment.