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

# Log

# \$log

The `$log` operator returns the logarithm of the first value with the second value as the base.

## Input

* An array containing exactly two numeric values: the input value and the base

## Output

* The logarithm of the first value with the second value as the base

## Examples

### Natural Log (base e)

```json theme={null}
{
  "$log": [
    2.718281828,
    2.718281828
  ]
}
```

Result: `1` (approximately)

### Base 10 Log

```json theme={null}
{
  "$log": [
    100,
    10
  ]
}
```

Result: `2`

### Base 2 Log

```json theme={null}
{
  "$log": [
    8,
    2
  ]
}
```

Result: `3`

### Field Value

```json theme={null}
{
  "$log": [
    {
      "$input": "value"
    },
    {
      "$input": "base"
    }
  ]
}
```

Result: The logarithm of the value field with the base field as the base
