When parsing Linux/Android logs, we often use various tools to filter the logs. However, I haven't found a tool that can save multiple regular expressions and search across multiple files simultaneously. Some systems print each log line to different files, making it challenging to find the logs you need.
While experienced Linux users can write commands with find
, grep
, awk
, and sed
in bash to search patterns in multiple files, the bash syntax is not very user-friendly.
This example demonstrates how to parse the dumpState log from a Samsung A15 phone. Note that this example uses only one log file for filtering, which is not ideal.
-
Dump logs following these steps: Get device logs - Samsung Knox Documentation
-
Apply the filter on the log:
./mfmf_cli.py -l my_log_dir -c ./example_config > output.txt
-
Enable advanced feature: "exec() script"
./mfmf_cli.py -l my_log_dir -c ./example_config --exec_script > output.txt
- Provide a comprehensive example involving scattered logs.
- Implement auto-unzip functionality for files in the log directory.
- DONE: Implement "exec() script" for filtering by comparing numbers in the log.
- Refactor source code
- Add unit test
- Add -h to show helps
- Output to files instead of only stdout
- Add GUI support
- Support json configs (json config is more easier to maintain if we have a GUI)