Skip to content
share

Monitoring Events

Events: What, Why, How?

Sematext Cloud can graph not only performance metrics or logs, but also events. Such events may represent what is happening with a server or cluster, with an application, etc. Think application or server restarts, builds, deployments, alerts, etc. Events are graphed as a timeline. Events timeline can be shown next to metrics or logs charts. This makes it possible to easily correlate events with metrics and/or logs. In addition to showing events as timeseries charts, a detailed listing of events can be seen and, of course, events can have tags, and can be searched and filtered.

Beyond events that you want to see as part of your operations intelligence think about events that matter to your team or your organization in general. All kinds of "business events" can be shipped to Sematext, too. Read more about adding custom events. You can create an event when your web application encounters an outage and when the problem which caused the outage has been fixed.

Besides being shown in the UI events are also exposed via a REST API that lets you post, retrieve, and search your events. This REST API matches the Elasticsearch API, so you can use any Elasticsearch tool or client to post, get, and search events.

Searching Events

Sematext Cloud lets you find events, metrics, and logs from a specific time period. Additionally, the event chart has a search box where you can further narrow down events to only those that match the input query. You can search on any event field you included in the event when posting it. The query syntax is the same as the logs search syntax.

Event Search API

Sematext exposes the Events Search HTTP API - as Elasticsearch search API-so events can be searched and retrieved programmatically via HTTP(S), using curl or any other Elasticsearch client. The API endpoint is:

https://event-receiver.sematext.com/APP_TOKEN

Alternatively, you can also use the same endpoint which was used when adding events, where event type is specified, in which case the matching events will be limited to the type specified in the URI:

https://event-receiver.sematext.com/APP_TOKEN/event

The simplest way to run a query is using URI search, like this:

curl
https://event-receiver.sematext.com/1111111-2222-3333-4444-555555555555/_search?q=creator:john \
-H 'Authorization: apiKey 1111111-2222-3333-4444-555555555555'

For more info about apiKey see .

More complex queries are available when using request body search, e.g.:

curl -XGET "https://event-receiver.sematext.com/1111111-2222-3333-4444-555555555555/_search" -d '
  "query" : {
    "query_string" : {
      "query" : "MyHost04",
      "default_field" : "message"
    }
  } 
' \
-H 'Authorization: apiKey 1111111-2222-3333-4444-555555555555' 

This example shows how to use one of the simplest query types: query_string. To see which other query types are available, please check Elasticsearch docs.