Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Angle Grinder – A terminal app to slice, dice, and aggregate your logs (github.com/rcoh)
143 points by rusbus 4 days ago | hide | past | favorite | 21 comments

Something that looks vaguely similar to lnav (and Angle Grinder) is fzf (https://github.com/junegunn/fzf). It's quite good at interactively searching for given items in a pile of text.

I don't think it does summing "out of the box", but I've found it great for exploring logs (or even very long grep searches) interactively.

In the past I've used RecordStream a lot. I don't really know Perl but recs is still damn useful.



People ask the question "what's Rust good for?" pretty frequently, and little terminal apps like this are precisely the reason. I've written a few of my own in the past, and it enables a kind of workflow that simply didn't exist before: I could have a fully safe, "correct", LLVM-optimized binary installed on my desktop in an afternoon.

I have been using golang for cli applications for the past 6 years and love it. Been looking at rust but haven’t been convinced to try it out yet.

Any big win that I would get from a practical standpoint with rust that im missing with golang?

As a general rule, I'd expect Rust stuff to use less CPU (as the grandparent comment mentioned, it's optimized with LLVM) and less RAM (no GC). If that's a big win or not depends a lot on what your CLI application is doing. I'm a big fan of Rust but if Go does what you want, great. Go's a simpler language with a more mature/stable ecosystem and much more straightforward async code.

Rust of course has generics too, so I find it easier to use the right data structure for the problem (eg btrees) without dropping to interface{}. But it seems like the Go team is getting serious about adding generics so this advantage may be temporary.

I've found it to be mixed, depending on the nature of the workload. Sometimes having GC can be faster, since allocations can be cheaper. But it will generally trade off higher memory utilization, and the behavior is harder to predict under diverse workloads.

I agree GC doesn't necessarily mean more CPU. Just more RAM. My reason for thinking Rust code generally uses less CPU is based on it using a more sophisticated compiler.

That said, when Rust code spends a lot of time on allocations, it's usually fixable:

* You can switch global allocators to jemalloc or, for short-lived programs with acceptable total allocation size, bumpalo.

* You can often restructure code to borrow/reuse buffers instead of having per-iteration allocations.

* You can use slabs or arena allocators.

I'm a fan of Rust and use it for side projects, but what in particular about this is better in Rust, other than the compile time checking? Or do you mean that because Rust is safe, you can write it faster?

Interesting. How does this compare to lnav? https://lnav.org/

Angle Grinder supports analyzing a stream of data and updating the results on-the-fly. That's not possible in lnav since it uses sqlite for analysis.

Ideally, it would be nice to integrate Angle Grinder into the lnav to support both modes. I also think the the angle-grinder/sumologic can be a bit friendlier than SQL in some cases.

This is awesome. I've been looking for a tool just like this but didn't want to write it myself. Thank you for sharing!

Looks interesting, as someone in linux support having to remotely analyse logs rather than having a logstash/splunk/grafana/etc UI that I can use directly.. I am in need of tools like this. I will give it a run :)

EDIT: I had written here that your tool name 'ag' conflicts with "silversearcher-ag" which is a grep replacement and people are likely to be users of both. But your CLI tool name is in fact already 'agrind' just the cargo package is 'ag'. May be worth unifying them to 'agrind'?

+1 for the cli rename.

On some distro's you can just do `apt-get install ag` for silversearcher-ag.

So "ag" is pretty common for the great silversearcher-ag tool.

I used to use sumologic in an old job and found it super useful, having a command line tool along the same lines is amazing, thank you!

This is actually inspired by the author's first CLI tool, which was a CLI for sumologic: https://github.com/SumoLogic/sumoshell

I wish people would come up with unique names for their 'thing' instead of polluting the namespace. ;-)

That is so much harder to do than you’d think!

I think the author changed his project name a few times to avoid namespace collision (one of them was `ag` the silver searcher)

I really like this tool, but I'm not sure what it gets me more than jq (and https://github.com/tyleradams/json-toolkit to convert non-json to json).

What can angle grinder do better than jq?

I think if you are an absolute JQ master, it doesn't get you much more. Streaming aggregates where the data live updates in your terminal is one thing. But also the language is a little easier to grok, IMO. I can never use JQ without googling

OMG, I've been dreaming of this tool for years. Thank you!

Applications are open for YC Winter 2022

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact