Grok Pattern that captures lines\events that starts with a specific text

I have a pattern word that appears multiple times in my logs. I want to set a tag for those lines which starts with a nonspace + the pattern text + Any data.

Following is a snippet from my log

Word :
   This is Changeset: xyz

I tried following grok but is not working as I expected


I cannot use the second one as it may match other lines that has "Changeset: " text.

Need help with a grok that a line start with no space + Changeset: + Any data after that

This should work:


Your first attempt doesn't work because NOTSPACE is defined as \S+, and the line you want to match doesn't contain at least one non-space character before "Changeset:".