pattern search for multiple log files and counting

I have 10 appservers and each appserver has 4 jvms . Each of these logs is archived and stored on a nfs directory . For example the files are

/logs/200907/ap1-jvm1.server.log.20090715.gz
/logs/200907/ap2-jvm2.server.log.20090714.gz
/logs/200908/ap1-jvm1.server.log.20090812.gz

I want to search for say some pattern from these files from say august 15th to sept 15th and give me a count of that pattern .For example I want a daily count from aug15-sept 15 for app server and jvm for pattern "Exception" from the log . It should look like

-----
Aug 15
3434
Aug 16
2323
....
....
Sept10
5656

thanks
Gubbs

It is very simple, if i got your question correctly.,

$ zgrep -c 'Exception' FILENAMEs

But it will be good to ask a question, along with what you tried ? and what is the issue you are facing ?

Thanks for the response . Here is what is working if I need it for one day

for m in 25;do for q in 1 2 3  ; do for r in 1 2  ; do ssh -q hostname "/bin/zcat /logs/ap${q}-jvm${r}.server.log.200908${k}.gz|grep 'Exception'|wc -l";done;done;done|awk '{SUM+=$1} END {print SUM}'

This gives me for that particular day ...I am having trouble when I want to give it a range .Essentially "wc -l" does the same as "zgrep -c "

For example I tried

for m in 20 21 22 23 24 25;do for q in 1 2 3 4 5 6 7 8 9 10 ; do for r in 1 2 3 4 ; do ssh -q hostname "/bin/zcat /logs/ap${q}-jvm${r}.server.log.200908${k}.gz|grep 'Exception'|wc -l|awk '{SUM+=$1} END {print SUM}'";done;done;done

I get the following error

awk: cmd. line:1: {SUM+=} END {print SUM}
awk: cmd. line:1:       ^ syntax error

so basically I want a count of "Exception" per day from multiple files and want to report it for each day

day1 
23232
day 2
23232
day3 
42323

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums