Module: LogStash

Defined in:
lib/logstash/filters/math.rb,
lib/logstash/filters/math_functions.rb,
lib/logstash/filters/math_calculation_elements.rb

Overview

Do various simple math functions Configuration: filter {

math {
  calculate => [
      [ "+", "a_field1", "a_field2", "a_target" ],   # a + b => target
      [ "-", "b_field1", "b_field2", "b_target" ],   # a - b => target
      [ "/", "c_field1", "c_field2", "c_target" ],   # a / b => target
      [ "*", "d_field1", "d_field2", "d_target" ]    # a * b => target
  ]
}

} Multiple calculations can be executed with one call

Sequence of processing is as they are listed, so processing of just-generated fields is possible as long as it is done in the correct sequence.

Works with float and integer values

Defined Under Namespace

Modules: Filters