klogg icon indicating copy to clipboard operation
klogg copied to clipboard

[feature request] add sort search result

Open Abay11 opened this issue 1 year ago • 1 comments

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

Abay11 avatar May 17 '24 08:05 Abay11

That could be something to add to scratchpad. Sorting this way 10+Gb file will be costly.

variar avatar Nov 15 '24 11:11 variar