This Ruby CLI tool is designed to extract event data from the Bugsnag API and output it in a CSV format. It's useful for analyzing and archiving Bugsnag events for projects and organizations. The script handles pagination and rate limiting, ensuring all desired data is fetched efficiently and reliably.
- Ruby
- Bundler
- Clone or download this repository:
git clone https://github.com/cbartlett/bugsnag-extract
- Navigate to the script's directory:
cd bugsnag-extract
Several command-line options are available for specifying details like the Bugsnag authentication token, organization name, project name, and error ID.
-tTOKEN
or--token=TOKEN
: Required. Your Bugsnag authentication token.-oORG
or--organization=ORG
: Bugsnag organization name. If omitted, the first organization accessible to the token will be used.-pPROJECT
or--project=PROJECT
: Bugsnag project name within the specified organization. If omitted, the first project in the organization will be used.-eERROR_ID
or--error-id=ERROR_ID
: Required. The error ID for which events are to be fetched.
./script.rb -t YOUR_BUGSNAG_TOKEN -e YOUR_ERROR_ID
The script will output the events data in CSV format to standard output. Redirect the output to a file if you want to save it.
The script includes logic to handle Bugsnag API's rate limiting. If the rate limit is exceeded, the script will pause for a brief period before retrying the request.
Contributions to this project are welcome. Please ensure that your code adheres to the existing style and that all tests pass.
Released under the terms of the MIT license.