Skip to main content
The in~ operator in APL filters records based on whether a value matches any element in a specified set using case-insensitive comparison. Use this operator to check if a field value equals one of several values regardless of letter case, which is more concise and efficient than chaining multiple equality checks with or. The in~ operator works with any scalar type, including strings, numbers, booleans, datetime values, and dynamic arrays. Use the in~ operator when you need case-insensitive matching against multiple values, such as when filtering logs where the case of values might vary (for example, HTTP methods that could be ‘GET’, ‘get’, or ‘Get’).

For users of other query languages

If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.
In Splunk SPL, string comparisons are case-insensitive by default. APL requires the explicit in~ operator for case-insensitive matching. Use in~ when you want to match values regardless of case.
In ANSI SQL, the IN operator’s case sensitivity depends on the database collation. APL’s in~ operator explicitly performs case-insensitive matching, similar to SQL databases with case-insensitive collation.

Usage

Syntax

Parameters

Returns

Returns true if the expression value matches any value in the specified set (case-insensitive). Returns false otherwise.

Use case examples

Filter HTTP logs by method regardless of case.Query
Run in PlaygroundOutputThis query filters the HTTP logs to return requests with GET or POST methods, regardless of how the method is capitalized in the data.

Performance considerations

When two operators perform the same task, use the case-sensitive one (in) for better performance. Use in~ only when case-insensitive matching is necessary.

Use with dynamic arrays

When you pass a dynamic array with nested arrays, APL flattens them into a single list. For instance, x in~ (dynamic(['a', ['b', 'c']])) is equivalent to x in~ ('a', 'b', 'c').
  • in: Use for case-sensitive matching to include values. Better performance than in~.
  • !in: Use for case-sensitive exclusion. Returns true if the value is not in the set.
  • !in~: Use for case-insensitive exclusion. Excludes values regardless of case.
  • where: Use to filter rows based on conditions. The in~ operator is commonly used within where clauses.
  • =~: Use for single value case-insensitive equality checks. Use in~ when checking against multiple values.