You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Android logcat, and other logging that shows output from multiple applications/sources, it is very useful to set up a rule saying:
If I see a line containing This particular text/tag, remember this Other field, and only show lines containing that field.
So in Androids case, I can say "When you see the text "MyApp Starting", save the ProcessID from that line, and filter out any lines from other processes.
Maybe it's already possible with some scripting ?
The text was updated successfully, but these errors were encountered:
That's an interesting idea. I don't think it's fully possible at the moment since lnav doesn't have a way to do something when new lines are loaded and filtering is still pretty limited. What you might be able to get working right now is a script like the following:
#
# @synopsis: myapp_filter
# @description: Create a :filter-in with all ProcessIDs for newly started instances of MyApp
#
# Find all instances of the log message "MyApp Starting" and combine the ProcessIDs
# into a regex for :filter-in stored in the 'filt' variable
;SELECT group_concat(ProcessID, '|') AS filt FROM mylog WHERE log_body LIKE '%MyApp Starting%'
# Execute the :filter-in, substituting the 'filt' variable from the SELECT
:eval :filter-in $filt
You can put that in a script (e.g. myapp_filter.lnav) and run it with '|/path/to/myapp_filter.lnav' in lnav. If you put it in a format directory (e.g. ~/.lnav/formats/installed), you can run it with '|myapp_filter' and lnav will tab-complete it as well.
Well... four years later, I actually did something about this request. I don't know if you're even still interested in this, but if you are, I'd like your thoughts.
For Android logcat, and other logging that shows output from multiple applications/sources, it is very useful to set up a rule saying:
So in Androids case, I can say "When you see the text "MyApp Starting", save the ProcessID from that line, and filter out any lines from other processes.
Maybe it's already possible with some scripting ?
The text was updated successfully, but these errors were encountered: