> ## Documentation Index
> Fetch the complete documentation index at: https://axiom.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# isstring

> This page explains how to use the isstring function in APL.

Use the `isstring` function to determine whether a value is of type string. This function is especially helpful when working with heterogeneous datasets where field types aren’t guaranteed, or when ingesting data from sources with loosely structured or mixed schemas.

You can use `isstring` to:

* Filter rows based on whether a field is a string.
* Validate and clean data before applying string functions.
* Avoid runtime errors in queries that expect specific data types.

## 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.

<AccordionGroup>
  <Accordion title="Splunk SPL users">
    In Splunk SPL, type checking is typically implicit and not exposed through a dedicated function like `isstring`. Instead, you often rely on function compatibility and casting behavior. In APL, `isstring` provides an explicit and reliable way to check if a value is a string before further processing.

    <CodeGroup>
      ```sql Splunk example theme={null}
      | eval type=if(isstr(field), "string", "not string")
      ```

      ```kusto APL equivalent theme={null}
      ['sample-http-logs']
      | extend type=iff(isstring(status), 'string', 'not string')
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="ANSI SQL users">
    ANSI SQL doesn’t include a built-in `IS STRING` function. Instead, type checks usually rely on schema constraints, manual casting, or vendor-specific solutions. In contrast, APL offers `isstring` as a first-class function that returns a boolean indicating whether a value is of type string.

    <CodeGroup>
      ```sql SQL example theme={null}
      SELECT
        CASE
          WHEN typeof(status) = 'VARCHAR' THEN 'string'
          ELSE 'not string'
        END AS type
      FROM logs
      ```

      ```kusto APL equivalent theme={null}
      ['sample-http-logs']
      | extend type=iff(isstring(status), 'string', 'not string')
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

## Usage

### Syntax

```kusto theme={null}
isstring(value)
```

### Parameters

| Name    | Type | Description                        |
| ------- | ---- | ---------------------------------- |
| `value` | any  | The value to test for string type. |

### Returns

A `bool` value that’s `true` if the input value is of type string, `false` otherwise.

## Use case example

Use `isstring` to filter rows where the HTTP status code is a valid string.

**Query**

```kusto theme={null}
['sample-http-logs']
| extend is_string = isstring(status)
| where is_string
```

[Run in Playground](https://play.axiom.co/axiom-play-qf1k/query?initForm=%7B%22apl%22%3A%22%5B'sample-http-logs'%5D%20%7C%20extend%20is_string%20%3D%20isstring\(status\)%20%7C%20where%20is_string%22%7D)

**Output**

| \_time               | status | is\_string |
| -------------------- | ------ | ---------- |
| 2025-06-05T12:10:00Z | "404"  | true       |

This query filters out logs where the `status` field is stored as a string, which can help filter out ingestion issues or schema inconsistencies.

## List of related functions

* [isimei](/apl/scalar-functions/type-functions/isimei): Checks whether a value is a valid International Mobile Equipment Identity (IMEI) number.
* [isreal](/apl/scalar-functions/type-functions/ismap): Checks whether a value is a real number.
* [iscc](/apl/scalar-functions/type-functions/iscc): Checks whether a value is a valid credit card (CC) number.
* [isutf8](/apl/scalar-functions/type-functions/isutf8): Checks whether a value is a valid UTF-8 encoded sequence.
