apache/skywalking · error · IllegalArgumentException

Unknown log field: log.{name}. Supported metadata fields: {m

Error message

Unknown log field: log.{name}. Supported metadata fields: {metadataGetters}, traceContext.{traceGetters}, LogData fields: {logGetters}

What it means

Same family as the unknown-first-field error, but thrown for a field at a deeper position in a log.* chain: the codegen allows a metadata getter only at i==0, a LogData getter only at i==0, and a trace-context getter (traceId, traceSegmentId, spanId) only at i==1 directly after .getTraceContext(). Anything else — including metadata fields nested at depth > 0 — hits this throw. The message lists all three supported key sets.

Source

Thrown at oap-server/analyzer/log-analyzer/src/main/java/org/apache/skywalking/oap/log/analyzer/v2/compiler/LALValueCodegen.java:965

                            + LALCodegenHelper.METADATA_GETTERS.get(name) + "()";
                        if (LALCodegenHelper.LONG_FIELDS.contains(name)) {
                            needsBoxing = true;
                            boxType = "Long";
                        }
                    }
                } else if (i == 0 && LALCodegenHelper.LOG_GETTERS.containsKey(name)) {
                    current = current + "."
                        + LALCodegenHelper.LOG_GETTERS.get(name) + "()";
                } else if (i == 1 && current.endsWith(".getTraceContext()")
                        && LALCodegenHelper.METADATA_TRACE_GETTERS.containsKey(name)) {
                    current = current + "."
                        + LALCodegenHelper.METADATA_TRACE_GETTERS.get(name) + "()";
                    if (LALCodegenHelper.INT_FIELDS.contains(name)) {
                        needsBoxing = true;
                        boxType = "Integer";
                    }
                } else {
                    throw new IllegalArgumentException(
                        "Unknown log field: log." + name
                            + ". Supported metadata fields: "
                            + LALCodegenHelper.METADATA_GETTERS.keySet()
                            + ", traceContext."
                            + LALCodegenHelper.METADATA_TRACE_GETTERS.keySet()
                            + ", LogData fields: "
                            + LALCodegenHelper.LOG_GETTERS.keySet());
                }
            } else if (seg instanceof LALScriptModel.MethodSegment) {
                current = appendMethodSegment(current,
                    (LALScriptModel.MethodSegment) seg, null);
            }
        }

        if (needsBoxing) {
            sb.append(boxType).append(".valueOf(").append(current).append(")");
        } else {
            sb.append(current);

View on GitHub (pinned to 102af09b4a)

Solutions

  1. Keep chains to the shapes the compiler supports: log.<metadataField>, log.<logDataField>, log.traceContext.<traceField>
  2. To read a tag, use tag("KEY") instead of log.tags[...]
  3. To inspect the body, add a json{}/yaml{}/text{} parser and use parsed.*

Example fix

# before
extractor {
  traceId log.body.traceId as String
}

# after
filter {
  json { }
  extractor {
    traceId parsed.traceId as String
  }
}
Defensive patterns

Strategy: validation

Validate before calling

# Legal chain shapes:
#   log.<metadataField>
#   log.<logDataField>
#   log.traceContext.<traceId|traceSegmentId|spanId>
# grep -oE 'log\.[A-Za-z.]+' my-rule.yaml | sort -u   # review each against the shapes

Prevention

When it happens

Trigger: log.traceContext.spanId written as a deeper chain than allowed (e.g. log.ctx.traceId); log.body.nested.field (body is a String/byte tail, not navigable); log.service.extra; putting a LogData field at position 1 like log.traceContext.body.

Common situations: Trying to navigate into log.body as if it were a parsed object; assuming arbitrary depth navigation on metadata objects; chaining after log.tags expecting map-style access (use tag("KEY") instead).

Related errors


AI-assisted analysis of apache/skywalking@102af09b4a (2026-08-14). Data as JSON: /api/errors/969bf7027ea3c726. Report an issue: GitHub.