title: awk compare multiple parameters to variable
body: <p>I'm trying to parse through some error apache logs for the past 24 hours and need to compare the combination of some positional parameters to another awk variable</p>
  
  <pre><code>awk -vCurDate=`$1 $2 $3` -vDateT=`date -d'now-24 hours' +[%a %b %d %H:%M:%S:%f %Y` ' { if (CurDate &gt; vDate)  print $0 }' error_log
  </code></pre>
  
  <p>The start of the line in the log file looks like this:</p>
  
  <pre><code>[Sun Apr 19 03:20:14.381242 2017]
  </code></pre>
  
  <p>Error output I'm getting:</p>
  
  <pre><code>usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
              [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
  </code></pre>
  
  <p>When I just try to print out the value of <code>CurDate</code> I'm not getting the expected results. It just spits out a bunch of empty lines. Is the way I'm declaring <code>curDate</code> allowed?</p>
  
  <pre><code>awk -vCurDate=`$1 $2 $3` -vDateT="`date -d'now-24 hours' +'[%a %b %d'`" ' { print CurDate}' error_log
  </code></pre>