search in logs question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alex79
    Confirmed User
    • Jun 2002
    • 996

    #1

    search in logs question

    how do i search for a text in log files from my server?
    the log files are very big and i can't open each file and search for that text
  • Gungadin
    Confirmed User
    • Aug 2005
    • 444

    #2
    Unix/linux/bsd/etc:

    >grep -i -r "your stuff here" /path/to/your/access_log

    The -i is case INsensitive
    The -r is recursive
    (You may not need either)

    Hope this helps...
    The GFY popularity contest scoreboard

    Comment

    • PussyTeenies
      Confirmed User
      • Feb 2005
      • 6496

      #3
      Originally posted by Gungadin
      Unix/linux/bsd/etc:

      >grep -i -r "your stuff here" /path/to/your/access_log

      The -i is case INsensitive
      The -r is recursive
      (You may not need either)

      Hope this helps...
      if its freebsd instead of "-r" you can also use "-R"

      and for tgz archives use
      Code:
      zcat archive_file.tgz | grep -R -i "your stuff"
      Need adult hosting?

      Contact us!
      WARM Hosting

      Need an IT solution? or someone to check your site and security? Nossie - IT Professional

      Comment

      • alex79
        Confirmed User
        • Jun 2002
        • 996

        #4
        Originally posted by Gungadin
        Unix/linux/bsd/etc:

        >grep -i -r "your stuff here" /path/to/your/access_log

        The -i is case INsensitive
        The -r is recursive
        (You may not need either)

        Hope this helps...

        instead of " /path/to/your/access_log" can i enter a directory to search all files from that directory?

        Comment

        Working...