Skip to content
Contents
GuidesOpenWrt

How to export OpenWrt nlbwmon records by period as CSV and JSON

A decompressed .db.gz file may still contain binary records. Ask the running nlbwmon service for the period you need and leave the database intact.

A decompressed .db.gz file may still contain binary records. Ask the running nlbwmon service for the period you need and leave the database intact.

Pick a recorded period

Run these commands over SSH on the router. Replace the example date with a start date from the list. Omit -t and its date for the current period.

nlbw -c list
nlbw -t 2026-12-01 -c csv
nlbw -t 2026-12-01 -c json

If you only have offline files, keep the originals. Stop the service in an isolated installation of the same version, restore a copy of the directory there and start it again.

Save both files on your computer

In a local terminal, substitute the address and date. Use an empty folder because redirection overwrites existing files.

ssh [email protected] 'nlbw -t 2026-12-01 -c csv' > usage.tsv
ssh [email protected] 'nlbw -t 2026-12-01 -c json' > usage.json

Check that SSH succeeded and inspect the header. Our VM used tabs for CSV, hence the TSV extension. If everything appears in one column, select the actual delimiter. Import IP and MAC addresses as text.

Check one row in both formats

Read data in the order given by columns. Match the same device and protocol. The serial log shows rx_bytes of 113376 and tx_bytes of 1264. The commit shown was a separate write test. Export needs no commit. Live totals may grow between queries.

OpenWrt 25.12.6 · nlbwmon · JSON / CSV
OpenWrt 25.12.6 · nlbwmon · JSON / CSV

For a header alone, compare the current period, retained dates and filters. If the service is unreachable, check its status and directory and restore any changed settings. No restart or reset is needed for export. Remove device identifiers before sharing.

Why does the OpenWrt traffic graph grow while the nlbwmon file stays unchanged?

Explore hardware

Comments