On Mon 2018-Oct-29 16:28:12 +0000, Anderson, Charles R <c...@wpi.edu> wrote:
Why is "show log messages | last 10" so slow with a large log file when I can go to the shell and run "tail -10 /var/log/messages" much more quickly?
Because it's an action that is done after the pipe rather than being the action itself, so it's equivalent to `cat /var/log/messages | tail -n 10` not directly to `tail -n 10 /var/log/messages`. It's a generic pipe action that can be applied to any text output, e.g. the output of a regular operational "show" command, but it's not a top-level command that does file processing itself like `tail` can.
Maybe JUNOS can borrow the implementation of the "tail" command to make it quicker.
They'd have to add a new top-level command or perhaps add a parameter to the `file show` operation, I'd think. Probably doable, but not sure how much traction the feature request would get.
-- Hugo Slabbert | email, xmpp/jabber: h...@slabnet.com pgp key: B178313E | also on Signal
signature.asc
Description: Digital signature
_______________________________________________ juniper-nsp mailing list juniper-nsp@puck.nether.net https://puck.nether.net/mailman/listinfo/juniper-nsp