Hello!
Just wondered if anyone had wrestled with any weird log formats, we’re ingesting some from a COTS product that I’m told we can’t configure, and the logs just have a timestamp with no date details…has anyone worked with something similar?
I’ve set up some processing to stick some bits together and make a proper timestamp, so the times are looking ok in the Log viewer (the filename itself is yyyymmdd.ext) - the issue seems to be that for multi-line files, it’s splitting them up in a strange way. Some of the content is multi-line JSON, and that happens to have a “proper” timestamp in there, so I think Dynatrace is picking that up as the point to split it, and then storing everything for the next minute as one big chunk.
They come in from a “Custom Log Source” so I can add the filename as an attribute and use it in the processing step - not sure if that affects things in terms of the order of execution.
Vaguely anonymized example:
17:08:58 %I: [18|(null)]: Add kitchen video schedule payload:<br>{<br> "Retry": true,<br> "IsRunNow": true,<br> "ScheduledTime": 0,<br> "JobId": 0,<br> "Data": {<br> "MobNum": null,<br> "CheckNumber": 00000000,<br> "OrderNumber": 00000000,<br> "TerminalId": 00000000,<br> "CheckTypeId": 00,<br> "CheckTypeName": "XXX,<br> "TableName": "RS3071-XXXXXXX-001",<br> "CoverCount": 0,<br> "EmployeeId": 998,<br> "EmployeeName": "XXXX",<br> "OpenDateTime": "2024-08-06T17:08:58",<br> "ProfitCenterId": 78,<br> "ProfitCenterName": "XXXXXXX",<br> "IsTraining": false,<br> "IsNew": true,<br> "IsClosed": true,<br> "IsVoided": false,<br> "IsCheckVoided": false,<br> "IsItemVoid": false,<br> "IsSaveCheck": false,<br> "IsTenderCheck": false,<br> "SendType": 0,<br> "IsKioskRegRequest": false,<br> "Items": [<br> {<br> "UnitPrice": 15.00,<br> "CourseNum": 1,<br> "SeatNum": 1,<br> "CookTimeSeconds": 0,<br> "Details": [<br> {<br> "Id": 16,<br> "Index": 2,<br> "Type": 1,<br> "Text": "Some Thing",<br> "UnitPrice": 0.00,<br> "Quantity": 1,<br> "IsVoided": false<br> }<br> ],<br> "Id": 914875,<br> "Index": 1,<br> "Text": "Some Thing Else",<br> "Quantity": 1,<br> "KvDepartmentId": 10,<br> "KvDepartmentName": "Thing",<br> "KvItemCategoryId": 11,<br> "IsVoided": false,<br> "IsItemDetailModified": false,<br> "IncrementIndex": false,<br> "ItemChkNum": 0<br> }<br> ],<br> "Packages": [],<br> "RecalledCheckLastQSR": 0,<br> "PreviouslyAddedItemIndex": 0,<br> "HeldSrtIdx": 0,<br> "HeldEndIdx": 0,<br> "LastCourNum": 0,<br> "CheckTotal": 0,<br> "ServerName": null,<br> "CustomerInfo": null,<br> "DeliveryInfo": null<br> },<br>"IsOnTheFly": false<br>}<br>17:08:58 %I: [18|(null)]: Receive video job from Terminal [7999] @ [localhost]. Schedule: Run Now [True], Retry [True], OntheFly [False], Time [0], # Items [1]..<br>17:08:58 %I: [18|(null)]: Adding scheduled [VideoData] job ID [00000000000]. IsRunNow [True]<br>17:08:58 %I: [18|(null)]: Saving [VideoData] job queue to file [C:\InfoGenesis\Data\LocationVideo.jobs.json].
This results in 3 Log events (think thats the right name):
17:08:58 %I: [18|(null)]: Add kitchen video schedule payload:
{<br>"Retry": true,<br>"IsRunNow": true,<br>"ScheduledTime": 0,<br>"JobId": 0,<br>"Data": {<br>"MobNum": null,<br>"CheckNumber": 00000000,<br>"OrderNumber": 00000000,<br>"TerminalId": 00000000,<br>"CheckTypeId": 00,<br>"CheckTypeName": "XXX,<br>"TableName": "RS3071-XXXXXXX-001",<br>"CoverCount": 0,<br>"EmployeeId": 998,<br>"EmployeeName": "XXXX",
3.
"OpenDateTime": "2024-08-06T17:08:58",<br>"ProfitCenterId": 78,<br>"ProfitCenterName": "XXXXXXX",<br>"IsTraining": false,<br>"IsNew": true,<br>"IsClosed": true,<br>"IsVoided": false,<br>"IsCheckVoided": false,<br>"IsItemVoid": false,<br>"IsSaveCheck": false,<br>"IsTenderCheck": false,<br>"SendType": 0,<br>"IsKioskRegRequest": false,<br>"Items": [<br>{<br>"UnitPrice": 15.00,<br>"CourseNum": 1,<br>"SeatNum": 1,<br>"CookTimeSeconds": 0,<br>"Details": [<br>{<br>"Id": 16,<br>"Index": 2,<br>"Type": 1,<br>"Text": "Some Thing",<br>"UnitPrice": 0.00,<br>"Quantity": 1,<br>"IsVoided": false<br>}<br>],<br>"Id": 914875,<br>"Index": 1,<br>"Text": "Some Thing Else",<br>"Quantity": 1,<br>"KvDepartmentId": 10,<br>"KvDepartmentName": "Thing",<br>"KvItemCategoryId": 11,<br>"IsVoided": false,<br>"IsItemDetailModified": false,<br>"IncrementIndex": false,<br>"ItemChkNum": 0<br>}<br>],<br>"Packages": [],<br>"RecalledCheckLastQSR": 0,<br>"PreviouslyAddedItemIndex": 0,<br>"HeldSrtIdx": 0,<br>"HeldEndIdx": 0,<br>"LastCourNum": 0,<br>"CheckTotal": 0,<br>"ServerName": null,<br>"CustomerInfo": null,<br>"DeliveryInfo": null<br>},<br>"IsOnTheFly": false<br>}<br>17:08:58 %I: [18|(null)]: Receive video job from Terminal [7999] @ [localhost]. Schedule: Run Now [True], Retry [True], OntheFly [False], Time [0], # Items [1]..<br>17:08:58 %I: [18|(null)]: Adding scheduled [VideoData] job ID [00000000000]. IsRunNow [True]<br>17:08:58 %I: [18|(null)]: Saving [VideoData] job queue to file [C:\InfoGenesis\Data\LocationVideo.jobs.json].
Ideally everything from one “timestamp at the beginning of a line” to the next “timestamp at the beginning of a line” would be captured as a single log event, but I think the time-only format is throwing things off here.
Are there any hidden tricks that could be used here? I know dynatrace will assume the current year if you don’t include one in the timestamp, is there a way to make it assume the current day and month too?
I’m assuming the processing I’m doing is happening after it’s been split so I’m hoping there is another way to get at it 😊
Thanks for any tips - and no worries if you don’t have any, this kind of thing is not the most exciting thing in the world 😁
