Skip to main content
The reverse function reverses the order of characters in a string. Use this function to analyze strings from right to left, detect palindromes, or transform data for specific pattern matching requirements.

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, reversing strings typically requires custom functions or scripts. APL’s reverse provides this functionality natively.
In ANSI SQL, string reversal varies by database with different functions. APL’s reverse provides standardized string reversal.

Usage

Syntax

Parameters

Returns

Returns the input string with its characters in reverse order.

Use case examples

Detect palindromic patterns in URIs or identifiers for data validation.Query
Run in PlaygroundOutputThis query detects palindromic URIs by comparing them with their reversed versions, which can help identify unusual or test data patterns.
  • substring: Extracts parts of strings. Use this with reverse to extract from the end of strings.
  • strlen: Returns string length. Use this with reverse for position calculations from the right.
  • strcat: Concatenates strings. Use this to build strings with reversed components.
  • split: Splits strings into arrays. Use this with reverse to process tokens in reverse order.