How can split the log data source separete by , in that result field i need to split multiple field

Hi Every one,

This is Sandeep ,

My data source is like this (1st row )

"1102417","2018-11-01 02:00:02","ERROR","QUERY-> update emp set statues='No-Show' where DATE_FORMAT(tpam_app_start_epoch,'%Y-%m-%d') < (CURDATE() - INTERVAL 2 DAY) AND tpam_status<>'Attended' AND tpam_app_id<>'' ERROR-> Table 'emp' doesn't exist","Sytem"

and another row is like this (2nd row)

"1112311","2018-11-03 18:45:25","ERROR","QUERY-> insert emp (log_datetime,log_type,log_component,log_message,log_user) values ('2018-11-03 18:45:25','4','CORE','New Appointment (Client Mobile -> 972* Doctor id -> 3451 Master Schedule id -> 1238) : Unable to send email to abc@gmail.com (Doctor) Reason: Email template is not enabled for abc's Clinic Institution','System') ERROR-> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Clinic Institution','System')' at line 1

and another row is like this (3rd row)

"1103849","2018-11-01 08:00:49","ERROR","CRON (Appointment reminder today - Client): Failed to send email to Reason->","System"

here data source is separate by ,(comma) not .csv file it is text file ,
i need to split each field separate by ,(comma) like

Log_id :"1102417"
date: "2018-11-01 02:00:02"
Log_type: "ERROR"
Log_message: "QUERY-> update emp set statues='No-Show' where DATE_FORMAT(tpam_app_start_epoch,'%Y-%m-%d') < (CURDATE() - INTERVAL 2 DAY) AND tpam_status<>'Attended' AND tpam_app_id<>'' ERROR-> Table 'emp' doesn't exist"
Log_user:"Sytem"

above results are separator by ,(comma) in those fields i need to split log_message field into QUERY field and Error field etc ,

this is my expected results (from 1st row)

Log_id :"1102417"
date: "2018-11-01 02:00:02"
Log_type: "ERROR"
Log_message: "QUERY-> update emp set statues='No-Show' where DATE_FORMAT(tpam_app_start_epoch,'%Y-%m-%d') < (CURDATE() - INTERVAL 2 DAY) AND tpam_status<>'Attended' AND tpam_app_id<>'' ERROR-> Table 'emp' doesn't exist"
Query:"QUERY-> update emp set statues='No-Show' where DATE_FORMAT(tpam_app_start_epoch,'%Y-%m-%d') < (CURDATE() - INTERVAL 2 DAY) AND tpam_status<>'Attended' AND tpam_app_id<>''
Error: Table 'emp' doesn't exist"
Log_user:"System"

this is my expected results (from 2st row) diff is added some data in log_message field like mobile no,id's etc

Log_id: "1112311"
date: "2018-11-03 18:45:25"
Log_type: "ERROR"
Log_message: "QUERY-> insert emp (log_datetime,log_type,log_component,log_message,log_user) values ('2018-11-03 18:45:25','4','CORE','New Appointment (Client Mobile -> 9741* Doctor id -> 345 Master Schedule id -> 1238) : Unable to send email to abc@gmail.com (Doctor) Reason: Email template is not enabled for abc's Clinic Institution','System') ERROR-> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Clinic Institution','System')' at line 1

Query: insert emp (log_datetime,log_type,log_component,log_message,log_user) values ('2018-11-03 18:45:25','4','CORE','New Appointment (Client Mobile -> 9741* Doctor id -> 345 Master Schedule id -> 1238) : Unable to send email to abc@gmail.com (Doctor) Reason: Email template is not enabled for abc's Clinic Institution','System')

Error: You have an error in your SQL syntax
Doctor id:3451
Master Schedule id : 1238
Client Mobile : 9712*
Log_user:"system"

Log_id:"1103849"
date:"2018-11-01 08:00:49"
Log_type:"ERROR"
Log_message: "CRON (Appointment reminder today - Client): Failed to send email to Reason->"
Query:"CRON (Appointment reminder today - Client):
Error: Failed to send email to Reason->"
Log_user:"System"

some times log_messaga is like this

Query-> select * from emp Error:Table doesn't exist (instead of Error ->)

Pleace help from this problem .

Thanks

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