Rauly_Koto
(Rauly Koto)
September 15, 2021, 7:20pm
1
The execution_length_output count string correctly, but execution_length_input string is to low.
ruby {
code => "event.set('execution_length_output', event.get('[execution][output]').length)
event.set('execution_length_iput', event.get('[execution][input]').length)"
}
This should work.
Conf
input { generator { lines => ['{"execution.output":"five1", "execution.input": "sixsix"}'] count => 1 codec => "json" } }
filter {
ruby {
code => '
event.set("execution_length_output", event.get("execution.output").length)
event.set("execution_length_input", event.get("execution.input").length)
'
}
}
output { stdout { codec => "json" } }
Output
{
"execution.output": "five1",
"execution_length_input": 6,
"execution_length_output": 5,
"execution.input": "sixsix"
}
system
(system)
Closed
October 18, 2021, 1:19pm
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.