I am trying to add new filed in grok filter which supposed to an arithmetic expression of the fields that are extracted by grok match command.
Unfortunately was not able to figure out the correct syntax for that... Anybody?
I found somewhere that {(8*6)}
supposed to return 48, but what about variables instead of constants?
====
`if [type] == "f5" {
grok {
match => [ message, "...%{WORD:was_status}...%{NUMBER:hour}hr:%{NUMBER:min}min:%{NUMBER:sec}sec" ]
add_field => [ "duration_%{was_status}", "\{((%{hour} * 3600) + (%{min} * 60) + %{sec})}" ]
}
}`
====
got the result, but EVAL
obviously not working correctly:
message: .... [ was down for 0hr:0min:4sec ]
duration_down \`{((0 * 3600) + (0 * 60) + 4)}`
Thanks a lot, Yuri