본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트9.5k · #12265

spl-to-apl

하는 일

이 스킬은 Splunk의 SPL 검색을 Axiom의 APL로 바꿉니다. Splunk에서 Axiom으로 옮기는 팀이나, 익숙한 SPL 패턴으로 APL을 배우려는 사람을 위한 것입니다.

사용하는 경우

  • ✓로그 검색을 Splunk에서 Axiom으로 옮기고 있을 때.
  • ✓Splunk 검색이 있고 그에 맞는 Axiom 쿼리가 필요할 때.
  • ✓자주 쓰는 Splunk 명령이 APL에서 어떻게 쓰이는지 알고 싶을 때.

스킬 링크

https://github.com/openclaw/clawhub/blob/main/.agents/skills/spl-to-apl/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/openclaw/clawhub/blob/main/.agents/skills/spl-to-apl/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 Splunk 검색을 Axiom 쿼리로 바꿔 주세요: index=web status>=500 | stats count by host.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 각 Splunk 명령을 대응하는 APL 명령에 연결합니다. 예를 들어 stats는 요약에, eval은 확장에 씁니다. Axiom에 필요한 시간 범위를 추가하고, 비교가 필요한 텍스트 필드는 숫자로 변환합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

SPL to APL Translator

Type safety: Fields like status are often stored as strings. Always cast before numeric comparison: toint(status) >= 500, not status >= 500.


Critical Differences

  1. Time is explicit in APL: SPL time pickers don't translate — add where _time between (ago(1h) .. now())
  2. Structure: SPL index=... | command → APL ['dataset'] | operator
  3. Join is preview: limited to 50k rows, inner/innerunique/leftouter only
  4. cidrmatch args reversed: SPL cidrmatch(cidr, ip) → APL ipv4_is_in_range(ip, cidr)

Core Command Mappings

SPL APL Notes
search index=... ['dataset'] Dataset replaces index
search field=value where field == "value" Explicit where
where where Same
stats summarize Different aggregation syntax
eval extend Create/modify fields
table / fields project Select columns
fields - project-away Remove columns
rename x as y project-rename y = x Rename
sort / sort - order by ... asc/desc Sort
head N take N Limit rows
top N field summarize count() by field | top N by count_ Two-step
dedup field summarize arg_max(_time, *) by field Keep latest
rex parse or extract() Regex extraction
join join Preview feature
append union Combine datasets
mvexpand mv-expand Expand arrays
timechart span=X summarize ... by bin(_time, X) Manual binning
rare N field summarize count() by field | order by count_ asc | take N Bottom N
spath parse_json() or json['path'] JSON access
transaction No direct equivalent Use summarize + make_list

Complete mappings: reference/command-mapping.md


Stats → Summarize

# SPL
| stats count by status

# APL  
| summarize count() by status

Key function mappings

SPL APL
count count()
count(field) countif(isnotnull(field))
dc(field) dcount(field)
avg/sum/min/max Same
median(field) percentile(field, 50)
perc95(field) percentile(field, 95)
first/last arg_min/arg_max(_time, field)
list(field) make_list(field)
values(field) make_set(field)

Conditional count pattern

# SPL
| stats count(eval(status>=500)) as errors by host

# APL
| summarize errors = countif(status >= 500) by host

Complete function list: reference/function-mapping.md


Eval → Extend

# SPL
| eval new_field = old_field * 2

# APL
| extend new_field = old_field * 2

Key function mappings

SPL APL Notes
if(c, t, f) iff(c, t, f) Double 'f'
case(c1,v1,...) case(c1,v1,...,default) Requires default
len(str) strlen(str)
lower/upper tolower/toupper
substr substring 0-indexed in APL
replace replace_string
tonumber toint/tolong/toreal Explicit types
match(s,r) s matches regex "r" Operator
split(s, d) split(s, d) Same
mvjoin(mv, d) strcat_array(arr, d) Join array
mvcount(mv) array_length(arr) Array length

Case statement pattern

# SPL
| eval level = case(
    status >= 500, "error",
    status >= 400, "warning",
    1==1, "ok"
  )

# APL  
| extend level = case(
    status >= 500, "error",
    status >= 400, "warning",
    "ok"
  )

Note: SPL's 1==1 catch-all becomes implicit default in APL.


Rex → Parse/Extract

# 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)

Simple pattern (non-regex)

# SPL
| rex field=uri "^/api/(?<version>v\d+)/(?<endpoint>\w+)"

# APL
| parse uri with "/api/" version "/" endpoint

Time Handling

SPL time pickers don't translate. Always add explicit time range:

# SPL (time picker: Last 24 hours)
index=logs

# APL
['logs'] | where _time between (ago(24h) .. now())

Timechart translation

# SPL
| timechart span=5m count by status

# APL
| summarize count() by bin(_time, 5m), status

Common Patterns

Error rate calculation

# SPL
| stats count(eval(status>=500)) as errors, count as total by host
| eval error_rate = errors/total*1
자주 묻는 질문

Splunk의 시간 선택기가 그대로 넘어오나요?

아니요. APL에서는 시간 범위를 쿼리 안에 직접 써야 하므로, 이 스킬이 그것을 추가합니다.

모든 Splunk 명령을 지원하나요?

이 스킬은 자주 쓰는 대응 관계를 정리하고 차이점을 알려 줍니다. 예를 들어 join은 APL에서 미리 보기 기능입니다.

일부 필드를 숫자로 바꾸는 이유는 무엇인가요?

상태 값 같은 필드는 보통 텍스트로 저장되어 있어서, 숫자 비교 전에 변환해야 하기 때문입니다.

상세 정보

작성자의 원본 설명

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.

repo: openclaw/clawhub

인기도

GitHub 스타
9.5k
순위
#12265
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬