Add --format json
option.
$ alp json --file example/logs/json_access.log --format json
[["count","1xx","2xx","3xx","4xx","5xx","method","uri","min","max","sum","avg","p90","p95","p99","stddev","min_body","max_body","sum_body","avg_body"],[1,0,1,0,0,0,"POST","/hoge/piyo",0.234,0.234,0.234,0.234,0.234,0.234,0.234,0,34,34,34,34],[1,0,1,0,0,0,"GET","/diary/entry/1234",0.135,0.135,0.135,0.135,0.135,0.135,0.135,0,15,15,15,15],[1,0,1,0,0,0,"GET","/diary/entry/5678",0.432,0.432,0.432,0.432,0.432,0.432,0.432,0,30,30,30,30],[1,0,0,0,0,1,"GET","/foo/bar/5xx",60,60,60,60,60,60,60,0,15,15,15,15],[1,0,1,0,0,0,"GET","/req",0.321,0.321,0.321,0.321,0.321,0.321,0.321,0,15,15,15,15],[2,0,2,0,0,0,"GET","/foo/bar",0.123,0.123,0.246,0.123,0.123,0.123,0.123,0,56,56,112,56],[5,0,5,0,0,0,"POST","/foo/bar",0.057,0.234,0.548,0.11,0.234,0.234,0.234,0.065,12,34,126,25.2]]
$ alp json count --file example/logs/json_access.log --keys ua --format json
[["sum","ua"],[1,"UA4"],[3,"UA2"],[4,"UA1"],[4,"UA3"]]
$ alp json topN --file example/logs/json_access.log --format json
[["rank","uri","method","status","restime","bytes","time"],[1,"/foo/bar?token=xxx\u0026uuid=1234","POST",200,0.057,12,"2015-09-06T05:58:05+09:00"],[2,"/foo/bar?token=xxx\u0026uuid=1234","POST",200,0.057,12,"2015-09-06T05:58:05+09:00"],[3,"/foo/bar?token=yyy","POST",200,0.1,34,"2015-09-06T05:58:41+09:00"],[4,"/foo/bar?token=yyy","POST",200,0.1,34,"2015-09-06T05:58:41+09:00"],[5,"/foo/bar?token=zzz","GET",200,0.123,56,"2015-09-06T06:00:42+09:00"],[6,"/foo/bar?token=zzz","GET",200,0.123,56,"2015-09-06T06:00:42+09:00"],[7,"/diary/entry/1234","GET",200,0.135,15,"2015-09-06T06:00:43+09:00"],[8,"/foo/bar?token=yyy","POST",200,0.234,34,"2015-09-06T05:58:44+09:00"],[9,"/hoge/piyo?id=yyy","POST",200,0.234,34,"2015-09-06T05:58:44+09:00"],[10,"/req","GET",200,0.321,15,"2015-09-06T06:00:43+09:00"],[11,"/diary/entry/5678","GET",200,0.432,30,"2015-09-06T06:00:43+09:00"],[12,"/foo/bar/5xx","GET",504,60,15,"2015-09-06T06:00:43+09:00"]]