Graylog2 / Graylog2/graylog2-server
Unable to search for events via API browser
- Dominant language
- Java
- Stars
- 8.1k
- Forks
- 1.1k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 217
Description
With the new event system I am unable to get a summary of the last events with the API browser. On the Alert tab from the web interface the search is working right and I get results as expected. Doing the API request for /events/search with the API browser the response is:
```
{
"type": "ApiError",
"message": "HTTP 415 Unsupported Media Type"
}
```
When I copy the browser request I caught with the developer tools and performing it as cURL on the command line I get the expected result as JSON.
## Expected Behavior
Getting the same results as at the search on the web interface "https://graylogurl/alerts"
## Current Behavior
Response is an ApiError:
```
{
"type": "ApiError",
"message": "HTTP 415 Unsupported Media Type"
}
```
## Possible Solution
Making the API browser doing the request with correct settings and add search options on the API browser like the time range as at the web interface.
## Steps to Reproduce (for bugs)
API browser: https://graylogurl/api/api-browser/#!/Events/search_post_0
Web interface: https://graylogurl/alerts
1. Perform a search for last events (1 day) on the web interface and get last alerts as result
2. Copy the request, perform it with cURL and get results
3. Do the same request with the API browser, result will be an ApiError
## Context
I am trying to get the last alerts from graylog to check with a external monitoring for current problems. With the switch to the new system with Graylog 3.1 I have to change the API requests to get the results as with the old system. Searching for the new correct request, I found out that the API browser can't do the request as it happens with the web interface or cURL.
## Your Environment
* Graylog Version:
Graylog 3.1.2+9e96b08 (Private Build 1.8.0_222 on Linux 4.4.0-166-generic)
* Elasticsearch Version:
6.8.3
* MongoDB Version:
3.6.14
* Operating System:
Ubuntu 16.04.6 LTS 4.4.0-166-generic
* Browser version:
Google Chrome 78.0.3904.70
Contributor guide
Assessment
This issue has not been assessed yet.