Skip to main content

Fields & Sources API

Automatic field discovery with types, coverage stats, and top values. These endpoints power the Fields sidebar, autocomplete, and Quick Stats in the Web UI.

GET /fields

List all discovered fields with types, coverage statistics, and top values.

Query Parameters

ParameterRequiredDefaultDescription
fromNo--Restrict stats to time range start
toNo--Restrict stats to time range end
prefixNo--Filter fields by name prefix (for autocomplete)
sourceNo--Only fields seen from a specific source

List All Fields

curl -s localhost:3100/api/v1/fields | jq .

Response (200):

{
"data": {
"fields": [
{
"name": "_timestamp",
"type": "datetime",
"count": 847000000,
"coverage": 1.0
},
{
"name": "level",
"type": "string",
"count": 847000000,
"coverage": 1.0,
"top_values": [
{"value": "info", "count": 612000000},
{"value": "error", "count": 142000000},
{"value": "warn", "count": 93000000}
]
},
{
"name": "status",
"type": "integer",
"count": 423000000,
"coverage": 0.50,
"min": 200,
"max": 504,
"top_values": [
{"value": 200, "count": 380000000},
{"value": 404, "count": 21000000}
]
},
{
"name": "duration_ms",
"type": "float",
"count": 423000000,
"coverage": 0.50,
"min": 0.1,
"max": 30001.0,
"avg": 145.3,
"p50": 42.0,
"p99": 3200.0
}
]
}
}

Field Object Properties

FieldTypeDescription
namestringField name
typestringDetected type: string, integer, float, boolean, datetime
countintegerTotal events containing this field
coveragenumberFraction of all events containing this field (0.0--1.0)
minnumberMinimum value (numeric/datetime fields only)
maxnumberMaximum value (numeric/datetime fields only)
avgnumberAverage value (numeric fields only)
p50number50th percentile (numeric fields only)
p99number99th percentile (numeric fields only)
top_valuesarrayMost common values with counts (string/integer fields)

Filter by Prefix (Autocomplete)

curl -s "localhost:3100/api/v1/fields?prefix=sta" | jq .

Returns only fields whose names start with sta (e.g., status, state, start_time).

Filter by Source

curl -s "localhost:3100/api/v1/fields?source=nginx" | jq .

Returns only fields seen in events tagged with source=nginx.

Scoped to Time Range

curl -s "localhost:3100/api/v1/fields?from=-1h&to=now" | jq .

GET /fields/{name}/values

Top values for a specific field. Powers the "Quick Stats" sidebar and value autocomplete in the search bar.

Path Parameters

ParameterRequiredDescription
nameYesField name

Query Parameters

ParameterRequiredDefaultDescription
fromNo--Restrict to time range start
toNo--Restrict to time range end
limitNo10Number of top values to return (max 100)

Example

curl -s "localhost:3100/api/v1/fields/status/values?from=-1h&limit=10" | jq .

Response (200):

{
"data": {
"field": "status",
"type": "integer",
"values": [
{"value": 200, "count": 89421, "percent": 72.3},
{"value": 404, "count": 18234, "percent": 14.7},
{"value": 500, "count": 9123, "percent": 7.4},
{"value": 502, "count": 4521, "percent": 3.7},
{"value": 504, "count": 2401, "percent": 1.9}
],
"unique_count": 14,
"total_count": 123700
},
"meta": {
"from": "2026-02-14T13:52:00Z",
"to": "2026-02-14T14:52:00Z"
}
}

Value Object Properties

FieldTypeDescription
valueanyThe field value
countintegerNumber of events with this value
percentnumberPercentage of total events for this field

Response Metadata

FieldTypeDescription
data.fieldstringField name
data.typestringDetected field type
data.unique_countintegerTotal number of distinct values
data.total_countintegerTotal events containing this field
meta.fromstringEffective time range start (ISO 8601)
meta.tostringEffective time range end (ISO 8601)

GET /sources

List all log sources with volume statistics.

curl -s localhost:3100/api/v1/sources | jq .

Response (200):

{
"data": {
"sources": [
{
"name": "nginx",
"event_count": 423000000,
"last_event": "2026-02-14T14:52:01Z",
"first_event": "2026-01-15T00:00:01Z",
"rate": 1200.5,
"storage_bytes": 5200000000
},
{
"name": "api-gateway",
"event_count": 312000000,
"last_event": "2026-02-14T14:52:00Z",
"first_event": "2026-01-15T00:00:02Z",
"rate": 890.2,
"storage_bytes": 4100000000
}
]
}
}

Source Object Properties

FieldTypeDescription
namestringSource name (set via X-Source header or source field)
event_countintegerTotal events from this source
last_eventstringTimestamp of most recent event (ISO 8601)
first_eventstringTimestamp of earliest event (ISO 8601)
ratenumberCurrent ingest rate (events per second)
storage_bytesintegerStorage used by this source