How to zgrep a specific key:value from .json.gz file

51 Views Asked by At

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.

0

There are 0 best solutions below