Quick reference

SPL cheat sheet and SQL concept map

Quick reference

Concept map

Database conceptSPL conceptNote
SQL querySPL searchRetrieve events; pipe to filter, transform, group, aggregate
TableSearch resultsDynamic rows (events) and columns (fields)
Table nameindexIndex name
RowEventUsually one timestamped log record
ColumnFieldField set follows the statement and parse rules

From SQL to SPL

IntentSQL (sketch)SPL (sketch)
Full scanSELECT * FROM mytableindex="mytable"
FilterWHERE col=5index="t" col=5 or | where col=5
ProjectSELECT a, b| fields a, b or | table a, b
SortORDER BY a DESC| sort - a
LimitLIMIT 10| head 10 or | limit 10
Group countCOUNT(*) GROUP BY user| stats count() by user
Derived columnlower(u) AS lu| eval lu=lower(u)
RenameAS| rename old as new
DistinctDISTINCT| dedup field
Dimension joinJOIN| lookup dim.csv key OUTPUT name

Typical pipeline order

filter events
  → project / rename fields
  → eval
  → stats
  → lookup / iplocation
  → sort / head / table
index="firewall" action="deny"
| times earliest=-24h@h latest=now
| stats count() as hits by src_ip, dest_port
| sort - hits
| head 20
| lookup asset.csv ip as src_ip OUTPUT application_name

Search operators

OperatorMeaning
= / ==Equals
!= / <>Not equals
< / <= / > / >=Compare
like / not likePattern (% multi-char, _ single)
AND / ORAnd / or (AND binds tighter; use parentheses)

Wildcards: * zero or more characters, ? single character.

Command index

CommandPurpose
whereFilter inside the pipe
fields / tableKeep or present fields
renameRename
sortSort
evalDerive fields
statsAggregate
dedupDeduplicate
head / limitTruncate rows
top / rareFrequent / rare values
lookup / inputlookup / outputlookupLookup tables
join / append / appendcolsMerge results
iplocationIP geo enrichment
rex / parse / spathExtract fields
makemv / mvexpand / mvcombineMultivalue
fillnull / filldown / fillupNull handling
timesIn-statement time range

On this page