Skip to content

Commit

Permalink
Merge pull request #9 from pathakamit88/BWVONE-23224
Browse files Browse the repository at this point in the history
Adding command line limit argument for access event logs
  • Loading branch information
bitonio authored Jan 20, 2022
2 parents 3190969 + 0d16bc2 commit 6e4e694
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions bin/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def __init__(self, config_values, configuration, flags=None):
help="Use API version 1 for access logs.")
event_parser.add_argument('--v2', '-2', dest="log_version", action="store_const", const=2, default=2,
help="Use API version 2 for access logs.")
event_parser.add_argument('--limit', type=int, default=1000,
help="Size of logs to fetch in one API call. Max supported 5000")
event_parser.add_argument('--tail', '-f', action='store_true', default=False,
help="""Do not stop when most recent log is reached,
but rather to wait for additional data to be appended to the input.""")
Expand Down
3 changes: 2 additions & 1 deletion libeaa/eventlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def fetch_logs(self, exit_fn, stop_event):
'ets': str(ets),
'metrics': 'logs',
'es_fields': 'flog',
'limit': '1000',
'limit': config.limit,
'sub_metrics': 'scroll',
'source': SOURCE
}
Expand All @@ -305,6 +305,7 @@ def fetch_logs(self, exit_fn, stop_event):
(time.strftime('%m/%d/%Y %H:%M:%S UTC', time.gmtime(ets/1000.)), ets/1000.))
cli.print("# Total: %s event(s), %s error(s), %s bytes written" %
(self.line_count, self.error_count, total_bytes))
cli.print("Total time taken %s seconds" % (time.time() - s))
break
else:
elapsed = time.time() - s
Expand Down

0 comments on commit 6e4e694

Please sign in to comment.