tolower

This page explains how to use the tolower function in APL.

The tolower function converts all characters in a string to lowercase. Use this function to normalize text for case-insensitive comparisons, standardize log data, or prepare strings for consistent analysis.

Usage

Syntax

tolower(value)

Parameters

NameTypeRequiredDescription
valuestringYesThe input string to convert to lowercase.

Returns

Returns the input string with all characters converted to lowercase.

Use case examples

Normalize HTTP methods for case-insensitive aggregation and analysis.

Query

['sample-http-logs']
| extend normalized_method = tolower(method)
| summarize request_count = count() by normalized_method, status
| sort by request_count desc
| limit 10

Run in Playground

Output

normalized_methodstatusrequest_count
get2005432
post2012341
get4041987

This query normalizes HTTP methods to lowercase, ensuring that 'GET', 'Get', and 'get' are all counted together for accurate request analysis.

Standardize service names for consistent cross-service analysis.

Query

['otel-demo-traces']
| extend normalized_service = tolower(['service.name'])
| summarize span_count = count(), avg_duration = avg(duration) by normalized_service
| sort by span_count desc
| limit 10

Run in Playground

Output

normalized_servicespan_countavg_duration
frontend4532125ms
checkout3421234ms
cart298789ms

This query normalizes service names to lowercase, ensuring consistent grouping regardless of naming convention variations.

  • toupper: Converts strings to uppercase. Use this for the opposite transformation.
  • totitle: Converts strings to title case. Use this for capitalized word formatting.
  • strcmp: Compares strings. Use tolower before strcmp for case-insensitive comparisons.
  • replace_string: Replaces strings. Use tolower to normalize before replacements.

Other query languages