Type to search.

ES|QL mathematical functions

Serverless

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Serverless interfaces and procedures might differ from classic Elastic Stack deployments.

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

ES|QL supports these mathematical functions:

  • ABS

    Returns the absolute value of a number.

  • ACOS

    Returns the arccosine of a number.

  • ACOSH

    Returns the inverse hyperbolic cosine of a number.

  • ASIN

    Returns the arcsine of a number.

  • ASINH

    Returns the inverse hyperbolic sine of a number.

  • ATAN

    Returns the arctangent of a number.

  • ATAN2

    Returns the two-argument arctangent of y and x coordinates.

  • ATANH

    Returns the inverse hyperbolic tangent of a number.

  • CBRT

    Returns the cube root of a number.

  • CEIL

    Rounds a number up to the nearest integer.

  • COPY_SIGN The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 9.1 This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

    Combines the magnitude of one number with the sign of another.

  • COS

    Returns the cosine of an angle.

  • COSH

    Returns the hyperbolic cosine of a number.

  • E

    Returns the mathematical constant e.

  • EXP

    Returns the value of e raised to the power of the given number.

  • FLOOR

    Rounds a number down to the nearest integer.

  • HYPOT

    Returns the hypotenuse of two numbers.

  • LOG

    Returns the logarithm of a value to a base.

  • LOG10

    Returns the base-10 logarithm of a number.

  • PI

    Returns the mathematical constant pi.

  • POW

    Returns a value raised to the power of an exponent.

  • ROUND

    Rounds a number to the specified number of decimal places.

  • ROUND_TO The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Preview since 9.1 This functionality is in technical preview and is ready for evaluation. Use with caution in production; it is not recommended for mission-critical workloads. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Specific Support terms apply. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes. Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability Preview This functionality is in technical preview and is ready for evaluation. Use with caution in production; it is not recommended for mission-critical workloads. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Specific Support terms apply. Serverless interfaces and procedures might differ from classic Elastic Stack deployments.

    Rounds down to one of a list of fixed points.

  • SCALB The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 9.1 This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

    Returns the result of multiplying a number by 2 raised to a scale factor.

  • SIGNUM

    Returns the sign of the given number.

  • SIN

    Returns the sine of an angle.

  • SINH

    Returns the hyperbolic sine of a number.

  • SQRT

    Returns the square root of a number.

  • TAN

    Returns the tangent of an angle.

  • TANH

    Returns the hyperbolic tangent of a number.

  • TAU

    Returns the mathematical constant tau.