List source fields

List the fields a source's data can be queried by. The list has the fields seen in the source's logs, spans, exceptions or web events in the last 6 hours. Returns every field in one page. A source that received no data in the last 6 hours returns an empty list.

GET https://telemetry.betterstack.com/api/v4/sources/{source_id}/fields

URL parameters

source_id
required string

Query parameters

source_type
DEFAULT logs string
team_id
string

Headers

Authorization
required string
200

Response body

{
  "data": [
    {
      "id": "nginx.status",
      "type": "source_field",
      "attributes": {
        "path": "nginx.status",
        "path_parts": [
          "'nginx'",
          "'status'"
        ],
        "type": "Int64"
      }
    }
  ]
}
401

Response body

{
  "errors": "Invalid Team API token. How to find your Team API token: https://betterstack.com/docs/logs/api/getting-started/#obtaining-a-logtail-api-token"
}
403
404

Response body

{
  "errors": "Resource with the provided ID was not found"
}
422

Response body

{
  "errors": "Sorry, some values are incorrect",
  "invalid_values": {
    "source_type": "This source has no spans data."
  }
}

Response attributes

id
string
type
string
path
string
path_parts
array of strings
attributes.type
string

Example cURL

Span fields List source fields
curl --request GET \
  --url "https://telemetry.betterstack.com/api/v4/sources/123456/fields?source_type=spans" \
  --header "Authorization: Bearer $TOKEN"
curl --request GET \
  --url https://telemetry.betterstack.com/api/v4/sources/123456/fields \
  --header "Authorization: Bearer $TOKEN"