Find all access logs for a specific IP in the IP list and generate the corresponding files

Source: Internet
Author: User
Tags egrep



#!/bin/sh#  feature: Find all access logs for a specific IP from the IP list and generate the corresponding files #      #mkdir   handle>  com.ip.txtfunction handle () {         #echo   "egrep  "$"   0602.log  > handle/$n. txt "         egrep  "$"   0602.log  > handle/$1.txt         time= ' wc -l  handle/$n .txt  |awk  ' {print $1} '          mv handle/$1.txt handle/$1__${time}.txt          #sed  -i  "/$1/d"  0602.log         echo $1 >> com.ip.txt        sleep  0.02}m=0for n in  ' cat diff.ip  ' do        m= ' expr  $m  + 1 '  &Nbsp;      a= ' expr  $m  % 100 '     if [   $a  -eq 0 ]        then         sleep 20    fi     sleep 0.5     handle  $n   &done


This article is from the "Struggle Bar" blog, please be sure to keep this source http://lvnian.blog.51cto.com/7155281/1831608

Find all access logs for a specific IP in the IP list and generate the corresponding files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.