I am trying to capture the string between 2 specific letters/words using sed/awk. This is what I am trying to do:

The input is a file `test.log` containing

```
Owner: CN=abc.samplecerrt.com,o=IN,DC=com
Owner: CN=abc1.samplecerrt.com,o=IN,DC=com

```

I want to extract only "CN=abc.samplecerrt.com"

I tried

```
sed 's/.*CN=\(.*\),.*/\1/p' test.log >> result.log

```

But this returns "abc.samplecerrt.com,o=IN,DC=com"

How do I go about this?