Skip to content

Turn search into filter #879

Answered by tstack
nicolasbock asked this question in Q&A
Jul 7, 2021 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

The current search is added as a TAB-completion possibility for the :filter-in and :filter-out commands. So, you should be able to type the first couple characters from the search and then press TAB to have it completed.

Alternatively, most functionality is available through the SQL interface, so you can write a SQL statement to get the current search from the lnav_views table and insert it into the lnav_view_filters table. The following statement will do that just for the log view:

;INSERT INTO lnav_view_filters (view_name, pattern) SELECT name, search FROM lnav_views WHERE name = 'log' AND search != ''

This statement can then be put in an lnav script or bound to a key so you don't have …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@nicolasbock
Comment options

Answer selected by nicolasbock
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants