Count IP hits from Apache


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Count IP hits from Apache
# 1  
Old 05-16-2010
Count IP hits from Apache

Hello folks,

i want to count all apache log file but i dont want to count hits for jpg|gif|txt files. So how it is possible to count number of lines by ignore pictures extension. Pictures is like that

Code:
GET /xyz.png
GET /abcd.jpg
GET/ppp.gif


Last edited by Scott; 05-25-2010 at 04:09 PM.. Reason: Code tags, please...
# 2  
Old 05-16-2010
Something like
Code:
grep -v -e "\.png" -e "\.jpg" -e ".\gif"  -e ".\txt"

# 3  
Old 05-16-2010
it is not working as it should be, can someone else suggest please
# 4  
Old 05-16-2010
Code:
egrep -v "\.png|\.jpg|\.gif|\.txt" |wc -l

pipe the above to wc -l, or just plug in the -c option to keep it all in one...

Code:
egrep -cv "\.png|\.jpg|\.gif|\.txt"


Last edited by curleb; 05-16-2010 at 03:47 PM.. Reason: typo...and then enhancing to answer actual request
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Grep for list of files with only found hits

Hi, With grep -ci word * I get a list of files either they have a hit, or the have not (0). I wanted to pipe to a new list of files, which only shows the files where the string was found, and counted, not the whole bunch. How to do this? Any advice welcome! with best regards, Omar... (11 Replies)
Discussion started by: OmarKN
11 Replies

2. Shell Programming and Scripting

Find a group of result and print last hits

Hi I would like to search some data with awk and then print the last of the hits. Find house and print last value input:red house 4 blue boat 2 green house 6 black car 7 output:6 I now how to search using /house/, print third field print $3, an now I may use some form of $NR to get the... (3 Replies)
Discussion started by: Jotne
3 Replies

3. Shell Programming and Scripting

Grep: Return a user message when no hits

I have ASCII files to parse that 48 hours old or more ; I can identify them like so find . -name "FILE*TXT" -mtime +1 -exec ls -ltas '{}' ';' Some files have a list of hardware errors (we test electronic components), some have none. If the file name has no errors, I still want to... (3 Replies)
Discussion started by: alan
3 Replies

4. Red Hat

Bug hits while installing RHEL 5.5

I have one R710 Dell Box, when i try to install the RHEL on the system the installation stops with following error "Assertion (heads < 256) at disk_dos.c:486 in function probe_partition_for_geom() failed." I 'm unable to ignore/cancel the same and have hard boot the server. ... (0 Replies)
Discussion started by: fugitive
0 Replies

5. UNIX and Linux Applications

Web Hits from Unix

Hi Guys, How can I get the number of web server hits from the command prompt, I like shell scripting ways of finding such data. Can anyone help? (1 Reply)
Discussion started by: Negm
1 Replies

6. Shell Programming and Scripting

Shell Script calculate the hits ?!

could you please find a solution for this a complex command using pipes to Calculate the number of hits per client in Squid log file (access.log), the command should display most active hosts first. Line example 1197979501.787 1 10.1.14.62 TCP_NEGATIVE_HIT/404 1463 GET http://url The... (0 Replies)
Discussion started by: anything
0 Replies
Login or Register to Ask a Question