HACKER Q&A
📣 vsroy

Easiest graphing / data viz solutions for graphing logs?


I have a bunch of logs in structlog form (can easily be converted to JSON). Think:

``` timestamp=1 idx=2 key=foo key2=bar key3=4 rank=2 timestamp=2 idx=3 key=baz key2=box key3=4 rank=3 timestamp=3 idx=3 key=baz key2=box key3=4 rank=3 mode=start timestamp=4 idx=3 key=baz key2=box key3=4 rank=3 mode=end ```

and I'd like to do a bunch of adhoc / custom graphing. For example: there's the obvious stuff like graphing how many times I had the value "baz" for "key2" in "rank=3" per minute.

But there's also less obvious stuff like "graph the average time between mode=start/mode=end" and calculate the average delay between an "mode=end" and the next "mode=start" per rank.

So far I've been doing pretty well with a jupyter notebook + pandas, but it's pretty verbose, and I don't think matplotlib is the best graphing software. Also, pandas sucks.

Are there better solutions for graphing? I was looking into gnuplot, but its API seems unwieldy.

I'm looking for something lightweight (my logs are only on the order of ~ 50 - 500 MB). Not trying to setup Prometheus / Loki, or anything of similar complexity.


  👤 sargstuff Accepted Answer ✓
Use web cam to snap pictures of logs (assuming not in desert/middle of body of water), print out picures and pin to wall in required plot sequence is the easist way I know of. Does tend to burn through lot of printer ink & paper though.

Not easy to make recommendations because lot of missing context -- diy / personal improvement, work related, eduational related, need something for a presentation discussion at monthly neighborhood meet up of retired NASA statisicians trying to learn non-mainframe / non-proprietary / newer than voyager I 45 year old data format ways of parsing log data & don't have access to modern pc equipment.

Note: make sure not violating terms of usage if go the route of find demos/examples of things similar what trying to generate, modify to situation as needed.

old school, light weight, but need some backround in programming/scripting: gawk/shell commands in a script & generate/feed to nroff/graph. more modern: latex/gnuplot/ggplot2/gnu octive/R

IMHO: Things only seems verbose if have never used before & trying to use non-default settings.


👤 sargstuff
logfile navigator ( https://news.ycombinator.com/item?id=33989493 ) does a nice cli/text visual presentation. Can be used to filter out 'noise' before piping output to be reformated / computing additional "stats" / generating appropriate info usable by next command in pipeline via gawk before passing on to other graphing packages such as nroff's graph, gnuplot, ggplot2, pdf/ps template, latex, etc.