{"id":19236192,"url":"https://github.com/adriankeenan/bugsnag-event-csv","last_synced_at":"2025-04-11T03:36:40.152Z","repository":{"id":72453686,"uuid":"361003471","full_name":"adriankeenan/bugsnag-event-csv","owner":"adriankeenan","description":"CLi tool for exporting Bugsnag error events to a CSV","archived":false,"fork":false,"pushed_at":"2023-11-08T23:47:56.000Z","size":5784,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T01:38:17.232Z","etag":null,"topics":["bugsnag","cli","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adriankeenan.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-23T20:54:57.000Z","updated_at":"2024-03-08T10:54:47.000Z","dependencies_parsed_at":"2023-11-08T23:36:22.115Z","dependency_job_id":"64b6ae7c-1361-4630-86cc-766098cd00d3","html_url":"https://github.com/adriankeenan/bugsnag-event-csv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriankeenan%2Fbugsnag-event-csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriankeenan%2Fbugsnag-event-csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriankeenan%2Fbugsnag-event-csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriankeenan%2Fbugsnag-event-csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adriankeenan","download_url":"https://codeload.github.com/adriankeenan/bugsnag-event-csv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248338026,"owners_count":21087150,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bugsnag","cli","php"],"created_at":"2024-11-09T16:19:26.476Z","updated_at":"2025-04-11T03:36:40.126Z","avatar_url":"https://github.com/adriankeenan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bugsnag-event-csv\n\n[![Test badge](https://github.com/adriankeenan/bugsnag-event-csv/actions/workflows/test.yaml/badge.svg)](https://github.com/adriankeenan/bugsnag-event-csv/actions/workflows/test.yaml)\n\nCLi tool for exporting Bugsnag error events to a CSV. The columns can be customised to included structured metadata.\nThis can be useful for creating custom reports or cleaning up after an error occurs (re-attempting operations, updating\naffected database entries etc).\n\nExample:\n```\nbugsnag-event-csv org project error-id \\\n    --api_key api-key \\\n    --event_count 5 \\\n    --column exceptions.0.message:exception_message \\\n    --column user.id:user_id\n```\n\n```csv\nid,received_at,exception_message,user_id\n60847fbf0077caffca990000,2021-04-24T20:29:51.474Z,\"Test exception A\",8434\n60847fbe0077cb15e55b0000,2021-04-24T20:29:50.697Z,\"Test exception A\",4869\n60847fbd0077c259a0c80000,2021-04-24T20:29:49.026Z,\"Test exception A\",3083\n60847fbd0077c4fd05680000,2021-04-24T20:29:49.884Z,\"Test exception A\",7407\n60847fac0077f8f0cc660000,2021-04-24T20:29:32.946Z,\"Test exception A\",6675\n```\n\nThis tool does not include the ability to filter results. This can be achieved with other tools which can apply\ntransformations on CSVs such as `csvsql` in [csvkit](https://csvkit.readthedocs.io/en/latest/),\neg `bugsnag-event-csv ... | csvsql --query \"select * from stdin where column = 'value' \u003e out.csv\"`.\n\n\n## Installation\n\n### Docker\n\nRun as a docker container\n\n`docker run adriankeenan/bugsnag-event-csv ...`\n\n\n### Executable\n\nYou can copy the pre-built phar to a folder in your path for easy access.\n\n```\nwget https://raw.githubusercontent.com/adriankeenan/bugsnag-event-csv/master/dist/bugsnag-event-csv \\\n    \u0026\u0026 chmod +x bugsnag-event-csv \\\n    \u0026\u0026 sudo mv bugsnag-event-csv /usr/local/bin/bugsnag-event-csv\n```\n\n## Development\n\nRun the script using `php bin/main.php`\n\nRun tests using `composer test`\n\nBuild a distributable .phar with `composer build-phar`\n\n## Usage\n\nRun `bugsnag-event-csv ORG_ID_OR_SLUG PROJECT_ID_OR_SLUG ERROR_IDS --api_key API_KEY`\n\n### Keys\n\nThe API key does not need to be specified in the `--api_key` option if it is set in an ENV var `BUGNSAG_API_KEY`.\n\n### Multiple errors\n\nYou can fetch events from multiple errors, eg if the same error is recorded as multiple errors within bugsnag, by\nsupplying multiple error IDs separated by a comma.\n\n### Event count\n\nBy default, the last 100 events are returned, however you can use `--event_count X` to increase the number of events\nreturned. In theory this can be infinite as the API client supports pagination, however this will take a long time if\nthere are a lot of events due to API rate limits.\n\n### Adding columns\n\nA standard set of columns will be exported by default. You can add additional columns from any field in the Bugsnag \nerrors API response. To add additional columns, add column arguments `--column PATH_TO_VALUE:NAME` \nwhere `PATH_TO_VALUE` is the dot notation for the value in the\n[event response](https://bugsnagapiv2.docs.apiary.io/#reference/errors/errors/list-the-errors-on-a-project) and `NAME`\nis the name to use in the CSV header row. For example, to add a \"device id\" column for a custom `device_id` meta field,\nuse `--column \"metaData.device_id:device id\"`,\n\n### Inspecting responses\n\nYou can inspect the raw response from Bugsnag in order to determine the data paths by using the `--raw`\noption.\n\n### Formatting\n\nStructured data (such as arrays and objects) will be serialised as JSON strings. Options are available for specifying\nthe values of `true`, `false`, `null` and non-existent values. Use the `--help` option to see these options.\n\n# License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadriankeenan%2Fbugsnag-event-csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadriankeenan%2Fbugsnag-event-csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadriankeenan%2Fbugsnag-event-csv/lists"}