Translate a CiviProxy logfile into JSON format.
Go to file
Marc Koch cfc544e3d7
️ use generator to parse JSON lines
Instead of parsing the entire log file at once, use a generator and return JSON lines.
2024-07-09 14:42:14 +02:00
.idea
src/civiproxy_logs2json ️ use generator to parse JSON lines 2024-07-09 14:42:14 +02:00
tests
.gitignore
LICENSE
MANIFEST.in
README.md ️ use generator to parse JSON lines 2024-07-09 14:42:14 +02:00
pyproject.toml
setup.py

README.md

CiviProxy_Logs2Json

Translate a CiviProxy logfile into JSON format.

Installation

python3 -m pip install civiproxy_logs2json --user

Example Usage

Pass logfile as option:

cpl2j -f /var/www/proxy_logs/proxy.log

Pipe logfile into program:

cat proxy.log | cpl2j 

Set JSON indentation to two spaces:

cat proxy.log | cpl2j -s 2 

Output JSON lines:

cpl2j -l -f /var/www/proxy_logs/proxy.log

Tip

Use VisiData to explore the data in a very comfortable way: /var/www/proxy_logs/proxy.log

cpl2j -l -f /var/www/proxy_logs/proxy.log | vd -f jsonl