# CCP Log Parser ## How this tool works? Agents use the Amazon Connect Contact Control Panel (CCP) to interact with customer contacts. It's how they receive calls, chat with contacts, transfer them to other agents, put them on hold, and perform other key tasks. The CCP logs [here](https://docs.aws.amazon.com/connect/latest/adminguide/troubleshooting.html#tools-and-info) is the recommended way to troulbeshoot CCP related issues. This tool parses raw CCP logs into user-friendly readable format. You can easily find entries that you are interested in by filtering and it also tells you tips/hints regarding to errors recorded in the log. ## Basic Usage Open the web site and drag & drop your CCP log file (e.g. agent-log.txt) onto it. ![DragAndDrop](docs/DragAndDrop.gif) ## Components The log viewer consists of **Metrics**, **Snapshots** and **Log** components. ### 1. Metrics Metrics visualizes the **skew **recorded in each snapshot, and** API Latency** measured between API request and responses. Other than that, it also displays the agent states as** reference areas. ** These graphs can be turned on/off by click the button on top of the Metrics area. Below is an example for a Metrics area containing all 3 graphs. ![Metrics1.png](docs/Metrics1.png) * **Skew** is the difference between the client-side (agent's workstation) local timestamp and server-side (Amazon Connect service) timestamp in milliseconds. ![Metrics2.png](docs/Metrics2.png) If the skew is positively or negatively too large, it can cause problems in agent's state transitions (*1). Metrics components highlights the graph in red if the values are too large. It can be also seen in the tooltip with ⚠ sign, warns you the skew is too big for this session. ![Metrics3.png](docs/Metrics3.png) * **Latency graph **shows the time difference between specific API calls and WebSocket heartbeat latencies. It can be a good proof in user's network latency. ``` Due to the limited information exposed in CCP v1 Logs, latency graph will **only show (% style="color:#e74c3c" %)failed (%%)API requests and it's latency for CCP V1 logs. **CCP V2 logs contains all the API requests' latencies as well as WebSocket heartbeat latencies. ``` Graph below shows the api of ##createOutboundContact ##succeeded after 2064 ms. ![Metrics4.png](docs/Metrics4.png) For failed API calls, the tooltip would show the status as Failed. Graph below shows the api of ##createOutboundContact ##failed after 956 ms. ![Metrics5.png](docs/Metrics5.png) * Reference Area can be used in conjunction with skew/latency graph to grasp how the state transitioned. Hover your mouse at the legend below would highlight the state on the graph. ![Metrics6.png](docs/Metrics6.png) ### 2. Snapshots The CCP periodically retrieves an AgentSnapshot from Amazon Connect (*2). An AgentSnapshot contains information such as state, contacts, skew, etc. This component extracts all the snapshots recorded with "GET_AGENT_SNAPSHOT succeeded" message and lists the name of agent's state (i.e. `(% class="inline-code" %)snapshot.state.name(%%)`). Clicking on one Snapshot highlights the section from that snapshot till the subsequent snapshot. ### 3. Log Finally the Log part. This component shows each log object in one line so that it looks like a general log file. The format of each line is as follows: ```