Live data from Hacker News

Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

github.com

71–80 of 81 posts

Re: Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

#71

I'm not super familiar with express but this seems to be listening on external interfaces as well: https://github.com/soorajshankar/logScreen/blob/f8b29aaef428... So this will be sharing your logs with the world if you run this outside of a trusted network. (And personally I avoid trusting any networks)

It does, but express doesn't tell it directly in the docs.

Instead http://expressjs.com/en/4x/api.html#app.listen sends you to https://nodejs.org/api/http.html#http_server_listen which also won't give the answer but sends you to https://nodejs.org/api/net.html#serverlisten which at some points finally documents that default is 0.0.0.0.

Welcome to the JavaScript ecosystem :/

Re: Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

#72
post #57

This is a solution looking for a problem. The browser is a horrible place for viewing text logs. Companies like Splunk and Datadog put countless hours into trying to make it work and it's never not-painful to view logs in a browser.

What's better? I ask out of ignorance, but personally I think Datadog is amazing for viewing logs.

Re: Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

#73

I'm not super familiar with express but this seems to be listening on external interfaces as well: https://github.com/soorajshankar/logScreen/blob/f8b29aaef428... So this will be sharing your logs with the world if you run this outside of a trusted network. (And personally I avoid trusting any networks)

It does, but express doesn't tell it directly in the docs. Instead http://expressjs.com/en/4x/api.html#app.listen sends you to https://nodejs.org/api/http.html#http_server_listen which also won't give the answer but sends you to https://nodejs.org/api/net.html#serverlisten which at some points finally documents that default is 0.0.0.0. Welcome to the JavaScript ecosystem :/

I wouldn't exactly call this a failure of the JS ecosystem. The Express documentation you've linked to mentions that the host is the (optional) second argument to the listen function:

> app.listen([port[, host[, backlog]]][, callback])

You literally just have to run:

  app.listen(3000, '127.0.0.1')
If you don't trust the network you're on you should just be explicit about which IP address you'd like to listen on.

Re: Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

#74

I'm not super familiar with express but this seems to be listening on external interfaces as well: https://github.com/soorajshankar/logScreen/blob/f8b29aaef428... So this will be sharing your logs with the world if you run this outside of a trusted network. (And personally I avoid trusting any networks)

It does, but express doesn't tell it directly in the docs. Instead http://expressjs.com/en/4x/api.html#app.listen sends you to https://nodejs.org/api/http.html#http_server_listen which also won't give the answer but sends you to https://nodejs.org/api/net.html#serverlisten which at some points finally documents that default is 0.0.0.0. Welcome to the JavaScript ecosystem :/

That's a sensible default. It would be super frustrating if by default the web server you built couldn't be accessed by anyone else in your network.

Re: Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

#75

Earlier quoted context omitted.

Please keep working on this! I started a similar tool because I desperately needed it, but haven’t found the time to maintain it. https://github.com/corytheboyd-smartsheet/json-log-explorer Having something like the log explorer in DataDog for local development is so insanely useful

That was the idea exactly: I wanted to have DD log explorer locally that works insanely fast to be coupled within development process. As much as I love terminal, its just so limiting when it comes to browsing and filtering through more content.

Absolutely agreed, and glad someone else is out there fighting the good fight :)

Re: Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

#76

Earlier quoted context omitted.

Please keep working on this! I started a similar tool because I desperately needed it, but haven’t found the time to maintain it. https://github.com/corytheboyd-smartsheet/json-log-explorer Having something like the log explorer in DataDog for local development is so insanely useful

That was the idea exactly: I wanted to have DD log explorer locally that works insanely fast to be coupled within development process. As much as I love terminal, its just so limiting when it comes to browsing and filtering through more content.

> As much as I love terminal, its just so limiting when it comes to browsing and filtering through more content.

What terminal-based tools are you thinking of when you say this? Just tail/grep/less?

Re: Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

#77
post #76

Earlier quoted context omitted.

That was the idea exactly: I wanted to have DD log explorer locally that works insanely fast to be coupled within development process. As much as I love terminal, its just so limiting when it comes to browsing and filtering through more content.

> As much as I love terminal, its just so limiting when it comes to browsing and filtering through more content. What terminal-based tools are you thinking of when you say this? Just tail/grep/less?

that and more magic of sed, awk, jq and similar. I know you can do real magic in there but still, I believe it's easier to learn GUI than vim shortcuts or sophisticated jq/awk formulas. Still, I admire terminal for being around for so long and follow it as an example when building Logdy.

Re: Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

#78
post #45

Earlier quoted context omitted.

I was looking for something like this for a while, and it could be just the landing page, but I much prefer a tool that's been built slowly with thought and consideration (which is evident from your landing page). How does your tool handle semi-permanent usage or very long logs? For instance, I would run this to view logs from an ssh server that's been up for 6 months, when systemd has rotated the log file etc.

Why would you watch logs for more than 6 months? Do you filter them? What does the system you are watching do?

for instance, running a nextcloud instance through docker compose, I'd like to have a lightweight web ui for browsing the server logs. not just for 15 minutes but for longer periods of time.

on an hpc cluster, I want to want logs from the slurmctld forever essentially without having to login and grep through the logs.

there's a bunch of online services for this, there's ELK stack, there's grep, and few things sit in between. hence my question

Re: Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

#79
post #45

Earlier quoted context omitted.

Why would you watch logs for more than 6 months? Do you filter them? What does the system you are watching do?

for instance, running a nextcloud instance through docker compose, I'd like to have a lightweight web ui for browsing the server logs. not just for 15 minutes but for longer periods of time. on an hpc cluster, I want to want logs from the slurmctld forever essentially without having to login and grep through the logs. there's a bunch of online services for this, there's ELK stack, there's grep, and few things sit in…

then the problem is not viewing the logs but storing them, maybe compressing, and then retrieving. If that's not a problem (size) then with some cron magic you should be able to store the logs from specific locations into a single one so rotation doesn't eat them and then just view using a log viewer of your choice.

Re: Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"

#80
post #56

Earlier quoted context omitted.

> showed logs as a tree. Yes , that is exactly what I want as well - a tree-like structure where you can trace events across multiple layers of abstraction as well as across systems (so both horizontal and vertical relations of events, so to speak). Some infra systems output syslog loglines and there's no changing that, and I still want to capture and relate these log messages to other events (incl. high-level busine…

Thanks for your lovely reply. I don't have the code anymore might have been called "logtree", it was a HTML file and very small, it would parse dot "." separated lines such as (user.connected) and arrange them in a tree with indentation, if you clicked the dot syntax it would highlight in yellow other instances of that bucket of entries later in the log file. I think you want elegant navigation between linear sequenc…

Thank you for helping me structure what I want, yes, exactly. (And noted re: your PoC, ok!)

> You might want to see all events of the internals of two different components in the tree structure.

> Need to process log lines into a graph and then provide quick navigation for them.

Yes, looks like it, indeed. Yeah.

If interested, this is how I'd hastily summarise my problem statement - it is I think a rather generic recurring problem and analysis pattern, not unique to any company (context: goal is to drive through this initiative as part of overall software architecture improvement needs, and bringing business maturity (as per CMM model) up in our particular case):

- need to introduce and enforce structured event hierarchy (think: each high level business transaction (e.g. user signs document) is a parent which retains all related child events across all layers of abstraction (ideally down to DB connection and file handles, internal API endpoints hit, block storage i/o errors, etc.)

- problem: while for own software Backend-generated events we can enforce and manage this, some infra pieces emit raw text syslog (sometimes even syslog message portion (log format) cannot be fully controlled) and do not contain cross-component technical identifiers for determining relations to events

- there are solutions including ML solutions (of course)

- there exist interesting papers to lose productivity and/or conduct deeper research

- what do, how to balance, how to incrementally define, introduce into culture, incrementally realistically establish this (etc.)

Some interesting papers for approaching the complicated part (assuming defining event ontology and hierarchy and overall semantics is the easy part) - the "relating unstructured logs to events and embedding them into graphs, and aligning and training everyone to analyse and work with "event trees" across multiple teams (but yes, ops, integration support, etc. - I mean is that not the dream, right...) do exist[1][2][3][4][5], and some interesting thoughts and many lofty ambitious questions[6]. Trying to gain insight into best practices here. Meanwhile, maybe links will look interesting :) (e.g. that 1849-2023 IEEE standard - just found it today...)

[1] LogTree: A Framework for Generating System Events from Raw Textual Logs https://www.researchgate.net/publication/220766390_LogTree_A... (https://ltangt.github.io/papers/icdm2010-logtree.pdf)

[2] Structural Event Detection from Log Messages https://faculty.ist.psu.edu/jessieli/Publications/2017-KDD-l... (this one may look bewildering at first but the math eqs are actually ~legible / straightforward from quick glance, even; also, has nice coverage of related work) (overall nice, might look smarter than appears, but not sure; see MCMC approach etc. in section 5.)

[3] golang package https://pkg.go.dev/source.monogon.dev/metropolis/pkg/logtree - why i mention - see KLogParser func (https://pkg.go.dev/source.monogon.dev/metropolis/pkg/logtree...) (but also see limitations) (did not review in detail, maybe nothing useful)

[4] 1849-2023 - IEEE Standard for eXtensible Event Stream (XES) for Achieving Interoperability in Event Logs and Event Streams https://www.xes-standard.org/

[5] related to above (supports standard) https://pm4py.fit.fraunhofer.de/documentation -> see example of ontology: Object-Centric Event Logs

[6] a structural approach to the problem of structure... use existing frameworks and languages like BPML to create or use existing event type ontologies from BPMN models; use a proper structured thought-through ontology for this, and then sort out that pesky "relating low level infra raw syslogs with none/few TIDs to some node on a graph" problem

Anyway, thanks for making through my rant! Writing it in part because on the off chance someone bites and has insight - I'd be very interested to hear more; and partially just to share those links above because those may tickle your (Sam's fancy) :) thanks for reading!

Post reply on HN