jeudi 28 janvier 2021

Match one pattern plus 2 other patterns, return data in ( ) from both

Need to process massive list of files.

The part I'm interested in has this pattern. (Note one or more of the patterns maybe not exist in the current logs, they only report if there is an error).
Which is why I search for pattern and then by error. Actually the logs are much longer with date and time info, which is not needed.

Ff bb Change: [2:0:1] ALPA (0x13211) Port WWN (c37076082034003d) Le Fg Count changed by (3) (8 - 5) St Lf Count changed by (11) (57 - 46) Pz Sq Ed Count changed by (2) (7 - 5) Ip Tp Wq Count changed by (52) (212 - 160)

What I need to do is:

Ff bb Change: [2:0:1] which is the port, so need just 2:0:1, I need to keep the errors on the line with the port.

Also need Port WWN (c37076082034003d) and then one of the errors like Le Fg Count changed by (3) or St Lf Count changed by (11)

Output needed would look like:

2:0:1 c37076082034003d 3

The I can use that output to sort by 2:0:1 and c37076082034003d an sum the 3

Every thing I tried just throws various errors over the last 2 days of trying.

Aucun commentaire:

Enregistrer un commentaire