grep command to match only request url of access log -


i need find accessed urls having keywords config,tmp,backup or dump.

grep '/config/\|/tmp/\|/backup/\|/dump/' access.log 

when grep access log getting unwanted logs below

106.221.160.250 - - [11/apr/2014:12:07:13 -0400] "get url.com/perfect http/1.1" 200 43 "file:///something/tmp/579928.html" "htc_smart_f3188 mozilla/5.0 (like gecko) obigo/q7" 0 20675

it's unwanted get url.com/perfect http/1.1" 200 43 "file:///something/tmp/579928.html doesn't contain desired keyword.

how should change grep command?

try this:

grep 'tmp\|config\|backup\|dump' accessl.log


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -