API Authentication

All but a few of Falcon LogScale's API endpoints require authentication. Clients have to provide a token along with each request in the form of a Bearer Token.

To provide your API token in an HTTP header, use the following:

http
Authorization: Bearer $API_TOKEN

There are several token types available, including: ingest tokens, API tokens, personal tokens, and system tokens. Ingest tokens are recommended if you are using the Ingest API. For most other APIs use API tokens. The Packages API requires the use of a Personal API token. System tokens are not recommended for typical use cases as they provide access beyond that required for REST API use.

More Information on Tokens

For more information on tokens see:

  • For more information about creating and using API tokens, see API Tokens.

  • For more information about creating and using Ingest tokens, see Ingest Tokens.

  • For more information about creating and using Ingest tokens, see Personal API Token.

Testing Your Token

You can quickly test the validity of your token with the following Curl command:

shell
curl -u user:<TOKEN> <YOUR_CLUSTER>/api/v1/health-json | jq

Note

Change <TOKEN> for your authentication token, and <YOUR_CLUSTER> for the URL of your LogScale cluster.

The command will return health status such as the following:

json
{
  "downs": [],
  "oks": [
    {
      "fields": {
        "skew": "0 ms"
      },
      "name": "cluster-time-skew",
      "status": "OK",
      "statusMessage": ""
    },
    {
      "fields": {},
      "name": "cluster-versions",
      "status": "OK",
      "statusMessage": ""
    },
    {
      "fields": {
        "size": "1028",
        "min": "0.008s",
        "p95": "8.662s",
        "max": "17.693s",
        "p99": "10.213s",
        "p50": "0.22s"
      },
      "name": "event-latency-p99",
      "status": "OK",
      "statusMessage": ""
    },
    {
      "fields": {
        "m1_rate": "0.00"
      },
      "name": "failing-http-status-checks",
      "status": "OK",
      "statusMessage": ""
    },
    {
      "fields": {
        "p50": "10ms"
      },
      "name": "global-topic-latency-median",
      "status": "OK",
      "statusMessage": ""
    },
    {
      "fields": {
        "count": "0"
      },
      "name": "missing-nodes-via-kafka",
      "status": "OK",
      "statusMessage": ""
    },
    {
      "fields": {
        "used": "56.42%",
        "total": "53660876800b",
        "free": "23382585344b",
        "path": "/data/humio-data"
      },
      "name": "primary-disk-usage",
      "status": "OK",
      "statusMessage": ""
    }
  ],
  "status": "OK",
  "statusMessage": "everything is working",
  "uptime": "3h46m38s (13598s)",
  "version": "1.244.0--build-5824--sha-cf849e4fbea5f40de15033d8811224f66b1e3f38",
  "warnings": []
}