Hands-on task
jq: JSONL to a CSV summary
/root/events.jsonl — one JSON object {user, action} per line. Write a jq filter in the file /root/summary.jq (handy to do in the Editor tab above the terminal) that counts the number of events per user. The filter must work when run as jq -s -r -f /root/summary.jq <file> on any file of this format, not just this one. Write the result for events.jsonl to /root/summary.csv: a CSV with the header user,count, sorted by user. The format is what @csv produces (strings in quotes, numbers without).
- jq
- jsonl
- group_by
- @csv
- aggregation and sorting