def _filter(self, entry): """ Remove log entries that are not coming from production datacenters """ if not is_from_production_host(entry): return False context = entry.get('@context', {}) # @context is expected to be an object below if type(context) is list: if len(context) > 0: self._logger.warning( 'Got a list as a @context: {}'.format(context)) entry['@context'] = context = {} # get more context (e.g. function name) from the exception message generated by MW additional_context = self._get_context_from_entry(entry) if additional_context is not None: context.update(additional_context) # skip deadlocks (PLATFORM-1110) if context.get('errno') in [ self.ER_LOCK_DEADLOCK, self.ER_LOCK_WAIT_TIMEOUT ]: return False # filter out SMW and DPL errors if context.get('errno') in [self.ER_QUERY_INTERRUPTED, self.ER_CONNECTION_LOST] and \ re.search(r'(SMW|DPLMain|SMWSQLStore2):', context.get('function', '')) is not None: return False return True
def _filter(self, entry): """ Remove log entries that are not coming from production servers """ host = entry.get('@source_host', '') # errors will most likely come from job-s1 if not is_from_production_host(host): return False return True
def _filter(self, entry): if not is_from_production_host(entry): return False # remove those that do not return enough rows context = entry.get('@context', dict()) if context.get('num_rows', 0) < self.ROWS_THRESHOLD: return False return True
def _filter(self, entry): if not is_from_production_host(entry): return False # ignore PHP Fatal errors with backtrace here - they're handled by PHPErrorsSource message = entry.get('@message', '') if message.startswith('PHP Fatal '): return False return True
def _filter(self, entry): return is_from_production_host(entry)
def _filter(self, entry): """ Remove log entries that are not coming from main DC Apache servers """ return is_from_production_host(entry)