1 | initial version |
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.