How to use dynamic string in outout

I want to use a dynamic string to replace the result as follow :

{
"DISMAN-EXPRESSION-MIB::sysUpTimeInstance" => "71 days, 04:40:14.91",
"@timestamp" => 2018-08-09T09:02:37.423Z,
"type" => "snmptrap",
"host" => "10.158.1.211",
"SNMPv2-MIB::snmpTrapOID.0" => "DELL-RAC-MIB::dell",
"message" => "#<SNMP::SNMPv2_Trap:0x3bad2c92 @request_id=1421128105, @error_index=0, @error_status=0, @source_ip="10.158.1.211", @varbind_list=[#<SNMP::VarBind:0x16675511 @name=[1.3.6.1.2.1.1.3.0], @value=#<SNMP::TimeTicks:0x1b1701ac @value=615121491>>, #<SNMP::VarBind:0x490c67e0 @name=[1.3.6.1.6.3.1.1.4.1.0], @value=[1.3.6.1.4.1.674]>, #<SNMP::VarBind:0x2bcca0aa @name=[1.3.6.1.4.1.674.10892.2.0.1005], @value="test">]>",
"DELL-RAC-MIB::alertDrscPowerOff" => "test",
"@version" => "1"
}

like %{all the field}, is these any string that can be used to replace it ?
Thank you very much.

The configure file is as below ,and I want to execute a command " java -jar /tmp/notify.jar %{ all the fields } " . how to use dynamic string to replace all the fields ?

input {
snmptrap {
type => "snmptrap"
community => "gdsTest01"
host => "0.0.0.0"
port => 7777
yamlmibdir => "/data/logstash-6.3.0/vendor/bundle/jruby/2.3.0/gems/snmp-1.2.0/data/ruby/snmp/mibs"
}
}

output {
exec {
command => "java -jar /tmp/notify.jar %{ all the fields }

"
}
stdout {
codec => rubydebug
}
}

help

Any one knows ,thanks very much

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.