Download OCPP Logs
This guide explains how to download OCPP logs from Network Manager and work with the exported data.
Downloading Logs from Network Manager
- Navigate to Stations and select the station you want to download logs for.
- Open the Real-Time Logs tab.
- Use the time range selector to choose the period you want to export.
- Optionally filter logs by action type using the filter box.
- Click the download button (arrow icon) to download the logs.
The logs will be downloaded as a .jsonl file (JSON Lines format).
Download Limit: Exports are limited to 500 logs to prevent browser memory issues. If your date range contains more than 500 logs, the export will be truncated. Use a narrower date range or filters to get specific logs.
JSONL File Format
The exported file uses the JSONL (JSON Lines) format, where each line is a separate JSON object. This format is optimized for streaming processing and works well with command-line tools.
File Structure
Line 1 - Header:
{"type":"header","exportedAt":"2024-01-15T10:30:00.000Z","stationId":"ABC123","dateRange":{"start":"2024-01-15T09:00:00.000Z","end":"2024-01-15T10:30:00.000Z"},"totalMessages":42}Subsequent Lines - OCPP Messages:
Each line is a raw OCPP message in array format:
- CALL (Request):
[2, "message-id", "ActionName", {payload}] - CALLRESULT (Response):
[3, "message-id", {payload}] - CALLERROR (Error):
[4, "message-id", "ErrorCode", "ErrorDescription", {details}]
Example File Content
{"type":"header","exportedAt":"2024-01-15T10:30:00.000Z","stationId":"EVSE001","dateRange":{"start":"2024-01-15T09:00:00.000Z","end":"2024-01-15T10:30:00.000Z"},"totalMessages":4}
[2,"20240115T093000000Z-Heartbeat","Heartbeat",{}]
[3,"20240115T093000000Z-Heartbeat",{"currentTime":"2024-01-15T09:30:00.000Z"}]
[2,"20240115T094500000Z-StatusNotification","StatusNotification",{"connectorId":1,"status":"Available","errorCode":"NoError"}]
[3,"20240115T094500000Z-StatusNotification",{}]Working with JSONL Files
Using jq (Command Line)
jq is a powerful command-line JSON processor that works great with JSONL files.
View the header:
head -1 ocpp-logs-EVSE001-2024-01-15.jsonl | jqCount total messages (excluding header):
tail -n +2 ocpp-logs-EVSE001-2024-01-15.jsonl | wc -lFind all Heartbeat requests:
tail -n +2 ocpp-logs-EVSE001-2024-01-15.jsonl | jq -c 'select(.[0] == 2 and .[2] == "Heartbeat")'Find all error responses:
tail -n +2 ocpp-logs-EVSE001-2024-01-15.jsonl | jq -c 'select(.[0] == 4)'Extract all action names from requests:
tail -n +2 ocpp-logs-EVSE001-2024-01-15.jsonl | jq -r 'select(.[0] == 2) | .[2]' | sort | uniq -c | sort -rnFilter StatusNotification messages and pretty print:
tail -n +2 ocpp-logs-EVSE001-2024-01-15.jsonl | jq 'select(.[0] == 2 and .[2] == "StatusNotification")'Using grep
For simple text searches:
# Find all lines containing "Authorize"
grep "Authorize" ocpp-logs-EVSE001-2024-01-15.jsonl
# Find all error responses (message type 4)
grep '^\[4,' ocpp-logs-EVSE001-2024-01-15.jsonlOCPP Message Types Reference
| Type | Name | Description |
|---|---|---|
| 2 | CALL | Request message from station or central system |
| 3 | CALLRESULT | Successful response to a CALL |
| 4 | CALLERROR | Error response to a CALL |
Tips
- Messages are sorted by timestamp in ascending order (oldest first).
- The message ID in each OCPP message is generated from the timestamp and action name.
- Use
tail -n +2to skip the header line when processing only messages. - The JSONL format allows processing large log files without loading everything into memory.
