Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove entries from log file

Status
Not open for further replies.

SM777

Technical User
Mar 7, 2001
208
GB
How can I strip lines from my access_log file?

I can grep to extract them to a file but I want to remove all those darn Code Red default.ida lines which are screwing up my stats reports.

Is this possible with a Grep? i.e. extract all but lines containing 'default.ida'
 
Try this
cat access.log |sed -e s/default.ida//g

It worked on a file I used as a test. All it really does is substitute a null value for "default.ida" thus deleteing the entry. Hope it works/helps. :)
d3funct
zimmer.jon@cfwy.com
The software required `Windows 95 or better', so I installed Linux.

 
I forgot to tell you to redirect the command to a new file. Sorry. Actually if you copy your access.log to another name (cp access.log access.log.cr) then do
cat access.log.cr |sed -e s/default.ida//g >>access.log.new Then review the new file and once your satisfied do "mv access.log.new access.log" d3funct
zimmer.jon@cfwy.com
The software required `Windows 95 or better', so I installed Linux.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top