Created
June 15, 2020 05:27
-
-
Save alivx/d33bcee07826833a5905c9d9dd011da3 to your computer and use it in GitHub Desktop.
Split one log file into multiple files based on string or prefix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exmaple log file: | |
```Log | |
New Request 1 | |
get user-id (Ref_8a28) | |
update user history (Ref_7a27) | |
send notification (Ref_6a26) | |
user info updated (Ref_5a25) | |
New Request 2 (Ref_4a24) | |
get user-id (Ref_3a23) | |
update user history (Ref_2a22) | |
send notification (Ref_1a21) | |
user info updated (Ref_0a20) | |
``` | |
#Command | |
csplit -f output_file_ service.log "/New Request/" '{*}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment