It's really easy to use grep to check before and after. I used to be confused and couldn't check before and after, but now it's OK

 

-A see N lines following the matching line

-B see N lines before the matching line

-number see lines before and after

 

[root@host33 enterprise]# grep -A 3 ' message'  *app.log |more
Please report this message and include the following information to us.<br/>
Thank you very much!</p>
<table>
<tr>
--
Please report this message and include the following information to us.<br/>
Thank you very much!</p>
<table>
<tr>

[root@host33 enterprise]# grep -B 3 ' message'  *app.log |more
<body bgcolor="white">
<h1>502 Bad Gateway</h1>
<p>The proxy server received an invalid response from an upstream server. Sorry for the inconvenience.<br/>
Please report this message and include the following information to us.<br/>
--

[root@host33 enterprise]# grep -3 ' message'  *app.log |more
<body bgcolor="white">
<h1>502 Bad Gateway</h1>
<p>The proxy server received an invalid response from an upstream server. Sorry for the inconvenience.<br/>
Please report this message and include the following information to us.<br/>
Thank you very much!</p>
<table>
<tr>
--

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326929114&siteId=291194637