format_apl function in APL to convert a parsed APL query structure (stored as a dynamic object) back into its string representation. This is the inverse operation of parse_apl, allowing you to reconstruct APL query text from its parsed form.
You use format_apl when you need to programmatically build or modify APL queries, inspect query structure, or transform parsed query representations back into executable query strings. This is particularly useful for query generation, query templating systems, and programmatic query manipulation in automation workflows.
Usage
Syntax
Parameters
| Name | Type | Description |
|---|---|---|
apl_dict | dynamic | A dynamic object representing the parsed structure of an APL query, typically generated by the parse_apl function. |
Returns
A string containing the APL query reconstructed from the parsed structure. The returned query string is syntactically valid and can be executed.Use case examples
- Log analysis
- OpenTelemetry traces
- Security logs
Use Output
This query demonstrates how to parse and reformat APL queries, useful for query templating and generation systems.
format_apl to generate dynamic queries based on stored query templates for log analysis automation.Query| query_text |
|---|
| [‘sample-http-logs’] | summarize count() by status |
List of related functions
- parse_apl: Use
parse_aplto convert APL query strings into structured dynamic objects. Useformat_aplto convert those objects back into query strings. - format_sql: Use
format_sqlto format SQL queries from parsed structures. Useformat_aplfor APL query formatting. - parse_json: Use
parse_jsonto parse JSON strings. Useparse_aplandformat_aplspecifically for APL query structures. - dynamic_to_json: Use
dynamic_to_jsonto convert dynamic objects to JSON strings. Useformat_aplto convert parsed query structures back to APL syntax.