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 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
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.