Last active
August 26, 2019 09:07
-
-
Save kalpesh-fulpagare/3e8057fa9c712a7327419a5868a11e24 to your computer and use it in GitHub Desktop.
Grep Search
This file contains 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
# Find requests for a Device/API | |
LOGFILE="log/development.log" | |
OUTPUT=$(grep -an 'Started PUT "/api/v1/users/information' $LOGFILE | grep -o "........-....-....-....-............" | awk 'ORS="|"') | |
OUTPUT=${OUTPUT%?}; | |
echo $OUTPUT | |
OUTPUT=$(egrep -an $OUTPUT $LOGFILE | grep 'userid => 15841' | grep -o "........-....-....-....-............" | awk 'ORS="|"') | |
OUTPUT=${OUTPUT%?}; | |
echo $OUTPUT | |
egrep -an $OUTPUT $LOGFILE | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment