https://github.com/jakesidsmith/sentry-events
CLI to list Sentry events
https://github.com/jakesidsmith/sentry-events
Last synced: 3 months ago
JSON representation
CLI to list Sentry events
- Host: GitHub
- URL: https://github.com/jakesidsmith/sentry-events
- Owner: JakeSidSmith
- License: mit
- Created: 2018-10-29T13:07:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-29T13:22:56.000Z (over 6 years ago)
- Last Synced: 2025-01-02T09:45:34.940Z (5 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Sentry Events
**CLI to list Sentry events**
## Install
Install from GitHub as a global CLI with:
```
npm i jakesidsmith/sentry-events -g
```## Setup
Add a Sentry token to the environment that has access to project events.
You could define this in your `.bash_profile` or equivalent:
```
export SENTRY_TOKEN="your-token-here"
```Or prefix your calls to this library with:
```
SENTRY_TOKEN="you-token-here" sentry-events organization/project
```## Making requests
Simply call this library with the organization/project in the format "organization/project".
```
sentry-events organization/project
```## Storing data
You can put the output into a file with bash:
```
sentry-events organization/project > output.json
```## Filtering data
I'd recommend using the [jq](https://stedolan.github.io/jq/) to filter the output json.
To list all referers you can filter with jq like so:
```
cat output.json | jq '.events[].entries[].data.headers[]? | select(.[0] == "Referer")[1]'
```Or you could construct your own object containing the error message and the referer:
```
cat output.json | jq '.events[] | select(.entries[].data.headers[]?[0] == "Referer") | {error: .metadata.value, referer: .entries[].data.headers[]? | select(.[0] == "Referer")[1]}'
```