0

I have a bunch of logs in multiples .json.gz files.
I can easily get a specific string with:

zgrep "Search This String" *

But now I need to find a specific value inside a key/attribute.
I tried the following code to get a email domain from sender key/attribute.

zgrep -o '"message.sender":"[^"]*@mypattern[^"]*"' *

Unfortunatelly it doesn't work.

PlayHardGoPro
  • 2,791
  • 10
  • 51
  • 90
  • 1
    Please take a look at [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). – Cyrus Sep 01 '23 at 13:31
  • You can usually use grep's `-A` or `-C` to get the context lines around or after what you want. If you're trying to get that pattern and one line before and after, you can use `-C1`. etc. – stevesliva Sep 01 '23 at 22:55

0 Answers0