API Reference

Use this help section to learn how to operate the Nagios Log Server API, which can be used to access the Elasticsearch backend or to gather general information about the Log Server system.

Getting Started

To start using the Log Server API, you will first need your API key. If you have one, you can access it to the right of this text, or by clicking on your profile in the upper right corner of the screen. You will also see your access level. If you aren't an administrator, you will have read-only access to the API, meaning that you will not be able to add Alerts through that API endpoint. However, you will still have full access to the Backend API.

Currently, the API accepts arguments through HTTP GET/POST and returns a JSON object. You can do this through a browser, through cURL (as used in this guide), or via almost any other HTTP client. The root of the API is at:

This URL will always return HTTP code 404. For your first API call, try using this example, which will give you the state history of your alerts

Example API Call:
curl -XGET "/backend/nagioslogserver_history/_search?pretty=true&q=*:*&token=*api-key*" 

Backend API

The backend API is a pass-through layer to give you access to the elasticsearch index API, with some restrictions. Log Server API users are not able to access the 'nagioslogserver' or 'nagioslogserver_log' indices, since these contain sensitive data. However, you will have access to the logstash, kibana, and alert history indices. If you want to track queries made with this API, go to Admin->General->Global Settings, and set 'Log User Queries' to 'Yes'.

API Access / Key

Your unique API key used for external API access. You can read more about what you can do with the API in the API documents in the help section.

No API Access

User Videos