Again, you can't nest quotes of the same type.
Read through your full ssh command, you have an open single quote after mastghg, this quote is CLOSED after the awk, and then opened and immediately closed again at the end of the command.
When you run
Code:
echo var1'var2'var3'var4'var5
it looks like
Code:
echo var1'var2'var3'var4'var5
when what you apparently want is
Code:
echo var1'var2'var3'var4'var5
with the var3 in its own quote pair inside the outer quote pair. But you can't nest quotes of the same type like that. When you open one, the next one it runs into will close the first, it won't open a second. So this:
Code:
ssh -q mastghg 'stats1.pl stats:dat | grep data | grep -w 0 | awk '{system("cat /opt/jhh/etc/configuration.xml | grep "$1)}''
gets interpreted like this:
Code:
ssh -q mastghg 'stats1.pl stats:dat | grep data | grep -w 0 | awk '{system("cat /opt/jhh/etc/configuration.xml | grep "$1)}''