I have two types of log files
Standard Syslog format
The timestamp looks as below
5:2015 Dec 21 07:35:06:ABC:foo1:1559: common.c:946:Enabling filter
6:2015 Dec 21 07:35:08:ABC:bar1:1461: api.c:124:Trigger activated
6:2015 Dec 21 07:35:16:BMC:kernel:-:<6>drivers/usb1_1.c:598:Error processing request on endpoint 0
Custom Log format
The date time is given in first line of the file. following lines are "relative" to the first line. example as below:
Timestamp H:M:S 15:4:1 D:M:Y 16:1:2015
Firmware Version: 121020150140
[04:01]------------[ Logs ]------------
[04:03]Device Data: -> Supported Attributes -> 0x8033B
[04:01]Device Cleanup
[04:19]SendClearMsg ...
[04:23]Param:GetData failed
[04:51]Current Update Count:7
[05:01]MODECHK:Normal mode
a timestamp of 4:01 is 4 minutes, 1 second since 15:4:1 which should be translated as 15:08:2.
Any suggestions to achieve this ?
- translate relative times into absolute time
- Merge with syslog into one big file, sorted by time
5:,6:, do you want to keep them? Before the timestamp? Do you want to keep theTimestampandFirmware Versionline? Do you mind the final format for the timestamp? Is 2015-12-21 13:12:02 OK?