coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sort log files solution


From: Pádraig Brady
Subject: Re: Sort log files solution
Date: Fri, 30 Sep 2022 15:49:23 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Thunderbird/98.0

On 30/09/2022 03:47, Ray Phillips wrote:
I presume the solution provided on this page:

https://www.gnu.org/software/coreutils/manual/html_node/sort-invocation.html#sort-invocation

to the "Sort a set of log files, primarily by IPv4 address and
secondarily by timestamp." problem is for an earlier version of sort,
since (unless I'm mistaken) that can now be done using one command:

usort -s -k1,1V -k4.2,4.3n -k4.5,4.7M -k4.9,4.12n -k4.14,4.15n -k4.17,4.18n -
k4.20,4.21

I tried that on Windows 10 with this sort:

C:\> sort --version
sort (GNU coreutils) 8.26
Packaged by Cygwin (8.26-2)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and Paul Eggert.

C:\>


Perhaps that alternative could be added to the web page?

It's a fair point. The existing example is still useful
to document the multiple sort invocation idea,
so I've added extra info about the -V simplification option at:

https://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=4fd708810

thanks,
Pádraig




reply via email to

[Prev in Thread] Current Thread [Next in Thread]