thank you for your code Scrutinizer. it works perfectly!
one more request.
the actual datafile looks like this:
0,tomcat_logcheck,1483897732,240,/opt/apps/plmviewcafe/logs/catalina.out,16K,tomcat_logcheck,14560,Master_Item_Service_is_down=0_njava_lang_NoClassDefFoundError=0_njava_lang_OutOfMemoryError=0_nemxCommonAppInitialization__Error_while_initializing=0_nINFO__Stopping_Coyote_HTTP_1_1_on_http_8080=0_nThe_file_or_directory_is_corrupted_and_unreadable=0_n,174--240,181
0,tomcat_logcheck,1483898023,309,/opt/apps/plmviewcafe/logs/catalina.out,20K,tomcat_logcheck,19277,Master_Item_Service_is_down=0_njava_lang_NoClassDefFoundError=0_njava_lang_OutOfMemoryError=0_nemxCommonAppInitialization__Error_while_initializing=0_nINFO__Stopping_Coyote_HTTP_1_1_on_http_8080=0_nThe_file_or_directory_is_corrupted_and_unreadable=0_n,240--309,25
and i run the following awk command on the data:
gawk -v SEARCHPATT="${SEARCHPATT}" -v ADDISTR="${INCEXCSTR}" -F, '/,'"${VALFOUND}"',/,0 {A=strftime("%a %b %d %T %Y,%s",$3);if((NF == 13) && (A ~ ADDISTR) && (A ~ SEARCHPATT)) {print $12"-"$3"_0""-" $13"----"A} else if ((NF == 14) && (A ~ ADDISTR) && (A ~ SEARCHPATT)) {print $12"-"$3"_0""-" $13"----"A} else if ((NF == 10) && (A ~ ADDISTR) && (A ~ SEARCHPATT)) {print $9"-"$3"_"$10"----"A} else if ((NF == 11) && (A ~ SEARCHPATT)) {print $9"-"$3"_"$10"----"A} }' datafile.txt | awk -F"----" '{print $1}'
which normally produces an expected output similar to this:
0-1424534260_8--8
0-1424534560_8--8
0-1424534860_8--8
0-1424535160_8--8
0-1424535460_8--8
0-1424535760_8--8
0-1424536060_8--8
0-1424536360_8--8
i get the above output only if the 9th field contains a value. but if the 9th field contains the original values I posted in this thread, "Master_Item_Service_is_down=0 java_lang_NoClassDefFoundError=0 java_lang_OutOfMemoryError=1 emxCommonAppInitialization__Error_while_initializing=0 ", i get output similar to the following, which is not what i want.:
emxCommonAppInitialization__Error_while_initializing=0-- INFO__Stopping_Coyote_HTTP_1_1_on_http_8080=0-- java_lang_NoClassDefFoundError=0-- java_lang_OutOfMemoryError=0-- Master_Item_Service_is_down=0-- The_file_or_directory_is_corrupted_and_unreadable=0-1413868231_12043--12043
so i would like to incorporate your command into my original command that i pasted in this post, so that it adds up all the values in the 9th frield and then shows the expected output:
0-1413868231_12043--12043
.....
with the bolded being the total of all the values in that 9th column. sorry if i just made this too complicated.