Turn search into filter #879
-
Hi, is it possible to turn a search into a filter without having to type the expression again? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The current search is added as a TAB-completion possibility for the Alternatively, most functionality is available through the SQL interface, so you can write a SQL statement to get the current search from the ;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 to type it out all the time. |
Beta Was this translation helpful? Give feedback.
-
When I enter: filter in AAA, and then enter: filter in BBB, shouldn't the result be a log containing both AAA and BBB? But in fact, I get AAA logs and BBB logs, as well as AAA and BBB logs |
Beta Was this translation helpful? Give feedback.
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 pressTAB
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 thelnav_view_filters
table. The following statement will do that just for the log view:This statement can then be put in an lnav script or bound to a key so you don't have …