Loading...
Loading...
Translates Splunk SPL queries to Axiom APL. Provides command mappings, function equivalents, and syntax transformations. Use when migrating from Splunk, converting SPL queries, or learning APL equivalents of SPL patterns.
npx skill4agent add axiomhq/skills spl-to-aplwhere _time between (ago(1h) .. now())index=... | command['dataset'] | operatorcidrmatch(cidr, ip)ipv4_is_in_range(ip, cidr)| SPL | APL | Notes |
|---|---|---|
| | Dataset replaces index |
| | Explicit where |
| | Same |
| | Different aggregation syntax |
| | Create/modify fields |
| | Select columns |
| | Remove columns |
| | Rename |
| | Sort |
| | Limit rows |
| | Two-step |
| | Keep latest |
| | Regex extraction |
| | Preview feature |
| | Combine datasets |
| | Expand arrays |
| | Manual binning |
| | Bottom N |
| | JSON access |
| No direct equivalent | Use summarize + make_list |
reference/command-mapping.md# SPL
| stats count by status
# APL
| summarize count() by status| SPL | APL |
|---|---|
| |
| |
| |
| Same |
| |
| |
| |
| |
| |
# SPL
| stats count(eval(status>=500)) as errors by host
# APL
| summarize errors = countif(status >= 500) by hostreference/function-mapping.md# SPL
| eval new_field = old_field * 2
# APL
| extend new_field = old_field * 2| SPL | APL | Notes |
|---|---|---|
| | Double 'f' |
| | Requires default |
| | |
| | |
| | 0-indexed in APL |
| | |
| | Explicit types |
| | Operator |
| | Same |
| | Join array |
| | Array length |
# SPL
| eval level = case(
status >= 500, "error",
status >= 400, "warning",
1==1, "ok"
)
# APL
| extend level = case(
status >= 500, "error",
status >= 400, "warning",
"ok"
)1==1# SPL
| rex field=message "user=(?<username>\w+)"
# APL - parse with regex
| parse kind=regex message with @"user=(?P<username>\w+)"
# APL - extract function
| extend username = extract("user=(\\w+)", 1, message)# SPL
| rex field=uri "^/api/(?<version>v\d+)/(?<endpoint>\w+)"
# APL
| parse uri with "/api/" version "/" endpoint# SPL (time picker: Last 24 hours)
index=logs
# APL
['logs'] | where _time between (ago(24h) .. now())# SPL
| timechart span=5m count by status
# APL
| summarize count() by bin(_time, 5m), status# SPL
| stats count(eval(status>=500)) as errors, count as total by host
| eval error_rate = errors/total*100
# APL
| summarize errors = countif(status >= 500), total = count() by host
| extend error_rate = toreal(errors) / total * 100# SPL
index=logs [search index=errors | fields user_id | format]
# APL
let error_users = ['errors'] | where _time between (ago(1h) .. now()) | distinct user_id;
['logs']
| where _time between (ago(1h) .. now())
| where user_id in (error_users)# SPL
| join user_id [search index=users | fields user_id, name]
# APL
| join kind=inner (['users'] | project user_id, name) on user_id# SPL
| transaction session_id maxspan=30m
# APL (no direct equivalent — reconstruct with summarize)
| summarize
start_time = min(_time),
end_time = max(_time),
events = make_list(pack("time", _time, "action", action)),
duration = max(_time) - min(_time)
by session_id
| where duration <= 30m| SPL | APL | Speed |
|---|---|---|
| | Fastest |
| | Moderate |
| | Fast |
| | Slowest |
hascontains_csreference/command-mapping.mdreference/function-mapping.mdreference/examples.md