## LOG

The `LOG` function in ES|QL returns the logarithm of a value to a base. The input can be any numeric value, and the return value is always a double. Logs of zero, negative numbers, and base of one return null as well as a warning.

### Syntax

`LOG(base, number)`

#### Parameters

- `base`: Base of logarithm. If null, the function returns null. If not provided, this function returns the natural logarithm (base e) of a value.
- `number`: Numeric expression. If null, the function returns null.

### Examples

Here are a couple of examples of full ES|QL queries using the `LOG` function:

```esql
ROW base = 2.0, value = 8.0
| EVAL s = LOG(base, value)
```

In this example, the `LOG` function is used to calculate the logarithm of `8.0` to the base `2.0`.

```esql
ROW value = 100
| EVAL s = LOG(value)
```

In this example, the `LOG` function is used to calculate the natural logarithm (base e) of `100` as no base is provided.