This page explains how to use the countif aggregation function in APL.
countif
aggregation function in Axiom Processing Language (APL) counts the number of records that meet a specified condition. You can use this aggregation to filter records based on a specific condition and return a count of matching records. This is particularly useful for log analysis, security audits, and tracing events when you need to isolate and count specific data subsets.
Use countif
when you want to count occurrences of certain conditions, such as HTTP status codes, errors, or actions in telemetry traces.
Splunk SPL users
eval
function combined with stats
. APL provides a more streamlined approach with the countif
function, which performs conditional counting directly.ANSI SQL users
COUNT
function with a CASE
statement. In APL, countif
simplifies this process by offering a direct approach to conditional counting.true
are counted.count_errors |
---|
72 |
500
status, helping you identify how many server errors occurred.sumif
when you want to sum values based on a filter.