I would appreciate a sample of Java code that converts Perl hash into JSON.
Lots of Perl code can do this, but so far unable to find an equivalent Java code.
Sample hash:
{
'connection' => {
'activate_on_startup' => 'y',
'alert_snmp_trap' => 'N',
'file' => 'H:\\HLC_170_Local_01\\logs\\win_os_profile.log',
'data_source' => {
'params' => {
'name' => '
Processor\\% Processor Time\\_Total
,System\\Context Switches/sec\\-1
,Processor\\Interrupts/sec\\_Total
,Processor\\% Privileged Time\\_Total
,Processor\\% User Time\\_Total
,Processor\\Interrupts/sec\\_Total
,System\\Processor Queue Length\\-1
,System\\Context Switches/sec\\-1
,Memory\\Page Faults/sec\\-1
,Memory\\Pages/sec\\-1
,Memory\\Transition Faults/sec\\-1
,Memory\\Pages Input/sec\\-1
',
'hostname' => ''
},
'name' => 'perfmon'
},
'charting_concentrator_index' => 1,
'delta_flag' => '',
'connection_type' => {
'name' => 'capture'
},
'active_flag' => 'y',
'cycle' => 5,
'alert_capture_cycle' => 2
},
'name' => 'SYS_WIN_OS_PROFILE'
},