Optional grok pattern field doesnt match

Hi, my log looks like this:

"rootModel":"modelR","providedByRM":false,"rm_user":"100001935398@rm.com","publishers":["Unknown"]

the part: ,"rm_user":"100001935398@rm.com" is optional so i marked it with ()?, but it doesnt match when its there, the whole pair is mached to providedByRM field as you can see in picture bellow. Can somebody help?

My grok pattern is:
"rootModel":"%{GREEDYDATA:rootModel}","providedByRM":%{GREEDYDATA:providedByRM}(,"rm_user":"%{GREEDYDATA:rm_user}")?,"publishers":\["%{GREEDYDATA:publishers}"\]

Change all those GREEDYDATA to DATA.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.