There is no direct way to filter the logcat output using multiple keywords from a json format. However, you can use a combination of grep and regular expressions to achieve this.
Here’s an example:
adb logcat -v time > logcat.log
This will capture the logcat output and save it to a file called logcat.log.
cat myjson.json | jq -r . > keywords.txt
This will create a text file containing all the keywords from your json file, one per line.
grep -f keywords.txt logcat.log > filtered.log
This will create a new file called filtered.log that contains only the logcat messages that match the keywords from your JSON file.
Note that this method will only match exact keyword matches. If you need to match partial keywords or use more complex regular expressions, you will need to modify the regex patterns in the grep command accordingly.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-11-20 11:00:00 +0000
Seen: 7 times
Last updated: Feb 27 '22
How can I install Beegfs on Ubuntu 22.04?
How can a .zip file from GitHub be loaded into Google Colab?
What is the process of using the Multmerge() function in r to combine files in a directory?
In Mac, what is the method to increase the privileges of an executable through setuid?
What can be done to resolve the issue with the Untracked working tree file named '._.git'?
What are the steps to restrict the overall file size of uploaded files in NestJS using multer?