ansible.builtin.log filter – log of (math operation)
Note
This filter plugin is part of ansible-core
and included in all Ansible
installations. In most cases, you can use the short
plugin name
log
.
However, we recommend you use the Fully Qualified Collection Name (FQCN) ansible.builtin.log
for easy linking to the
plugin documentation and to avoid conflicting with other collections that may have
the same filter plugin name.
Synopsis
Math operation that returns the logarithm to base N of the input number.
By default, computes the natural logarithm.
Input
This describes the input of the filter, the value before | ansible.builtin.log
.
Parameter |
Comments |
---|---|
Number to operate on. |
Positional parameters
This describes positional parameters of the filter. These are the values positional1
, positional2
and so on in the following
example: input | ansible.builtin.log(positional1, positional2, ...)
Parameter |
Comments |
---|---|
Which base to use. Defaults to Euler’s number. Default: |
Notes
Note
This is a passthrough to Python’s
math.log
.
Examples
# 1.2920296742201791
eightlogfive: "{{ 8 | log(5) }}"
# 0.9030899869919435
eightlog10: "{{ 8 | log() }}"
Return Value
Key |
Description |
---|---|
Resulting number. Returned: success |
Hint
Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.