variar / klogg

Really fast log explorer based on glogg project
https://klogg.filimonov.dev
GNU General Public License v3.0
2.13k stars 187 forks source link

[feature request] add sort search result #711

Open Abay11 opened 1 month ago

Abay11 commented 1 month ago

I think it would be very useful if we could have such feature.

It would be useful, if we have ability to sort lines as it is or using regex.

For example, sorting when no regex used. Let say we have lines:

Function foo called.
Function foo finished.
Function foo called.
Function foo fininshed.

if we sort lines we get

Function foo called.
Function foo called.
Function foo finished.
Function foo fininshed.

Now example when sorting using regex would be helpful. If we have log messages with timestamps or any other prefix which may change, we can select the part we want to compare and sort:

[12:00:01] Function foo called.
[12:00:02] Function foo finished.
[12:00:03] Function foo called.
[12:00:04] Function foo fininshed.

and sort with regex which select an interested for us part and we get:

[12:00:01] Function foo called.
[12:00:03] Function foo called.
[12:00:02] Function foo finished.
[12:00:04] Function foo fininshed.

What do you think? Will it be helpful? I may open pull request if a lot of people also think it will be helpful