Skip to content

Instantly share code, notes, and snippets.

@yuki-takeichi
Created August 12, 2016 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuki-takeichi/6467156dab1f5bb1ef27bbce991e38aa to your computer and use it in GitHub Desktop.
Save yuki-takeichi/6467156dab1f5bb1ef27bbce991e38aa to your computer and use it in GitHub Desktop.
papertrail-logfilter
#! /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