How to split a data assigned to a variable

The requirement is, there is a log file which contains a huge data. i need to get a particular field out of it by searching with another field.

ex:

2011-03-28 13:00:07,423 [http-8080-9] : millis=231 q={ call get_data_account(?,?,?,?,?) }, params=[1:xxxxxx,2:bbbbbbb3:ccccccc,4:dddddd,5:null]

i need to search for the word "get_data_account" in file and from that i need to get the field "xxxxxx" and store it in a variable.

this "get_data_account" will be present more than one time and and there will be different "XXXX" values.

i used it in a for loop for all the files and below is the code.

IFS='\n'
for Search in "$(less "$logfile" | grep get_data_account)"
do
 accountId=`echo "$Search" | awk -F ':' '{print $8}' | cut -d ',' -f1`
 
 echo $accountId 

done

but when i echo the accountId i get the below
accountId='1234
5678
9012
2344'

but when i use it another for loop to display it it is taken as a single string not as a single accountId's and display it in a single line same as the above output.

i have tried both with and with out IFS both are giving the same output.

Hi Jassz,

Using the sample you put with awk, using ":" as Field Separator, It's needed to print $5(you're printing $8) to get the parameter you need as follow:

echo "2011-03-28 13:00:07,423 [http-8080-9] : millis=231 q={ call get_data_account(?,?,?,?,?) }, params=[1:xxxxxx,2:bbbbbbb3:ccccccc,4:dddddd,5:null]
2011-03-28 13:00:07,423 [http-8080-9] : millis=231 q={ call get_data_account(?,?,?,?,?) }, params=[1:yxx1xxxx,2:bbbbbbb3:ccccccc,4:dddddd,5:null]" | 
awk -F":" '/get_data_account/{print substr($5,1,index($5,",")-1)}'
xxxxxx
yxx1xxxx

Or if you have grep above in your code for "get_data_account" simply it could be used:
 awk -F":" '{print substr($5,1,index($5,",")-1)}'

Regards