Nawk in a tail - syntax question

Hello. I run the following command to get data from a logfile:

nawk 'BEGIN {FS="|"} {if ($6=="sonusSgxConfigurationErrorNotification") print ":" $10 ":" $11}' sonustrap.log | nawk 'BEGIN {FS=":"} {print $3 $5}'

This command is 'static' from the .log file, however I wanted tail -f this and have it reported in realtime. I have tried the below command however I can not seem to get the syntax correct to tail the above:

tail -f `nawk 'BEGIN {FS="|"} {if ($6=="sonusSgxConfigurationErrorNotification") print ":" $10 ":" $11}' sonustrap.log | nawk 'BEGIN {FS=":"} {print $3 $5}'`

I am learning as I go with UNIX, and I think that this is a simple syntax question. Can someone help?

Thanks.

Not sure what exactly you want but try this...

nawk 'BEGIN {FS="|"} {if ($6=="sonusSgxConfigurationErrorNotification") print ":" $10 ":" $11}' sonustrap.log | nawk 'BEGIN {FS=":"} {print $3 $5}' | tail -f

malcomex999,

Thanks, but that didn't do it. It did give slightly different results, although I am not sure exacly what and either way, not tail'ing the open file.

All that I am looking to do is get the same data as I am getting from the inital nawk query (filtered, restructured, etc), however 'as it is generated' in the log file.

I am guessing that I need to put the tail -f in front with some sort of ' or " or ` symbol, however none of those seem to work.

you need to tail -f sonustrap.log and then pipe it through the awk statements. However in order to do that you have to stop awk from buffering. Standard awk does not offer that possibility. Some awks do. Have a look at this post