[PATCH v3 07/23] log: Add function to create a filter with flags