I have enabled slow-logs ,long_query_time flags in Cloud-SQL for mysql instances to track the queries more than a threshold. The log entries are emitted by this log from Cloud-SQL
The Logentries are displayed in the stack-driver console individually like this
For each query 5 rows are displayed individually. These queries are stored in a bigquery table through a sink created as the end-result.
Problem: I need to find individual queries and co-relate them with the duration for each query. The 3rd row in the picture above contains the Query_time which is duration for running the query and the 5th row contains the actual query. I need to find a relation between the 2 rows as they are stored in different rows in the big-query for each of the log entries.
Also different servers may be sending these messages so when they are stored in bigquery i need to plot the queries against the correct servers.
I find a field for the 3rd row insertid: 2#272076179787#5485349422653289102#slow#1619605945744699000#00000000000015b9-0-0@a1
for the 5th row: 2#272076179787#5485349422653289102#slow#1619605945744699000#00000000000016ee-0-0@a1
I find the insertid same till this part #slow for all the logs entries captured
2#272076179787#5485349422653289102#slow
What follows after this is the timestamp value 1619605945744699000
but the last part containing #00000000000015b9-0-0@a1 is different for all the log entries. Can anyone please tell me what is the insertid column and how it is separated by #? Also how can i make a relation between the 3rd Row which contains the query_time and the 5th_row which contains the query string?
Note: If i try to match with time-stamp on the entries if timestamp matches for more than 1 query then it will not be correct.
Thanks a lot for your help and suggestions.
Regards
Bharath