K9s: copy logs to clipboard

Created on 31 Oct 2019  路  6Comments  路  Source: derailed/k9s






Describe the solution you'd like
When describe on a pod when can press c to copy it's content to the clipboard. I simply would love to have the same when within the log view of a container. I simple want to press c to copy the log and then return to another terminal and do cat | less and pressing ctrl + insert to inject the clipboard (logs in this case) to less and search for something.

Describe alternatives you've considered
Currenlty we can ctrl-s logs to a file but the path etc. is a bit awkward for me to get the logs from. Also it surely would be even more awesome to have less commands in the log view right away.

enhancement

Most helpful comment

Thank you @hawkesnc!
All credits goes to @Ameausoone Antoine M茅ausoone on his PR!!

All 6 comments

Just a buffer like weechat's /window bare would be awesome.

Thank you for k9s!

yeh, better way to copy sections of the logs can be awesome. K9S has been wonderful!!!

Would love to see this feature as well!

@xetra11 @kaihendry @bbhenry @hawkesnc Thank you all for weighting in!
I think that makes sense but I believe a lot of that functionality is already available right inside k9s without having to resort to an external shell. Here are a few thoughts:

  1. You can save the logs and then issue a command to view the screendumps aka sd. Selecting one of these will kick you into your fav editor.
  2. You can define a plugin to view the logs and use less or cat. Checkout the plugins dir in this repo for examples.
  3. You can use a filter command while in the log view to filter out the logs ie /fred will show all log lines with fred in them

That said there is a PR to dump logs to the clipboard which will be available in the next drop.

That said there is a PR to dump logs to the clipboard which will be available in the next drop.

That's PERFECT for me! Thank you! 馃槃

Thank you @hawkesnc!
All credits goes to @Ameausoone Antoine M茅ausoone on his PR!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RothAndrew picture RothAndrew  路  3Comments

kordianbruck picture kordianbruck  路  3Comments

krysopath picture krysopath  路  3Comments

stk0vrfl0w picture stk0vrfl0w  路  3Comments

steffen-geissinger-by picture steffen-geissinger-by  路  3Comments