OpenObserve Docs
ReferenceApiStreams

Get schema for stream

Updated View MarkdownOpen in ChatGPTOpen in Claude

Endpoint: GET /api/{organization}/streams/{stream}/schema?type={StreamType}

Request

  • type: logs / metrics / traces / enrichment_tables / metadata

    default is logs.

  • keyword: only return fields whose name contains this text (optional).

  • offset, limit: paginate the field list (optional; limit=0, the default, returns all fields).

Response

{
    "name": "k8s",
    "storage_type": "s3",
    "stream_type": "logs",
    "stats": {
        "doc_time_min": 1673715046856933,
        "doc_time_max": 1673849134852901,
        "doc_num": 3300000,
        "file_num": 16,
        "storage_size": 3323.5,
        "compressed_size": 11.42
    },
    "schema": [
        {
            "name": "_timestamp",
            "type": "Int64"
        },
        {
            "name": "kubernetes.annotations.kubernetes.io/psp",
            "type": "Utf8"
        },
    ],
    "settings": {
        "partition_keys": {},
        "full_text_search_keys": ["log"]
    }
}

Description

Field nameData typeDefault valueDescription
namestring-stream name
storage_typestring-s3 / disk
stream_typestringlogslogs / metrics / traces / enrichment_tables / metadata
statsobject-stats for the stream
stats.doc_time_minint640the minimum timestamp of the record in the stream
stats.doc_time_maxint640the maximum timestamp of the record in the stream
stats.doc_numint640the records num of the stream
stats.file_numint640the files num in storage of the stream
stats.storage_sizefloat640ingestion data size of the original data
stats.compressed_sizefloat640stored size in storage after compression
schemaarray-the fields of the stream
schema.namestring-field name
schema.typestring-field data type: Utf8 / Int64 / Float64 / Timestamp / Boolean
settingsobject-settings of the stream (see Settings for all fields)
settings.partition_keysobject-custom partition keys, keyed L0, L1, … Each value has field, types ("value", "prefix" or {"hash": <buckets>}) and disabled. OpenObserve always partitions by time first
settings.full_text_search_keysarray[string]-full text search fields set on the stream. When empty, match_all searches the default fields (ZO_FEATURE_FULLTEXT_EXTRA_FIELDS adds more).
Was this page helpful?

On this page