简体   繁体   中英

grep the lines of unknown word

I am able to grep using command

grep "HTTP/1.0\" | 404 "

Similarly how can I grep all other 404 errors. I mean the the values of 1.0 within the HTTP/1.0 changes everytime, so how to grep all the HTTP/* .

I have tried

grep "HTTP/*\" | 404 "

But no use. Please suggest a solution.

When you do not want to use regex and backslashes, you can use dots:

echo 'HTTP/1.0" 404' | grep "HTTP/.... 404"

I think you can find a lot scripts for parsing your access.log. I just found nginx parsing .

让我们尝试一下

grep "HTTP/.* 404"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM