fieldtypes
Reports every field the input rows hold and the types its values take, returning a table with ColumnName, Types, ElementTypes and EveryRow columns.
ColumnName is the field's path, nested bag keys included. Types lists the types its values take: bool, number, datetime, timespan, string, bag and array (int, long and real are all number; a null counts as absent). ElementTypes lists the types of the elements of its arrays, one level deep. EveryRow is true when every input row holds the field.
A field with more than one type, such as ["number", "string"], is one a comparison against a single type only partly matches.
fieldtypes must be the first operator after the table, with only time
filters before it: where clauses on timestamp or ingest_time. A filter
on any other field is an error. Near the edges of the time range it may
answer for stored rows just outside it, so it can list fields and types that
only those rows hold. A field listed with one type, or with EveryRow true,
still holds for every row in the time range.
Syntax
fieldtypesList each field and the types its values take
Examples
Example 1 — List the fields and their types
datatable(log:dynamic)[
dynamic({"warrior":"Ragnar", "voyages":42, "ships":["Naglfar"]}),
dynamic({"warrior":"Bjorn", "voyages":"many"})
]
| fieldtypes| ColumnName (string) | Types (dynamic) | ElementTypes (dynamic) | EveryRow (bool) |
|---|---|---|---|
| log | ["bag"] | [] | true |
Related
fieldstats
Analyzes dynamic column values to discover field paths and their statistics, returning a table with AttributePath, Type, Cardinality, Frequency, Hint, and HintExhaustive columns.
otel-log-stats
Single-pass OTEL log exploration: discovers attributes and computes top values with severity breakdown (error/warn/info/debug counts).