Use variable that needs "" in remote ssh command.

I want to use the below but since the date has a space it doesn't grep exactly what's needed. I need to keep the quotes around the variable when it passes it. I need the quotes around $DATE2 just to recognize the variable. Thanks in advance for any help given.

D=`date +%d`
DN=`echo -n $D | wc -c`
if [ $DN = 1 ]; then
  DATE2=`date "+%b  %d"`
elif [ $DN = 2 ]; then
  DATE2=`date "+%b %d"`
fi

FL=`ssh -q $SERVER grep "$DATE2" /var/log/secure | grep Failed | grep -Po "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" | sort | uniq -c | tr "\n" " "`

What happens with:

FL=`ssh -q $SERVER grep "\"$DATE2\"" /var/log/secure | grep Failed | grep -Po "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" | sort | uniq -c | tr "\n" " "`

Can't believe I didn't try that. Needed a fresh set of eye. Thanks for the help.

All of that could likely be performed with one awk and one sort if we knew what you were actually doing, too.