Hacker Newsnew | past | comments | ask | show | jobs | submit | merightnow's commentslogin

Have you checked lnav?


I’ve seen it mentioned before, but I haven’t given it a demo yet. To be honest I wasn’t sure if TUI was the right UI for something like this, as it can’t pull off all of the things a GUI can. It’s not that I have a TUI allergy either (I can’t live without lazygit).


There are certainly limits on what can be displayed and done interactively due to the low resolution. Especially, when it comes to charting data. Some visualizations are available within lnav, mostly bar charts and the like. What type of things are you trying to do that you think are not possible within a TUI?


lnav is neat but doesn't really do structured logging AFAICT, just predetermined fields for the format.


lnav has support for JSON-lines, logfmt, as well as the Bro and W3C Extended Log File formats that are XSV and self-describing. The contents are also accessible through SQLite tables. Is there some gap here that you're thinking of?


The idea of structured logs is that every place in the code where you define a log message, you can throw in extra attributes (key/value) pairs.

As far as I can tell, the lnav feature you describing allows you to define a JSON log format with predefined fields. But if some log message uses an attribute you haven't anticipated in the format definition, there's no way to see it in the pretty-printed output or filter on it in the UI and no ability to see it in the SQLite virtual table. That's why I say lnav doesn't appear to support structured logs.

edit: oh, I missed `"hide-extra": false`! That significantly improves things! Still, I don't see a way to access it from the SQLite virtual table. I also don't see something else I might want: a way to have a different "view" for certain log messages; maybe to switch between filtering/viewing particular ones, maybe to just have line-format be conditional based on the detected format. (I guess I can sort of do this based on `module-field`? but I might want it lighter-weight/finer-grained than that.)


> But if some log message uses an attribute you haven't anticipated in the format definition, there's no way to see it in the pretty-printed output

Properties in the log message that are not in the "line-format" are displayed below the message as key-value pairs. As an example, the bunyan[1] log format[2] has a few standard properties that are used in the "line-format" to form the main message. Then, as shown in this test[3] for this log[4], the remaining properties (even ones not mentioned in the format file) are shown underneath.

> or filter on it in the UI

Since they are part of the message as mentioned above, they can be filtered on.

> and no ability to see it in the SQLite virtual table.

The "log_raw_text" column in the table can be used to access the original log message from the file. So, you can use the JSON functions in SQLite to retrieve the value:

    ;SELECT log_raw_text ->> '$.repository' from bunyan

[1] - https://github.com/trentm/node-bunyan

[2] - https://github.com/tstack/lnav/blob/master/src/formats/bunya...

[3] - https://github.com/tstack/lnav/blob/master/test/expected/tes...

[4] - https://github.com/tstack/lnav/blob/master/test/logfile_buny...


Thanks for this. When I switched my project to structured logging, I deleted its lnav log format file and was sad about it. I'll add one back now!


> I also don't see something else I might want: a way to have a different "view" for certain log messages; maybe to switch between filtering/viewing particular ones, maybe to just have line-format be conditional based on the detected format.

Have a look at the following comment on an issue that might be similar to what you're thinking of:

https://github.com/tstack/lnav/issues/1065#issuecomment-1602...

> I guess I can sort of do this based on `module-field`? but I might want it lighter-weight/finer-grained than that.

Unfortunately, the "module-field" does not work for JSON logs at the moment. It's something I should really fix.

Ultimately, lnav has existed for almost two decades now and I use it every day. So, it's always seeing improvements. If you're having a problem with it, file an issue on github. I don't always get around quickly to fixing other folks feature requests / issues, but it tends to happen eventually.

Thanks.


Yeah it's essential to have a viewer that deals natively with structured logs.

I'm iterating on a log pretty printer that accepts structured logs in a pipe and does things like color coding, adding terminal-recognized vscode:// hyperlinks for call stacks, smart wrapping based on the terminal width, and special formatting for panics and stuff.

NCurses is probably coming in a couple months.

Does anything like this already exist?


Unrelated question, what hardware do you use to setup your network for 25Gb/s? I've been looking at init7 for a while, but gave up and stayed with Salt after trying to find the right hardware for the job.


NIC: Intel E810-XXVDA2

Optics: To ISP: Flexoptics (https://www.flexoptix.net/de/p-b1625g-10-ad.html?co10426=972...), Router-PC: https://mikrotik.com/product/S-3553LC20D

Router: Mikrotik CCR-2004 - https://mikrotik.com/product/ccr2004_1g_12s_2xs - warning: it's good to up to ~20Gb/s one way. It can handle ~25Gb/s down, but only ~18Gb/s up, and with IPv6 the max seems to be ~10Gb/s any direction.

If Mikrotik is something you're comfortable using you can also take a look at https://mikrotik.com/product/ccr2216_1g_12xs_2xq - it's more expensive (~2500EUR), but should handle 25Gb/s easily.


IIRC most Mikrotik products lack hardware IPv6 offload which is probably why you're seeing lower speeds.


In that case 10Gb/s sounds actually pretty good, if that's without hardware offload.


Most likely it didn’t have to pay any money because you either payed your full deductible for the year already, or most likely it was payed by the accident insurance and not the regular health insurance


Yes, the accident insurance paid... but the bill was sent to me first.


I usually carry a big lock to be able to get all the way to the frame. But this design is definitely my least favourite one.


I've tried that as well. For me it was really difficult as I use the current changes quite a lot, and it makes it a lot more difficult to grasp the work I've done so far without having a meaningful change set.


I keep a draft PR open to keep track of this. Not has nice as vs-codes diff tool though.


You can still use VS Code's diff if you have the GitHub Pull Requests extension: https://marketplace.visualstudio.com/items?itemName=GitHub.v...


Anything that would allow a similar workflow in JetBrains IDEs?


you can use separate dev/release branches, and do something like "git diff master" (if you dont git push, you don't even need a separate branch, git diff origin/master works, but you lose half the point of frequent commits then)


The scope is not to produce "unicorns" but to drive innovation and R&D for all different kinds of projects. Those funds should not act as VC with the only purpose of growth, but it should fund sustainable innovative companies or open source foundations. Lately I've been seeing the EU founded logo on more and more extremely useful open source programs that everyone uses and which had no funding sources because of the lack of "extreme profit" in the horizon and that should be the results that this grants achieve.


"it should fund sustainable innovative companies or open source foundations."

Show material examples of this.

Also, the EU needs 'big companies' that employ a lot of people, pay high salaries, can afford to sustain complicated projects with know-how, to acquire and integrate other projects.

A nice batch of 'open source' projects that some people might use will not move the needle.


"the EU needs 'big companies' that employ a lot of people, pay high salaries, can afford to sustain complicated projects with know-how, to acquire and integrate other projects."

Why? Funding open source projects seems just as useful to me.


Open Source is a small issue thing in the context of an entire economy.

It's nice to have some support for it, but it doesn't even lend well to that: it's very hard to know which projects to support until after the fact, of course we know that 99% of it is never even used. The kinds of people involved don't do it generally for money, and also have their own ambitions. What happens when you have a 'great piece of open source' that AirBus and Daimler really want to integrate, but the 'maintainer' just doesn't care to make the necessary changes? Or is against it? Or is only working 'now and then ? Or doesn't feel 'large corps should benefit' or whatever? It's a tricky space. Worth supporting, but it would take a very specialized team and frankly, not that much money.

Europe needs large industrial organizations because they are the lifeblood of the economy, in fact, the hallmark of advanced civilizations. You want to know the 'difference' between 'rich' and 'poor' Europe? In 'rich Europe' a far grater portion of the population works in corporations with >1K employees.

Only at a certain scale can a lot of activities be addressed: you can't make an airliner with all it's supply chain, IP, R&D, systems integration, training, support and the myriad of operational activities with 'open source' or even with 'small shops' or 'vc money'. A lot of know-how is embedded within these groups that given them competitive advantage, and of course, scale is necessary to be competitive at an international level especially in 'winner takes all' type markets.

EU investment in open source is nice, but it's a side-show. What EU needs is Googles & Salesforces etc..


If you don't the big companies from other nations will take you over and flaunt your laws and regulations seems to be the answer


*flout


For me error handling in go was one of the biggest downsides. Using ADTs and union types for Either is most pleasurable error handling case I've encountered.


Can't think of a single company which did that and had any impact on me. I'm not able to read some news on a local foreign website once every few months and that's kind of everything.


Why would any site do that? Other than in a banks website I haven't encountered that behaviour previously


You're asking the wrong person: Sites shouldn't do that. But they do, often.

Banks are the worst offenders, but it isn't limited to that. Any site that thinks it is "special" and requires "extra security" targets password managers for reasons unknown.


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

Search: