docs/en/guides/lal-extension.md
LAL (Log Analysis Language) supports custom input and output types for extending log processing
beyond the built-in Log type. This enables receiver plugins and custom modules to define
domain-specific log entities (e.g., slow SQL records, sampled traces, network profiling logs).
LAL provides two extension mechanisms:
outputType per rule — set in YAML config to transform logs into custom entitiesLALSourceTypeProvider SPI — register default input/output types for a receiver pluginBoth are documented in detail in the LAL user guide, including:
SlowSQL, SampledTrace)LALOutputBuilder interface)rules:
- name: slow_sql
outputType: SlowSQL
dsl: |
filter { ... }
extractor {
statement log.body
}
sink { }
public class MyLayerSourceTypeProvider implements LALSourceTypeProvider {
@Override
public String layer() { return "MY_LAYER"; }
@Override
public Class<?> inputType() { return MyProtoMessage.class; }
@Override
public Class<? extends Source> outputType() { return MyCustomBuilder.class; }
}
Register in META-INF/services/org.apache.skywalking.oap.log.analyzer.v2.spi.LALSourceTypeProvider.
For complete examples and implementation details, see the Output Type section in the LAL documentation.