Exact match for query subject:?

223 views
Skip to first unread message

Tim Mueller

unread,
Jun 5, 2024, 6:25:23 PM6/5/24
to GAM for Google Workspace
I am trying to search Gmail for an exact subject match (Subject:Today) but so far I can only get results that include the search term, e.g. "Register Today", etc. I've tried the following commands but keep getting any subject that contains "Today". Where am I going wrong? Thanks.

gam user user...@domain.org show messages query "subject:\"Today\""
gam user user...@domain.org show messages query "subject:'Today'"

Ross Scroggs

unread,
Jun 5, 2024, 6:30:53 PM6/5/24
to google-ap...@googlegroups.com
Send me a Meet/Zoom invitation.

Ross
----
Ross Scroggs



--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/bebeb1b7-bd68-4597-b99f-fe6b2dcad856n%40googlegroups.com.

tmue...@nucharters.org

unread,
Jun 5, 2024, 7:10:51 PM6/5/24
to google-ap...@googlegroups.com
Thanks, Ross.  Here's a PSA for the community:

Google can't do exact matches, but GAM can.  Here's an example:

gam config csv_output_row_filter "Subject:regex:^Today$" redirect csv ./Today.csv user us...@domain.org print messages query "subject:Today"

This filters out all results whose subject is not an exact match to "Today" and puts the remainder in the file Today.csv. ^ means beginning of line and $ means end, so dropping the $ from this example would yield all results with a subject that begins with "Today".

Tim Mueller
Technology Department
Northern United - Humboldt Charter School
Northern United - Siskiyou Charter School


You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/60HSzpUKvq0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/AF8CD1FF-CA05-44FA-A0F8-AF7C7D930EDB%40gmail.com.

Reply all
Reply to author
Forward
0 new messages