convert system time to utc and utc to system fails

26 Views Asked by At

I want to change time to system and utc of given log

{"host":"sp-1","level":"INFO","log":{"classname":"common.server.hacluster.CSFHATopologyChangeHandlerMBean:93","message":"Finished processing CSF HA 'become standby' message.","stacktrace":"","threadname":"RMI TCP Connection(1784)-192.168.20.11"},"process":"becomeStandby","service":"SP","time":"2020-03-19T10:15:36.514Z","timezone":"America/Toronto","type":"log","system":"SP_IG_20_3_R1_I2002","systemid":"SP_IG_20_3_R1_I2002"}

<filter com.logging.tmplog>
  @type record_modifier
  <record>
  type log
  time ${record["time"]}.to_time.utc
  arun ${tag}
  </record>
</filter>

But it didn't workout

{"host":"sp-1","level":"INFO","log":{"classname":"com.alcatel.tpapps.common.server.hacluster.CSFHATopologyChangeHandlerMBean:93","message":"Finished processing CSF HA 'become standby' message.","stacktrace":"","threadname":"RMI TCP Connection(1784)-192.168.20.11"},"process":"becomeStandby","service":"SP","time":"2020-03-19T10:15:36.514Z.to_time.utc","timezone":"America/Toronto","type":"log","system":"SP_IG_20_3_R1_I2002","systemid":"SP_IG_20_3_R1_I2002","arun":"com.logging.tmplog"}

Also, i want to convert time to System time? What can be correct?

0

There are 0 best solutions below