The documentation on extended attribute filter can be found on this page: http://ez.no/doc/ez_publish/technical_manual/4_0/reference/modules/content/fetch_functions/list
As for where to place it: in an extension, preferably your own extension.
More on extensions: http://ez.no/developer/articles/an_introduction_to_developing_ez_publish_extensions
Or take one of the simplier extended attribute extensions and modify it to your need: http://projects.ez.no/types/ez_publish/extended_attribute_filter