Created
August 12, 2016 03:58
-
-
Save yuki-takeichi/6467156dab1f5bb1ef27bbce991e38aa to your computer and use it in GitHub Desktop.
papertrail-logfilter
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
#! /bin/bash | |
# extracts a log file for a specified host from Papertrail tsv file | |
HOSTNAME=$1 | |
FILENAME=$2 | |
TSVFILE=$3 | |
awk -F '\t' "{if (\$5 == \"$HOSTNAME\" && \$9 == \"$FILENAME\") print \$10}" $TSVFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment