Exporting events
You can download your events as a CSV, JSON or SARIF file from the Events page or through the EyalSec API. This page explains how, how to export exactly what the events page shows, and how to send your findings to GitHub code scanning.
How to export
On the Events page, set the filters you want, click Export at the end of the toolbar and pick CSV, JSON or SARIF, for code scanning. The file holds every event the list matches, not only the rows you have scrolled to, with the detail you see when you open a row (origin, stack trace and so on). The button reads Exporting… until the file is saved.
Over the API, one request returns the same file. You need an API key.
curl -s -X POST 'https://eyalsec.com/api/events_export?format=csv' \
-H "X-API-Key: es2_EXAMPLE_KEY" \
-H "Content-Type: application/json" \
-d '{"view":"python","severity":["critical","high"],"from":"2026-09-01"}' \
-o findings.csv
Use format=json for JSON, or format=sarif for SARIF. An empty body (-d '{}') exports everything your account can see.
Choosing what to export
The request takes the same filters as the events list, and they mean the same thing, so the file holds the rows the page would show you. The most useful ones:
| Field | Same as on the page |
|---|---|
view |
the list: python, browser, go, ... |
from, to |
the time range (as a date or timestamp) |
machine |
the Machine filter (the machine's name) |
severity |
the Severity filter, a list |
sources |
the es-python Source filter, a list |
tags |
the Tag filter, a list |
bucket |
Show: live, suppressed or all |
advanced |
the conditions, for example a single run |
sort |
Sort: newest (the default) or severity, the order of the rows in the file |
Your blocked events apply to the export exactly as they do on the page.
What the file contains
Each row is one event, with its id, time, severity, product, machine, sink, source, value, count, page or context, origin, repr created, stack trace, whether it is suppressed and why, and its impact tags.
An export stops at 50,000 rows and says so: a CSV ends with a row starting TRUNCATED, and JSON has "truncated": true. Narrow the time range or the filters and export the rest in parts. With "sort": "severity", a file that stops at the cap holds the most severe events.
SARIF for code scanning
SARIF is the format code scanning tools share. GitHub code scanning, GitLab, Azure DevOps and many editors can read it. With format=sarif you get a .sarif file that puts EyalSec findings next to the ones your other scanners already report.
The file holds one run from the tool EyalSec. Each sink is a rule, and each event is a result. The result names the product that saw it, such as es-python.
- Level. Critical and High events are
error. Medium events arewarning. Low and Info events arenote. - Location. The result points at the first frame of the event's stack trace that is in your own code and names a file and line. Frames in the language runtime and in installed packages are skipped when your code is on the stack. A page event in the browser points at the script and line it came from. An event with no file at all, for example from a product that reports no stack trace, points at the machine (
eyalsec://machine/<name>) and names the sink. - Paths. Add
source_rootwith the folder your program ran from, for examplesource_root=/srv/app. Paths under it become relative to it, so they match the files in your repository. Paths that are already relative, such asapp/views.py, stay as they are. - Repeat uploads. Each result carries the event's unique event key as a fingerprint. Upload the same events again and the existing alerts are updated, not doubled.
The rest of the event (machine, source, value, origin, full stack trace, count) is in each result's properties.
Upload to GitHub code scanning
Code scanning must be available on the repository. Save an API key as a repository secret named EYALSEC_API_KEY, then add a workflow like this one:
name: EyalSec findings
on:
schedule:
- cron: "0 6 * * *"
workflow_dispatch:
permissions:
contents: read
security-events: write
jobs:
upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Export EyalSec findings
run: |
curl -sf -X POST "https://eyalsec.com/api/events_export?format=sarif&source_root=/srv/app" \
-H "X-API-Key: ${{ secrets.EYALSEC_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{"view":"python","severity":["critical","high","medium"]}' \
-o eyalsec.sarif
- uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: eyalsec.sarif
category: eyalsec-python
Change /srv/app to the folder your program runs from, and view to the product you use. Use one category per product, so one upload does not replace another.
The findings then appear under Security, Code scanning. GitHub accepts up to 25,000 results in one file and shows the 5,000 most severe, so filter by severity, machine or date if you have more.
Other ways to get events out
To read events page by page, or to fetch one event's full detail, use the events API. The field reference, the response format and more examples are on Events API.