Basically I'm looking at a log entry like this:

```
*** Send Command has completed Successfully 
Transmitted 508200 bytes in 1 seconds
File Transfer Complete
RemoteTransactionNumber is ***********
************Server: Transfer Mode Set To Send
: *********************************************************50 al**********b:Y 
lf:"*********************************************************" rf:"*************
*(+1)" **************************************41
2017/04/18 13:05:32 About to execute the following Send command:

```

I've defined a variable $LOGGER and stored the logged data in it because it's on a remote server. I've also created a variable called $currentdate and I'm storing:

```
currentdate=$(date +"%Y/%m/%d/ %I")

```

So my current time while posing this Q looks like: 2017/04/19/ 01

So let's say I want to match on "Send Command has completed Successfully" I've done the following:

```
ALERT=$(echo "$LOGGER" | awk "/Send Command has completed Successfully/" | grep -A 12 $currentdate)

```

I then am trying to grep ahead 12 lines looking for the current date & time up to the hour to make sure the send i'm matching is current because that's all I care about when this script runs.

But that last awk | grep -A 12 command isn't working... any ideas how I can look for the date and verify it matches $currentdate after hitting an awk match? This is all being done on local variables after retrieving a log scrape from an SSH pass command FYI so no actual files are being manipulated at this point.

Edit: so to give a clearer picture as too why i'm doing what i'm trying to do here is any match I get for the current hour I need to report on. And the date is within 12 lines of the "Send Successful" entry. I'm actually using SSH pass to remote into servers, grab the number of log files written to in the last hour. Then I'm going in and grabbing the last 100 lines of each and storing it in the $Logger variable like this:

```
COMMAND1="find /xxy -mmin -60 | wc -l"
FILENUM=`/xxy-1.05/sshpass  -p$PASS ssh -q -o StrictHostKeyChecking=no -o 
ConnectTimeout=310 $USER@$HOST "$COMMAND1"

COMMAND2="find /xxy -mmin -60 | tail -n $FILENUM | xargs tail -n100"
LOGGER=`/xxy-1.05/sshpass  -p$PASS ssh -q -o StrictHostKeyChecking=no -o 
ConnectTimeout=310 $USER@$HOST "$COMMAND2"

```

So given that I need to review every matches date I wasn't sure the best way to go about it and store it clean in a variable (which awk tends to do and why it was my first choice)