VIM - Regex - Multi-Line Search Query for changes in field value -
I have a large log file that includes an example of a device driver failing. Driver buffer is supposed to provide data, which the client reads the application. The driver logs the amount of data in the buffer before and after reading in the 512 byte chunks, and transmits the data to the customer. There are several junk data scattered randomly in many lines in the log file, below is a brief example or a general working case. Before transfer: 1: Available 512 bytes ... after junk data transfer 1: Available by 0 bytes ... before junk data transfer 2: Available 512 bytes ... Junk Data Transfer After: Available in 0 bytes
In the case of an error, it appears (the transfer number is from a specific example; the issue is not always the transfer is at # 35): <34 p> Therefore, I have a multi- Line query where a single amount in "first" reports "available" in the "first" and after "logging statements". I have tried to do this : In addition, this query starts highlighting more than half of the file buffer in VIM. I am assuming this because it finds the matching questions within other questions (i.e. nested result) because i provided it a method to match related with "before" / "after" example Have not done the number in the log file. I would like to set a regex which goes through each match "first" and "after" log line, and see that both the data values (number of bytes) Similar to both "before" and "after" If both of these criteria have been met, then this is a "match", as long as the regex search query is a matter of concern. In the case of a file the desired output, I was parsed more or less manually, was: Thank you. :% s / before transfer. * 512 bytes. \ * Transfer D * 512 bytes
, and it helps to find some of issues, but the amount can be 1024, or 256, or something like "before" and "after" in the logging statement Many of 256 bytes.
35 before transfer: 512 bytes after transfer available 35: 105 9 Available bytes before shifting: 256 bytes available after transfer 105: 256 bytes before available transfer 220: 512 bytes available after transfer 220: 512 bytes available before transfers 250: 2048 bytes available after transfer 250: available 2 048 bytes
Using Vim, you can use the following steps
< Code> v / \ v ^ (before | after) transfer / d% norm jv / \ vbefore transfer {/}Remove all lines before or after transfer
% norm J all remaking lines Join in the note that it believes that after each match with one after another. If it does not, then you have to remove orphaned lines (using a regex :))
v / \ vbefore transfer {-} (\ D + bytes). Delete every line with the number of <-> same bytes of <-> 1 by
Comments
Post a Comment